?
avatar ron4mac
ron4mac
11 Jan 2017

Steps to reproduce the issue

Try to update extension that provides a downloadurl that is a link to a Github zipball.

Expected result

Extension should be updated in a normal manner.

Actual result

Error message:
Error connecting to the server: No HTTP response code found.

System information (as much as possible)

Joomla 3.6.5
PHP Version 5.6.29
Web Server Apache
cURL Information 7.45.0

Additional comments

Failure is due to Github not receiving any user_agent.

avatar ron4mac ron4mac - open - 11 Jan 2017
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jan 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Jan 2017
avatar n9iels
n9iels - comment - 13 Jan 2017

@ron4mac can you please provide an url as example? My own extension is using GitHub as update server and I don't have problems at all. My update urls looks like this https://github.com/n9iels/mod_jversions/archive/V2.0.1.zip (it is connected to a Release)

avatar ron4mac
ron4mac - comment - 13 Jan 2017

My use case might be a bit unique. I use a php script to generate the update.xml based on the releases that are at Github (via api.github.com). This would be a sample of that output. The links are via api.github.com and that may be the reason that Github is requiring the user_agent. I suppose I could interpolate the links given by the api into /archive/ varieties as in your example.

Regardless of any of that, it would seem appropriate that using a fopen() stream should have use of a user_agent just as is being done for curl,etc. by use of ini_set('user_agent', {Installer}).

avatar mbabker
mbabker - comment - 13 Jan 2017

Generally the API gives responses to the non-api.github.com resources, so you should be able to use those. I'd definitely consider it best practice to not use the API subdomain unless you're explicitly intending for the consumers of that update.xml file to ping the API versus make a "normal" request.

And I'd say we should be setting the user agent through the HTTP adapter for this case instead of changing the global PHP configuration. Even worse here is that the change isn't being reverted so we're changing the global configuration in a way that causes side effects for the rest of the process' lifetime.

avatar ron4mac
ron4mac - comment - 13 Jan 2017

@mbabker The ini_set() wasn't my doing there.
I appreciate your advice about not using the API links and will follow that course.

Thanks, all. Sorry to create some noise.

avatar ron4mac ron4mac - change - 13 Jan 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-01-13 16:37:04
Closed_By ron4mac
avatar ron4mac ron4mac - close - 13 Jan 2017
avatar mbabker
mbabker - comment - 13 Jan 2017

@mbabker The ini_set() wasn't my doing there.

I know, just pointing out a bad design decision in that same section of code is all and that we should fix that too.

Add a Comment

Login with GitHub to post a comment