check_libcurl_version - Error reading environment data (16)

check_libcurl_version - Error reading environment data (16)

by Jose Polanco -
Number of replies: 14
Hello everyone! 


I was getting ready to upgrade my test moodle environment from 3.0 to 3.2; however, right before I did this, I clicked on a link in the environment page called "Update Component" (out of curiosity). It directed me to a page stating that "Component is up to date" and redirected me back to the environment page. As this happened, I noticed a new error on the check list. It reads as follows:


InformationReportPluginStatus
check_libcurl_versionError reading environment data (16)Error

Any help with resolving this error would be greatly appreciated. I do not feel safe upgrading with this error, so I will hold off on upgrading until after this error is resolved. My server specifications are as follows if any further information is needed please let me know:

  • Ubuntu 14.04 LTS
  • Moodle 3.0
  • Mysql 5.5.54
  • PHP 5.5.9
  • curl 7.35.0
Average of ratings: -
In reply to Jose Polanco

Re: check_libcurl_version - Error reading environment data (16)

by Ken Task -
Picture of Particularly helpful Moodlers

"Moodle recommends using libcurl with at least TLS 1.2 support."

Please see:

https://docs.moodle.org/31/en/admin/environment/php_extension/curl

'spirit of sharing', Ken


In reply to Ken Task

Re: check_libcurl_version - Error reading environment data (16)

by Abdi A -

Ken,

How do you run the code without using command line so I can get rid of  "check_libcurl_version - Error reading environment data" ?

Thanks in advance

Regards,

Abdi



In reply to Abdi A

Re: check_libcurl_version - Error reading environment data (16)

by Ken Task -
Picture of Particularly helpful Moodlers

You've shared that you have Ubuntu so one could use the command line ... unless you've not shared something about the system that prevents you from accessing the terminal/CLI.

https://askubuntu.com/questions/643037/how-to-enable-tls-1-2-in-apache

https://askubuntu.com/questions/440139/which-tls-protocols-are-enabled-in-ubuntu-14-04s-openssl

Moodle, for the most part, does attempt to stay secure ... and up to date with things that support moodle code/server.

While 14.04 is long term support wonder if not upgrading to 16.04 wouldn't be best as that version is Linux Standards Based now.

But, shall defer to anyone else who runs Ubuntu for corrections or better explanations or better advice. ;)

'spirit of sharing', Ken


In reply to Ken Task

Re: check_libcurl_version - Error reading environment data (16)

by Jinxing Chen -
Hi Ken,

I got same issue on the environment check.
When I run the command
php -i | grep SSL
It shows:
SSL => Yes
SSL Version => OpenSSL/1.0.1f
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.1f 6 Jan 2014
OpenSSL Header Version => OpenSSL 1.0.1f 6 Jan 2014
OpenSSL support => enabled

The last sentence on the article said:
The SSL Version may be different than 1.0.1t, that's fine. Just as long as it's not older than 1.0.1.

My server SSL version is 1.0.1f, it not older than 1.0.1, should be good enough, but why the environment check not passed.

By the way, the environment component is 3.1 (Build: 20160523).

Please help.
In reply to Jinxing Chen

Re: check_libcurl_version - Error reading environment data (16)

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Careful....

Always checks that your command line PHP is from the same build as your 'web' PHP. They don't have to be and often are not. Check the two PHP versions before going much further (they may not have the same SSL library built into them). 

You are better using 'phpinfo()' from the web interface.  (https://docs.moodle.org/33/en/PHP#Displaying_phpinfo_outside_of_Moodle)

In reply to Howard Miller

Re: check_libcurl_version - Error reading environment data (16)

by Jinxing Chen -

Thanks for your reply. Here are same screen shot images for phpinfo which run on the web interface by http://moodle.server/admin/phpinfo.php







In reply to Jinxing Chen

Re: check_libcurl_version - Error reading environment data (16)

by Jinxing Chen -

I also create a php file under root just. As you suggestion display the phpinfo outside of Moodle.

The result shows similar, only difference is shows module's author:

cURL Sterling Hughes

OpenSSL Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar

In reply to Jinxing Chen

Re: check_libcurl_version - Error reading environment data (16)

by Ken Task -
Picture of Particularly helpful Moodlers

Did you update the component than check environment?

According to:

https://docs.moodle.org/31/en/admin/environment/php_extension/curl

looks like you might need to compile it IF it's not available via package manger.

If I re-call ... the issue was really the TLS supports for 1.2 ... but it's been a few months.

'spirit of sharing', Ken


In reply to Ken Task

Re: check_libcurl_version - Error reading environment data (16)

by Jinxing Chen -

Yes, I did. On the environment page, click on the update component link, the "Component is up-to-date" message has been show up.

Here is my another thought.

Check out the Moodle code at Github:

https://github.com/moodle/moodle/blob/MOODLE_31_STABLE/admin/environment.xml#L1721

Branch of Moodle 3.1 Stable, admin/environment.xml line 1721 to check check_libcurl_version from /lib/upgradelib.php

Because I want upgrade Moodle version from 3.1+ to 3.1.6. That should be right place where environment(pre-check) before run the upgrade.

Back to the source code on /lib/upgradelib.php, there are no such function called check_libcurl_version.


Will this explain the error: Error reading environment data (16)?

If my thought is correct, this error will be fine for the upgrade?

In reply to Jinxing Chen

Re: check_libcurl_version - Error reading environment data (16)

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Everyone,
the "strange" error is not related to the cURL settings but to the XML file in Moodle.
Please, double check your admin/environment.xml file since it looks like you've a wrong one.

That file could be updated online by Moodle to get the latest one: did you prevent your system to connect to the Internet?
BTW, the fix is quite easy: change the @level from required to optional.

Code details: https://github.com/moodle/moodle/blob/06e3b6d8bab42b8e56d169d006f31f4a15684830/lib/environmentlib.php#L1166.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: check_libcurl_version - Error reading environment data (16)

by Jinxing Chen -
Hi, Mattoo
Thanks for your reply you're right.

The environment component not been updated, because the Moodle build is out of date. See the screen shot image.


But I still got response "Component is up-to-date"? Why?
The system is connect the Internet, the connection is fine.
In reply to Jinxing Chen

Re: check_libcurl_version - Error reading environment data (16)

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Eh eh wink: in stables the YYYYMMDD version doesn't reflect the "build" time as you expect, more at https://docs.moodle.org/dev/Moodle_versions (and https://docs.moodle.org/dev/Releases#Moodle_3.1).

Please, double check the syntax above in your local env XML files:

  1. /admin/environment.xml, under wwwroot
  2. /environment/environment.xml, under dataroot, which is the newer file downloaded from the net (https://download.moodle.org/environment/environment.zip), always up-to-date, which has priority compared to the one in wwwroot, built at the time of the release

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: check_libcurl_version - Error reading environment data (16)

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

To be clearer, please check the curl section of 3.1 in your local files:

      <PHP_EXTENSION name="curl" level="required">
        <FEEDBACK>
          <ON_ERROR message="curlrequired" />
        </FEEDBACK>
      </PHP_EXTENSION>

You could try to delete the copy of the file under the dataroot, if that is wrong i.e. an old copy.

HTH,
Matteo