-
Notifications
You must be signed in to change notification settings - Fork 176
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
Cannot Update Plugins: "Download Failed. Bad Request." #4
Comments
Try downloading the update manually and see what error message (if any) you get. While the download URL can be truncated in the plugin update log, you can get it another way:
|
Hi, Thanks for the reply. When I download the update manually, the file does download without error. I am installing the debug components and will let you know those results as soon as I have them. Thanks! Mark |
The "Download URL" in the debug information only shows up as: http://plugins.mydomain.com/updates/? (My domain redacted.) Note: I am using WordPress 3.6 in case it's relevant. |
That URL is definitely wrong. There should be at least two parameters after the question mark. Some ideas:
|
Thanks. The "download_url" key in the JSON is the same incorrect URL: "download_url":"http://plugins.mydomain.com/updates/?" There are no PHP error logs at all. I'll take a look at the code you mentioned which generates the download URL, and add anything else I find. Thanks! Mark |
Strange, I can't find any reason that the entire URL isn't generated. However I probably don't know a fraction of what you do about how to diagnose and debug it, sorry. :-( |
Sorry, I'm not sure what else to do in terms of diagnosing and debugging. Could this be an issue caused by something new in WP 3.6? |
Probably not 3.6-related, no. I have a commercial plugin that relies on this library, and it runs fine on my WP 3.6 site. Did you try adding some debug output to the function I mentioned? Even something as simple as this could help:
This modified version will dump the values of the three main variables involved in download URL generation into the JSON output. You can then view the metadata URL in the browser and see if the values make sense. If it turns out that, for example, the |
Hi, Okay, I've found something relevant. We're running PHP 5.4 on this server. Just to see if it was an issue with that version, I reverted to PHP 5.3. And the problem went away. (Well, I didn't test completely but the JSON data shows the proper URL in PHP 5.3. So I'd assume that all your code is fine but there is some function or other element that is incompatible with PHP 5.4. I'm wondering what would be necessary to make it work in 5.4, as we'll need to keep current on PHP versions. I hope this helps! Thanks, Mark |
I also tested in PHP 5.5, and it seems to work there. So, to recap:
In each case the PHP configurations are identical in terms of modules (except for any that aren't supported in the particular version). Again, hope this helps. |
Interesting. Which minor version of PHP 5.4 are you using? I just tested it in PHP 5.4.3 and it output the correct download URL. This was when running the update server as a stand-alone script, not a WP plugin. The only issue I noticed was a bunch of unrelated E_STRICT warnings. There doesn't seem to be any code that would be obviously incompatible with PHP 5.4, but it's possible that one of the functions or syntax features that it uses has a subtly different behaviour in your PHP version and that is what trips it up. I would still recommend adding some debugging code to the relevant method(s). Also, in case the problem is somehow related to closures, try commenting out these lines in
|
It is 5.4.19. We can use PHP 5.5 as a workaround, however I'll follow your debugging suggestions and continue working on this in case we can help someone else using 5.4. I'll post any relevant results ASAP. |
The problem seems to be solved by commenting out the lines you suggested:
|
Hmm, are you completely sure it is PHP 5.4.19 and not something older? The only reason I can think of that would cause those lines to fail is if the PHP version used did not support closures. Closures were introduced in PHP 5.3. By the way, I just tested it with PHP 5.4.19 (on Windows) and still could not reproduce the problem. |
Hello,
I've followed the instructions to the letter, and the JSON info check works.
When I install a test plugin in WP, the newer version (in our repository using your system) is properly detected. But when we attempt to invoke the update, it fails with this error message:
"Download Failed. Bad Request." (or something to that effect).
The attempted download URL is truncated for display (... at the end), but the first portion appears correct.
Any help would be appreciated. This looks like a wonderful system!
Thanks,
Mark
The text was updated successfully, but these errors were encountered: