Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Joerg Knoerchen -
Number of replies: 9

Hello,

I do have a fresh install of moodle 3.9.1+ and the process of installing was smooth. The only error I got was something about opcache.enable and that the cron script is not running. I tried to install (several plugins from the Moodle plugins dir) but always run into the following error regardless which plugin I try to install...

Install plugins from the Moodle Plugins directory

Debugging output enabled
Error fetching plugin ZIP: md5 mismatch.
  • line 399 of /lib/classes/update/code_manager.php: call to debugging()
  • line 131 of /lib/classes/update/code_manager.php: call to core\update\code_manager->debug()
  • line 1146 of /lib/classes/plugin_manager.php: call to core\update\code_manager->get_remote_plugin_zip()
  • line 1327 of /lib/classes/plugin_manager.php: call to core_plugin_manager->get_remote_plugin_zip()
  • line 2506 of /lib/upgradelib.php: call to core_plugin_manager->install_plugins()
  • line 62 of /admin/tool/installaddon/index.php: call to upgrade_install_plugins()
Downloading mod_organizer ... <- https://moodle.org/plugins/download.php/22342/mod_organizer_moodle39_2020082500.zip -> ... Error
Downloading and manually uploading and installing works like a charm, so no issue with that. But I like to use the UI and convenient way to install plugins. And with that error above I assume that upgrades and updates will also fail the automatic way!?

Any hint or help this, please? 

Many thanks!

Average of ratings: -
In reply to Joerg Knoerchen

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Joerg Knoerchen -

Hello,


nobody can help here?


Many thanks, for checking...

In reply to Joerg Knoerchen

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

There are many questions in your post. I will touch the first two:

- "The only error I got was something about opcache.enable"

It is not an error, just a (strong) suggestion. The Opcache improves the performance of Apache. How to enable that depends on the operating system and how you access it.

- "the cron script is not running"

An absolute must. The site runs at the beginning but will get bogged down earlier of later. Pl. read https://docs.moodle.org/39/en/Cron.
In reply to Visvanath Ratnaweera

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Joerg Knoerchen -
Thank you Visvanath,

the CRON message is gone as I implemented a CRON Job. And the Opcache, seems not to be an issue.

However, the main purpose of my post was to tackle that I'm unaböe to run any installs from the plugin directory.
As said manual download from the directory and upload it to my moodle to get them installed works just fine.
The issue is when trying to run the internal install the download errors, as described above.

 Do you have any thoughts on this as well please?


In reply to Joerg Knoerchen

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
OK. I don't have experience in "automatic" installations - I don't like the idea. Expected https://docs.moodle.org/39/en/Installing_plugins#Installing_directly_from_the_Moodle_plugins_directory to document the method, but oddly it doesn't. The general answer is, the running web server process needs _write_ permissions to the target directories in the moodle/ code tree - typically mod/, block/, local/, theme/,..
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Joerg Knoerchen -
Thanks a lot again Visvanath,

well I have granted permission to write to various folders, I would have thought that permissions will be set ass needed when installing moodle. However, granting the permissions seems not to solve the issue. As the error occurs while trying to download, is there a temp folder where automatic downloads are made to?

I also dislike the auto-upgrade, however, I like the option to install and download automatically from the plugin directory, rather having to download and upload manually via my computer.

Cheers and many thanks again!
In reply to Joerg Knoerchen

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Joerg Knoerchen -
I have changed the permissions to a folder for testing and removed the permissions. And as expected I got the error message that the folder is not writeable. Means, the permissions in place should be correct, as the folders are writeable. But again regardless what kind of type of plugin I try to install I always get this kind of errors...


Error fetching plugin ZIP: md5 mismatch.
  • line 399 of /lib/classes/update/code_manager.php: call to debugging()
  • line 131 of /lib/classes/update/code_manager.php: call to core\update\code_manager->debug()
  • line 1146 of /lib/classes/plugin_manager.php: call to core\update\code_manager->get_remote_plugin_zip()
  • line 1327 of /lib/classes/plugin_manager.php: call to core_plugin_manager->get_remote_plugin_zip()
  • line 2506 of /lib/upgradelib.php: call to core_plugin_manager->install_plugins()
  • line 62 of /admin/tool/installaddon/index.php: call to upgrade_install_plugins()
Download qtype_gapfill ... <- https://moodle.org/plugins/download.php/22425/qtype_gapfill_moodle39_2020090700.zip -> ... error
In reply to Joerg Knoerchen

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Ken Task -
Picture of Particularly helpful Moodlers

Appears md5checksum isn't matching when using GUI.

Do you have any additional protections running ... like mod_security or similar?

Go to Site Admin -> Server -> PHP Info and look for hash enabled and supported hashing engines  listing a md5.

Also check ownerships/permissions on moodledata//temp/core_plugin/code_manager/

There should be 2 directories there:

archive
distfiles

distfiles are the downloaded zip files by what appears to be an md5hash name:

Just updated zoom on a 3.8.highest ....

[root@sos code_manager]# ls distfiles
06f9d44abfb7cac529388bca8ad76c47.zip

[root@sos distfiles]# md5sum *.zip
06f9d44abfb7cac529388bca8ad76c47  06f9d44abfb7cac529388bca8ad76c47.zip

md5sum matches.

'SoS', Ken


Average of ratings: Useful (2)
In reply to Ken Task

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Joerg Knoerchen -
Hello Ken,

thank you so much for the insights. As I'm on a shared host I can't change the settings for PHP but these are the hash settings:

Hash support: enabled
Hashing Engines:  md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b crc32c fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

the two mentioned directories are there and have the highest permissions (777).

So I don't know what is casing the md5sum to mismatch.


In reply to Joerg Knoerchen

Re: Fresh moodle 3.9.1+ installation unable to install/download from plugin directory

by Ken Task -
Picture of Particularly helpful Moodlers

Oops .... 'shared hosting' ... means you barely have control over anything.

Asked if there were some additional protections running for web service ... like mod_security? or other?

'... the highest permissions (777) .."

think you mean most liberal .. where owner/group/others ... and that others is global ... user can read/write/execute ... group can r/w/e and others can r/w/e

On a CentOS server ... not shared ... that looks like:

drwxrwsrwx. 13 apache apache 4096 Sep 14 18:58 moodle39data

In whatever tool you have to browse files, check the ownerships - in your case probably account login - and permissions ... who can read/write/execute.

In those directories involved in installation of the plugins, what are ownerships/permissions on them?  Those must have read/write/execute by all - very liberal.

You could also inquire with hosting provider support, but think they draw the line diving into applications ... like a Moodle.

That's all I can tell ya! smile

'SoS', Ken