I was trying to update Joomla! from version 3.6.0 to 3.6.2 using the Update component, but all I had is the message "Download of update package failed".
So, I made a brief research and discovered where it fails:
joomla-cms/administrator/components/com_joomlaupdate/models/default.php
317 line:
if (!$result || ($result->code != 200 && $result->code != 310))
{
return false;
}
so, we have to get 200 or 310 to continue downloading
in my case $result->code == 302
$result->code is the server response code
and https://developer.mozilla.org/en-US/docs/Web/HTTP/Status says there is no such response code as 310.
Is it a bug or do I do something wrong?
Thank you.
(according to logs joomla was trying to download update package from https://github.com/joomla/joomla-cms/releases/download/3.6.2/Joomla_3.6.2-Stable-Update_Package.zip)
As workarround you can download that file and install it in com_joomlaupdate via upload install.
iirc 310 is "too many redirects"
On 26 August 2016 at 11:41, lunopad notifications@github.com wrote:
I was trying to update Joomla! from version 3.6.0 to 3.6.2 using the
Update component, but all I had is the message "Download of update package
failed".So, I made a brief research and discovered where it fails:
joomla-cms/administrator/components/com_joomlaupdate/models/default.php
317 line:if (!$result || ($result->code != 200 && $result->code != 310))
{
return false;
}so, we have to get 200 or 310 to continue downloading
in my case $result->code == 302
$result->code is the server response code
and https://developer.mozilla.org/en-US/docs/Web/HTTP/Status says there
is no such response code as 310.Is it a bug or do I do something wrong?
Thank you.(according to logs joomla was trying to download update package from
https://github.com/joomla/joomla-cms/releases/download/
3.6.2/Joomla_3.6.2-Stable-Update_Package.zip)—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11806, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPH8fh4FR_N_7PGv0GhO8QmxP_3bS-Iks5qjsLlgaJpZM4Jt9QW
.
Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/
Labels |
Added:
?
|
If it's not listed at https://developer.github.com/changes/ then I know nothing about GitHub making infrastructure changes. It's not like I have a direct line to their development staff or something.
I don't know what changed or when. If whatever URL we're requesting is issuing 30x responses (or even if it's possible in a future scenario) we should be accounting for that.
One redirect is expected as the actual file is served from AmazonS3, not GitHub.com.
I mean something like this: https://github.com/joomla/joomla-cms/compare/staging...zero-24:allowedResponseCodes?expand=1
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-30 07:13:55 |
Closed_By | ⇒ | zero-24 |
Closed_By | zero-24 | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/11806
PR is: #11845
I read the issue and seems to be an issue in very particular case. Don't you have curl enabled?
At least IIRC joomla update uses JHttp that, in most installations, uses curl for fetching URLs.
Curl fetchs and follows the redirects itself, except in some older versions, and even for that, a fallback was created in JHttpTransportCurl
.
See https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/http/transport/curl.php#L165
And the fallback https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/http/transport/curl.php#L224
Status | Closed | ⇒ | Information Required |
Closed_Date | 2016-08-30 07:13:54 | ⇒ | |
Closed_By | joomla-cms-bot | ⇒ |
Set to "open" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/11806
@zero-24, thanks a lot. I was following the conversation, so I did follow your advice and updated my joomla via "upload install" and it worked just fine.
Also I checked my php if it has curl enabled, as @andrepereiradasilva supposed. And yes, it was disabled. So, probably that was the problem. Thank you, @andrepereiradasilva , as well.
UPD: yep, that seem to be actual reason I couldn't download the update file. I have another installation of joomla on the same server which had to be updated. And now, after enabling the curl, it updated via "live update" without any errors. Sorry for bothering you and thanks again.
Closed
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-31 07:21:12 |
Closed_By | ⇒ | brianteeman |
actually, IMHO, this question detected, an issue, besides curl, Joomla as two other HTTP transport mecanisms.
By looking at this issue, it seems the other JHttp transport methods (stream and socket), probably are not following HTTP redirects. And, IMHO all HTTP transport methods should follow the same behaviour, so they can be used as fallback.
@mbabker , since JHttp is from Joomla framework, what do you think. Is this an inconsistency that needs to be addressed there?
If they aren't following redirects they should.
In the CMS, the one thing the curl transport is doing that the Framework version isn't is manually checking for a Location
header after building the Response object and making a request for the redirected location if it isn't automatically followed. For sockets and streams, the behavior is consistent in both (sockets doesn't have an option to follow redirects automatically so our code is doing the manual check and streams relies on the follow_location
option with no manual checks).
Hmm 302 is found.. Maybe github has changed something? @mbabker do you know something about that? Maybe we should extend the response code checks? (on different places)
Same issue can be on a 301 response code / redirect