?
avatar lunopad
lunopad
26 Aug 2016

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)

avatar lunopad lunopad - open - 26 Aug 2016
avatar zero-24
zero-24 - comment - 26 Aug 2016

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

avatar zero-24
zero-24 - comment - 26 Aug 2016

As workarround you can download that file and install it in com_joomlaupdate via upload install.

avatar brianteeman
brianteeman - comment - 26 Aug 2016

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/

avatar brianteeman brianteeman - change - 26 Aug 2016
Labels Added: ?
avatar mbabker
mbabker - comment - 26 Aug 2016

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.

avatar zero-24
zero-24 - comment - 26 Aug 2016

Sorry @mbabker i don't want to blame you for that, i just want to be sure that it is nothing expected.

But waht about the idea to allow more response codes than just 200? like 301, 302 and other (not checked them all yet)

avatar mbabker
mbabker - comment - 26 Aug 2016

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.

avatar Bakual
Bakual - comment - 26 Aug 2016

One redirect is expected as the actual file is served from AmazonS3, not GitHub.com.

avatar zero-24 zero-24 - change - 30 Aug 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-08-30 07:13:55
Closed_By zero-24
avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2016
Closed_By zero-24 joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 30 Aug 2016
avatar joomla-cms-bot
joomla-cms-bot - comment - 30 Aug 2016

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/11806

avatar zero-24
zero-24 - comment - 30 Aug 2016

PR is: #11845


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11806.

avatar andrepereiradasilva
andrepereiradasilva - comment - 30 Aug 2016

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

avatar andrepereiradasilva
andrepereiradasilva - comment - 30 Aug 2016

@lunopad can you check my comment?

avatar zero-24 zero-24 - change - 30 Aug 2016
Status Closed Information Required
Closed_Date 2016-08-30 07:13:54
Closed_By joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - reopen - 30 Aug 2016
avatar joomla-cms-bot
joomla-cms-bot - comment - 30 Aug 2016
avatar lunopad
lunopad - comment - 31 Aug 2016

@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.

avatar brianteeman
brianteeman - comment - 31 Aug 2016

Closed

avatar brianteeman brianteeman - change - 31 Aug 2016
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2016-08-31 07:21:12
Closed_By brianteeman
avatar brianteeman brianteeman - close - 31 Aug 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 31 Aug 2016

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?

avatar mbabker
mbabker - comment - 31 Aug 2016

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).

Add a Comment

Login with GitHub to post a comment