update_langpacks_task fails every few weeks

update_langpacks_task fails every few weeks

by Scott Krajewski -
Number of replies: 3

Every few weeks update_langpacks_task fails to work resulting in an en_us_old language pack which removes our language pack customizations. Manually updating the language pack fixes the problem. Has anyone else run into this? Any ideas? Debugging of cron is below.

ZIP extension is installed - zip works fine on the site. It makes me wonder if a partial download happened resulting in an invalid file. At this point I'm considering disabling this task or having it run weekly instead of daily.

Moodle 3.4+ (Build: 20171228)


Server Time: Tue, 01 May 2018 04:30:01 -0500


Execute scheduled task: Log table cleanup (logstore_standard\task\cleanup_task)
... started 04:30:01. Current memory use 17MB.
... used 1 dbqueries
... used 0.010329008102417 seconds
Scheduled task complete: Log table cleanup (logstore_standard\task\cleanup_task)
Execute scheduled task: Update all installed language packs (tool_langimport\task\update_langpacks_task)
... started 04:30:02. Current memory use 17.4MB.
!!! Exception - Class 'ZipArchive' not found !!!
!!
Error code: generalexceptionmessage !!
!! Stack trace: * line 90 of /lib/filestorage/zip_archive.php: Error thrown
* line 281 of /lib/filestorage/zip_packer.php: call to zip_archive->open()
* line 343 of /lib/componentlib.class.php: call to zip_packer->extract_to_pathname()
* line 804 of /lib/componentlib.class.php: call to component_installer->install()
* line 665 of /lib/componentlib.class.php: call to lang_installer->install_language_pack()
* line 74 of /admin/tool/langimport/classes/controller.php: call to lang_installer->run()
* line 179 of /admin/tool/langimport/classes/controller.php: call to tool_langimport\controller->install_lan
guagepacks()
* line 57 of /admin/tool/langimport/classes/task/update_langpacks_task.php: call to tool_langimport\controller-
>update_all_installed_languages()
* line 104 of /lib/cronlib.php: call to tool_langimport\task\update_langpacks_task->execute()
* line 67 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
* line 61 of /admin/cli/cron.php: call to cron_run()
 !!

Average of ratings: -
In reply to Scott Krajewski

Re: update_langpacks_task fails every few weeks

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

Hi Scott,
your PHP env is missing the zip extension.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: update_langpacks_task fails every few weeks

by Scott Krajewski -

I had suspected that too.  But PHP info reports


Zip enabled
Zip version 1.13.5
Libzip version 1.3.2

Unless the CLI version of PHP is different.

In reply to Scott Krajewski

Re: update_langpacks_task fails every few weeks

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

Hi Scott,
if yours is a shared env, it could be true: give php -m a try via your cron, using the same php executable or the Moodle one.

HTH,
Matteo