Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download issue....PCLZIP_ERR_BAD_FORMAT #35

Open
satbav opened this issue Dec 15, 2013 · 9 comments
Open

Download issue....PCLZIP_ERR_BAD_FORMAT #35

satbav opened this issue Dec 15, 2013 · 9 comments

Comments

@satbav
Copy link

satbav commented Dec 15, 2013

Hi,

I seem to have a working version of the updater and am using it to auto download an update from a private repository on BitBucket.

The error the Wordpress updater gives is:

Downloading update from https://bitbucket.org/username/product-name/get/master.zip…

Unpacking the update…

The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature.

I'm struggling to see what the issue is now. It's happening on localhost and on my development server.

I've used the method described to integrate within a plugin. Copied the 'git-plugin-updates' to the root of my plugin folder. And added:

To initiate actions:
add_action( 'plugins_loaded', array($this, 'myplugin_git_updater' ));
add_filter( 'gpu_use_plugin_uri_header', '__return_true' );

The method:
public function myplugin_git_updater() {
if ( is_admin() && !class_exists( 'GPU_Controller' ) ) {
require_once dirname( FILE ) . '/git-plugin-updates/git-plugin-updates.php';
add_action( 'plugins_loaded', 'GPU_Controller::get_instance', 20 );
}
}

It may be worth noting that I've also added an action that I think turns off ssl verification:
add_action('http_request_args', array($this, 'no_ssl_http_request_args' ), 10, 2);

public function no_ssl_http_request_args($args, $url) {
$args['sslverify'] = false;
return $args;
}

Without this, I get this issue:
Downloading update from https://bitbucket.org/username/product-name/get/master.zip…

Download failed. SSL certificate problem: unable to get local issuer certificate

My main issue is the bad zip issue, the internet seems to think it's lack of space, an incorrect http.php file, that's all though, and I'm not sure why I can't find a solution for this?

Really hope you can help,

Thanks,
Bav

@pdclark
Copy link
Owner

pdclark commented Dec 17, 2013

Is it a private repo? If so, is a username and password set in the URL, and does the username/password you're using have access? If your username is an email, you may have to use %40 instead of @. (I think the plugin takes care of that, but then again, it should turn off SSL verification too.)

Do you have a sample repo that could be used for testing?

@satbav
Copy link
Author

satbav commented Dec 17, 2013

Hi Paul,

Thanks for getting back to me. Yes, this is a private repo, so for the sake of security, I've created a fresh new bitbucket account, and added in a fresh dummy plugin repository with the exact same conditions.

U: bavtest
P: blatantpassword

bitbucket.org/bavtest/test-plugin

These are the actions I've taken:

  1. Commited all of plugin to repo as version 0.1
  2. Changed version to 2.8 in header, and commited to repo.

At this point, this is what I assume to be the latest version of the plugin, that I wish to auto update from.

  1. Added version 0.1 to my wordpress site.
  2. Copied in the git-plugin-updates plugin folder from your master branch.
  3. Updated the headers in test-plugin.php to include a GIT URI: https://bavtest:[email protected]/bavtest/test-plugin
  4. Added some actions to TestPlugin_Plugin.php which runs the update check code as per your instructions.

You can download this very version from the downloads tab:
https://bitbucket.org/bavtest/test-plugin/downloads.

You should be able to unzip this v0.1 plugin to your plugins folder, and test it from there.

At this point, I was hoping it would just download the new v2.0 zip from the master branch (as it certainly seems to do from the code), but for some reason I just can't get past the bad_zip error.

I was thinking it could be that BitBucket is sending an archive format that the pclzip library can't decode, but that wouldn't explain why it works for everyone else?

Another issue could be that I'm running locally on windows, however I get the same issue when running online on a linux server.

Currently right now, the 'Test Plugin' is not showing up with an update message, so I haven't even been able to see if it works, however with my actual plugin that I'm testing with, it seemed to sporadically appear after a while, so I'm expecting it to in a short while.

I've tried forcing the 'check updates' but that doesn't seem to fix my issue.

I massively appreciate any time you can spend on figuring out what's happening here, please do ask if you need any more info from me.

Thanks,
Bav

@satbav
Copy link
Author

satbav commented Dec 17, 2013

I can confirm that the plugin is now detecting that there is an update,and returning the same original bad zip error, so you should e able to see what's wrong in this one.

Thanks again!

@rtvenge
Copy link

rtvenge commented Feb 12, 2014

Did you ever figure out what was wrong? I'm seeing the same issue.

@satbav
Copy link
Author

satbav commented Feb 12, 2014

No, it's still on my list of things to figure out but just lower priority. It's good to see it wasn't the only one getting the error though!

@rtvenge
Copy link

rtvenge commented Feb 12, 2014

Ok great! Yeah, I may be able to help out too. I haven't had a chance to really look at how the code is working, and what the root cause of the problem is.

I feel like the basic authentication (http://username:[email protected]/blahblah) doesn't seem to work when requesting in a browser. That's about as far as I got. :) But the curl command did (ref StackOverflow)

@afragen
Copy link
Contributor

afragen commented Feb 27, 2014

It seems that Bitbucket does not allow the "public" downloading of private repos. https://bitbucket.org/site/master/issue/1087/private-repository-public-downloads-bb-733

@afragen
Copy link
Contributor

afragen commented Mar 1, 2014

I was in error above. This does work in Bitbucket. You must have the URI in the format https://<user>:<password>@bitbucket.org/<owner>/<repo>

@afragen
Copy link
Contributor

afragen commented Jan 6, 2015

FYI, I've managed to get this working in https://github.com/afragen/github-updater

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants