General developer forum

 
 
Picture of Joseph Rézeau
Unable to fetch available updates data - unexpected cURL error.
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Hi all,

On my local machine I have installed moodle 1.9, 2.3, 2.4 and master (2.5). Just today I updated all versions to the latest available (using GIT). All went fine, but now I have a problem when using the Check for available updates feature.

on my moodle 2.3 installation : Check for available updates works OK. It tells me:

There is a newer Moodle version available!
Moodle 2.4+ (Build: 20121220) Version 2012120300.05 Stable version Download

on my moodle 2.4 and master (2.5) Check for available updates throws the following error:

Unable to fetch available updates data - unexpected cURL error.

More information about this error
Debug info: cURL error 60: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Error code: err_response_curl
Stack trace:

    line 832 of \lib\pluginlib.php: available_update_checker_exception thrown
    line 718 of \lib\pluginlib.php: call to available_update_checker->get_response()
    line 481 of \admin\index.php: call to available_update_checker->fetch()

I also have a 2.4 test site online: Moodle 2.4+ (Build: 20121220). On that online site, Check for available updates works OK. It tells me:

Your Moodle code is up-to-date!
Last check done on 30 December 2012, 11:22 AM

I'm really baffled by this situation. Has something gone wrong in today's update to moodle version?

Joseph

 
Average of ratings: -
Dan at desk in Moodle HQ, Perth
Re: Unable to fetch available updates data - unexpected cURL error.
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers

Hi Joseph,

In 2.4+ we have moved to using SSL for retrieving updates to prevent 'Man in the Middle' attacks. The error message you get ('cURL error 60: SSL certificate problem, verify that the CA cert is OK.') is mentioned on http://docs.moodle.org/24/en/Automatic_updates_deployment, which links to http://docs.moodle.org/24/en/SSL_certificate_for_moodle.org which outlines the problem and how to resolve it. Hopefully that will help you resolve the problem. smile

Dan

 
Average of ratings: -
Picture of Joseph Rézeau
Re: Unable to fetch available updates data - unexpected cURL error.
Group DevelopersGroup Particularly helpful MoodlersGroup TestersGroup Translators

Thanks for your reply, Dan.

I have tried to follow the explanations to provide a certificate manually here. I have downloaded the DigiCertHighAssuranceEVRootCA.crt from https://www.digicert.com/digicert-root-certificates.htm.

But I do not understand what is meant by "A possible workaround is to download the DigiCert High Assurance EV Root CA certificate from digicert.com and put it into your moodledata/moodleorgca.crt file."

- there is no moodleorgca.crt  file in my moodledata folder;

-how do I "put a file into a file" ?

- I have tried to rename DigiCertHighAssuranceEVRootCA.crt to moodleorgca.crt but I still get the error mentioned in my original post.

Joseph

EDIT.- Just found the solution here: MDL-36903

Leo Furze-Waddock (comment) - 13/Dec/12 6:26 AM

It needs the ca-bundle.crt available at http://curl.haxx.se/ca/cacert.pem - Just copy the contents into a text file and rename it to moodleorgca.crt and place this in the root of the moodledata directory.

I will update the documentation accordingly.wink

Joseph



 
Average of ratings:Useful (4)
Picture of German Valero
Re: Unable to fetch available updates data - unexpected cURL error.
Group Documentation writersGroup Particularly helpful MoodlersGroup Translators

Thanks for the solution Joseph smile.

I had this problem in my local WAMP server for a few weeks and it had been really frustrating to try to fix it according to Moodle docs. sad.

Your help is greatly needed for updating the documentation in http://docs.moodle.org/24/en/Available_update_notifications and http://docs.moodle.org/24/en/SSL_certificate_for_moodle.org

After you update the documentation, it would be very nice if you posted a discussion topic in AMOS, for all translators to append/write those translated documentation pages.

 
Average of ratings: -
Picture of Mitja Decman
Odg: Re: Unable to fetch available updates data - unexpected cURL error.
 

Hi,

we have Windows server, I copied the .crt to moodledata but it didn't work. I tried to go to server, internet explorer, tools options content certificates and I imported the same .crt file and it helped.

 
Average of ratings: -
My picture
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

Thank God that you can now write again in Moodle forums!

I have Moodle 2.5 installed in CentOS. I have followed Joseph's insrtructions and installed the moodeorgca.crt in /var/www/moodledata folder and restart apache, but still got the same error.

Joseph recommends to install a cert directly in the server root. Can you please explain how to do that?

Thank you very much.

 
Average of ratings: -
My picture
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

With the debugger on and displaying all information for developers, I am getting the following error message:

 

Debug info: cURL error 7: Failed to connect to 2400:cb00:2048:1::8d65:70b3: Network is unreachable
Error code: err_response_curl
Stack trace:
  • line 1175 of /lib/pluginlib.php: available_update_checker_exception thrown
  • line 1061 of /lib/pluginlib.php: call to available_update_checker->get_response()
  • line 535 of /admin/index.php: call to available_update_checker->fetch()

Do you think that it may be a restriction from our proxy?

The cert file is installed in moodledata and the apache server has been restarted.

Please any help would be very appreciated as Turnitin Moodle Direct also needs this certificate

 
Average of ratings: -
Picture of Ken Task
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

While it could be related to something proxy, investigate DNS first.   Your error indicates a DNS issue and IPv6.  From terminal use Goolges DNS servers to query for the IPv6 of download.moodle.org:

dig @8.8.8.8 download.moodle.org AAAA

From server location (Austin, Tx) I get:

download.moodle.org.    300    IN    AAAA    2400:cb00:2048:1::8d65:71b3
download.moodle.org.    300    IN    AAAA    2400:cb00:2048:1::8d65:70b3

While it's NOT recommended to make this permanent, one could add Google's DNS servers to resolv.conf - list them first before your normal DNS servers. 

https://developers.google.com/speed/public-dns/docs/using

The TIA - try it again!

Any entries made in resolv.conf could be commented out by placing a # character at the beginning of the line.  (if successful and you find you need to do this again, just un-comment the lines).

And remember that CloudFlare is in front of download.moodle.org ... could be a temporary 'hick up' there! :|

http://dnsviz.net/d/download.moodle.org/analyze/

'spirit of sharing', Ken

 
Average of ratings: -
My picture
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

Thanks, Ken. When I type 'dig @8.8.8.8 download.moodle.org AAAA'

I got the following error:

<<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> @8.8.8.8 download.moodle.org                       AAAA
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

I think it is a problem of the proxy, is it not?

 

 
Average of ratings: -
Picture of Ken Task
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

Maybe proxy ... could also be a hickup with CloudFlare which sits in front of download.moodle.org and it could be a hickup related to from where your server is physically located on the net also (the way CloudFlare works/or doesn't).

What do you get with:

curl -I http://download.moodle.org

 

 
Average of ratings: -
My picture
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

Thanks, Ken. But the problem is not only for downloading automatic updates, but the connection between Turnitin (Moodle Direct) and Moodle, as Turnitin and Moodle cannot synchronise.

I am having exactly the same error message.

Our students will submit their assignments to Turnitin via Turnitin Assignment, so it is a serious problem for us.

 
Average of ratings: -
Picture of Ken Task
Re: Odg: Re: Unable to fetch available updates data - unexpected cURL error.
Group Particularly helpful Moodlers

Ah, soooo!  The plot thickens!  Well let's step back a minute ... site was behind a proxy before, Turnitin and Moodle upgrades worked before.   Is that correct?

If so, what has changed?  Proxy server config?   Don't think the Turnitin nor the Moodle upgrades have changed recently.   Have made it a 'standard practice' now to get the cert into moodledata folder.

See: http://docs.moodle.org/24/en/SSL_certificate_for_moodle.org

Not unusual (in my neck of the woods) to get the 'oops' error screen generated by Moodle or Cloudflare :\

That, however, would/might fix the moodle updates only ... not Turnitin (I would think).

So have you checked proxy config/rules/settings and proxy server logs?

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Alan Coats
Re: Unable to fetch available updates data - unexpected cURL error.
 

Help ... I am also getting this error when checking for updates. 

Debug info: cURL error 60: SSL certificate problem: unable to get local issuer certificate 
Error code: err_response_curl

Stack trace:
  • line 1175 of \lib\pluginlib.php: available_update_checker_exception thrown
  • line 1061 of \lib\pluginlib.php: call to available_update_checker->get_response()
  • line 539 of \admin\index.php: call to available_update_checker->fetch()
I have fetched the cacert.pem file, renamed it moodleorgca.crt and placed it in the root of my moodledata folder. Rebooted the system but still get the error. Tried importing it into Windows 7 which appeared to go okay but the problem persisted, Any suggestions?
 
Using: Moodle v2.53 and Moodle v2.6 running on Windows 7 with Apache server.
 
Average of ratings: -