Moodle consuming disk space rapidly

:warning: IMPORTANT, please fill the questions

We assume you are using Bitnami to deploy your application.

  • Which version of the application are you using?: Moodle 3.8.1 - Apache 2.4.41

  • Please choose how you got the application: Installer (Windows, Linux, macOS), cloud image (AWS, GCE, Azure, …) or VM (VMDK, VBOX): Linux Debian 9.13 stretch

  • Have you installed any plugin or modified any configuration file?: Yes

  • Describe here your question/suggestion/issue (expected and actual results): My moodle instance keeps consuming server disk space regardless of if I deleted backups or purge cache/logs. I decided to verify if my CRON tasks are running, so I checked moodle-cron.log and I saw a big list of errors that I had no idea they exist.

  • Steps to reproduce the issue (if relevant):
    Sorry for posting a huge content.Here is part of my /opt/bitnami/apps/moodle/moodledata/moodle-cron.log which has an error indicating a clean up task failure.

sh: 1: /usr/bin/gs: not found
Potential coding error - existing temptables found when disposing database. Must be dropped!
Potential coding error - existing temptables found when disposing database. Must be dropped!
Default exception handler: خطا در نوشتن بر روی پایگاه داده Debug: Lock wait timeout exceeded; try restarting transaction
UPDATE mdl_config_plugins SET value = ? WHERE id = ?
[array (
  0 => 1599034142,
  1 => '1934',
)]
Error code: dmlwriteexception
* line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1634 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1809 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
* line 1427 of /lib/moodlelib.php: call to moodle_database->set_field()
* line 66 of /lib/cronlib.php: call to set_config()
* line 61 of /admin/cli/cron.php: call to cron_run()

Default exception handler: خطا در نوشتن بر روی پایگاه داده Debug: Lock wait timeout exceeded; try restarting transaction
UPDATE mdl_config_plugins SET value = ? WHERE id = ?
[array (
  0 => 1599034201,
  1 => '1934',
)]
Error code: dmlwriteexception
* line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1634 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1809 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
* line 1427 of /lib/moodlelib.php: call to moodle_database->set_field()
* line 66 of /lib/cronlib.php: call to set_config()
* line 61 of /admin/cli/cron.php: call to cron_run()

Default exception handler: خطا در نوشتن بر روی پایگاه داده Debug: Lock wait timeout exceeded; try restarting transaction
UPDATE mdl_config_plugins SET value = ? WHERE id = ?
[array (
  0 => 1599034261,
  1 => '1934',
)]
Error code: dmlwriteexception
* line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1634 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1809 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
* line 1427 of /lib/moodlelib.php: call to moodle_database->set_field()
* line 66 of /lib/cronlib.php: call to set_config()
* line 61 of /admin/cli/cron.php: call to cron_run()

Default exception handler: خطا در نوشتن بر روی پایگاه داده Debug: Lock wait timeout exceeded; try restarting transaction
UPDATE mdl_config_plugins SET value = ? WHERE id = ?
[array (
  0 => 1599034321,
  1 => '1934',
)]
Error code: dmlwriteexception
* line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
* line 1634 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1809 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->set_field_select()
* line 1427 of /lib/moodlelib.php: call to moodle_database->set_field()
* line 66 of /lib/cronlib.php: call to set_config()
* line 61 of /admin/cli/cron.php: call to cron_run()

Default exception handler: خطا در نوشتن بر روی پایگاه داده Debug: Lock wait timeout exceeded; try restarting transaction
UPDATE mdl_config_plugins SET value = ? WHERE id = ?
[array (
  0 => 1599034381,
  1 => '1934',
)]
Error code: dmlwritDefault exception handler: خطا در خواندن از پایگاه داده Debug: MySQL server has gone away
SELECT * FROM mdl_task_scheduled WHERE classname = ?
[array (
  0 => '\\core\\task\\session_cleanup_task',
)]
Error code: dmlreadexception
* line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 1247 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1587 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
* line 1559 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
* line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 680 of /lib/classes/task/manager.php: call to moodle_database->get_record()
* line 229 of /lib/cronlib.php: call to core\task\manager::scheduled_task_failed()
* line 119 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
* line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
* line 61 of /admin/cli/cron.php: call to cron_run()

Exception ignored in shutdown function Closure::__invoke: جدول «task_log» وجود ندارد
PHP Fatal error:  Uncaught coding_exception: یک خطای برنامه‌نویسی شناسایی شد. این خطا باید توسط یک برنامه‌نویس برطرف شود: A lock was created but not released at:
/opt/bitnami/apps/moodle/htdocs/lib/classes/task/manager.php on line 557

 Code should look like:

 $factory = \core\lock\lock_config::get_lock_factory('type');
 $lock = $factory->get_lock(Resource id #742);
 $lock->release();  // Locks must ALWAYS be released like this.

 in /opt/bitnami/apps/moodle/htdocs/lib/classes/lock/lock.php:117
Stack trace:
#0 [internal function]: core\lock\lock->__destruct()
#1 {main}
  thrown in /opt/bitnami/apps/moodle/htdocs/lib/classes/lock/lock.php on line 117
Default exception handler: یک خطای برنامه‌نویسی شناسایی شد. این خطا باید توسط یک برنامه‌نویس برطرف شود: moodle_database::update_record_raw() id field must be specified. Debug: 
Error code: codingerror
* line 1536 of /lib/dml/mysqli_native_moodle_database.php: coding_exception thrown
* line 1593 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
* line 624 of /lib/classes/task/manager.php: call to mysqli_native_moodle_database->update_record()
* line 312 of /lib/cronlib.php: call to core\task\manager::adhoc_task_failed()
* line 166 of /lib/cronlib.php: call to cron_run_inner_adhoc_task()
* line 76 of /lib/cronlib.php: call to cron_run_adhoc_tasks()
* line 61 of /admin/cli/cron.php: call to cron_run()

Exception ignored in shutdown function Closure::__invoke: جدول «task_log» وجود ندارد
Exception ignored in shutdown function tool_log\log\manager::dispose: خطا در خواندن از پایگاه داده
Potential coding error - existing temptables found when disposing database. Must be dropped!
PHP Fatal error:  Uncaught ddl_change_structure_exception: خطا در اجرای DDL sql in /opt/bitnami/apps/moodle/htdocs/lib/dml/moodle_database.php:492
Stack trace:
#0 /opt/bitnami/apps/moodle/htdocs/lib/dml/mysqli_native_moodle_database.php(1072): moodle_database->query_end(false)
#1 /opt/bitnami/apps/moodle/htdocs/lib/ddl/database_manager.php(77): mysqli_native_moodle_database->change_database_structure('DROP TEMPORARY ...', Array)
#2 /opt/bitnami/apps/moodle/htdocs/lib/ddl/database_manager.php(332): database_manager->execute_sql_arr(Array, Array)
#3 /opt/bitnami/apps/moodle/htdocs/lib/dml/moodle_temptables.php(140): database_manager->drop_table(Object(xmldb_table))
#4 /opt/bitnami/apps/moodle/htdocs/lib/dml/moodle_database.php(405): moodle_temptables->dispose()
#5 /opt/bitnami/apps/moodle/htdocs/lib/dml/mysqli_native_moodle_database.php(610): moodle_database->dispose()
#6 /opt/bitnami/apps/moodle/htdocs/lib/dml/moodle_database.php(160): mysqli_native_moodle_database->dispose()
#7 [internal function]: moodle_database->_ in /opt/bitnami/apps/moodle/htdocs/lib/dml/moodle_database.php on line 492
sh: 1: /usr/bin/sendmail: not found
  • Copy the apache log (if relevant):
[Sat Jul 18 06:17:28.381901 2020] [mpm_event:notice] [pid 473:tid 140259291181120] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Jul 18 06:17:28.382046 2020] [core:notice] [pid 473:tid 140259291181120] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jul 18 06:20:47.554827 2020] [mpm_event:notice] [pid 473:tid 140259291181120] AH00491: caught SIGTERM, shutting down
[Sat Jul 18 06:24:30.196856 2020] [mpm_event:notice] [pid 540:tid 140528563765312] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Jul 18 06:24:30.205417 2020] [core:notice] [pid 540:tid 140528563765312] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jul 18 06:31:55.767466 2020] [mpm_event:notice] [pid 540:tid 140528563765312] AH00491: caught SIGTERM, shutting down
[Wed Sep 02 08:29:28.811200 2020] [mpm_event:notice] [pid 461:tid 140713552666688] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Wed Sep 02 08:29:28.821764 2020] [core:notice] [pid 461:tid 140713552666688] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 02 08:40:23.496339 2020] [mpm_event:notice] [pid 461:tid 140713552666688] AH00491: caught SIGTERM, shutting down
[Wed Sep 02 08:40:46.516214 2020] [mpm_event:notice] [pid 523:tid 140404246085696] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Wed Sep 02 08:40:46.518727 2020] [core:notice] [pid 523:tid 140404246085696] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 02 08:43:34.113547 2020] [mpm_event:notice] [pid 523:tid 140404246085696] AH00491: caught SIGTERM, shutting down
[Wed Sep 02 08:52:05.532061 2020] [mpm_event:notice] [pid 527:tid 139675233775680] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Wed Sep 02 08:52:05.543586 2020] [core:notice] [pid 527:tid 139675233775680] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 02 09:07:00.928373 2020] [mpm_event:notice] [pid 527:tid 139675233775680] AH00491: caught SIGTERM, shutting down
[Wed Sep 02 09:15:31.372233 2020] [mpm_event:notice] [pid 443:tid 140469136924736] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Wed Sep 02 09:15:31.405958 2020] [core:notice] [pid 443:tid 140469136924736] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 02 09:23:40.227520 2020] [mpm_event:notice] [pid 443:tid 140469136924736] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Wed Sep 02 09:23:40.255114 2020] [mpm_event:notice] [pid 443:tid 140469136924736] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Wed Sep 02 09:23:40.255170 2020] [core:notice] [pid 443:tid 140469136924736] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 02 09:23:47.129698 2020] [mpm_event:notice] [pid 443:tid 140469136924736] AH00493: SIGUSR1 received.  Doing graceful restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Wed Sep 02 09:23:47.140027 2020] [mpm_event:notice] [pid 443:tid 140469136924736] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Wed Sep 02 09:23:47.140041 2020] [core:notice] [pid 443:tid 140469136924736] AH00094: Command line: '/usr/sbin/apache2'
[Wed Sep 02 10:02:56.617840 2020] [mpm_event:notice] [pid 443:tid 140469136924736] AH00491: caught SIGTERM, shutting down
[Sat Sep 05 07:35:48.233501 2020] [mpm_event:notice] [pid 579:tid 139901324734528] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Sep 05 07:35:48.235046 2020] [core:notice] [pid 579:tid 139901324734528] AH00094: Command line: '/usr/sbin/apache2'
[Sat Sep 05 07:39:22.739941 2020] [mpm_event:notice] [pid 579:tid 139901324734528] AH00491: caught SIGTERM, shutting down
[Sat Sep 05 07:39:22.831642 2020] [mpm_event:notice] [pid 2436:tid 139812929859648] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Sep 05 07:39:22.831902 2020] [core:notice] [pid 2436:tid 139812929859648] AH00094: Command line: '/usr/sbin/apache2'
[Sat Sep 05 07:40:47.476736 2020] [core:warn] [pid 3077:tid 139816749252672] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Sat Sep 05 07:40:47.478084 2020] [mpm_event:notice] [pid 3077:tid 139816749252672] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Sep 05 07:40:47.478130 2020] [core:notice] [pid 3077:tid 139816749252672] AH00094: Command line: '/usr/sbin/apache2'
[Sat Sep 05 07:41:18.482549 2020] [mpm_event:notice] [pid 3077:tid 139816749252672] AH00491: caught SIGTERM, shutting down
[Sat Sep 05 07:41:30.490031 2020] [mpm_event:notice] [pid 3468:tid 139945102360640] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Sat Sep 05 07:41:30.490271 2020] [core:notice] [pid 3468:tid 139945102360640] AH00094: Command line: '/usr/sbin/apache2'
[Sat Sep 05 07:42:02.235172 2020] [mpm_event:notice] [pid 3468:tid 139945102360640] AH00491: caught SIGTERM, shutting down
[Fri Sep 18 19:03:47.502883 2020] [mpm_event:notice] [pid 530:tid 140017522856000] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Fri Sep 18 19:03:47.504244 2020] [core:notice] [pid 530:tid 140017522856000] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 18 19:34:40.543027 2020] [mpm_event:notice] [pid 530:tid 140017522856000] AH00491: caught SIGTERM, shutting down
[Fri Sep 18 19:35:10.588207 2020] [mpm_event:notice] [pid 527:tid 139993478275136] AH00489: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Fri Sep 18 19:35:10.589557 2020] [core:notice] [pid 527:tid 139993478275136] AH00094: Command line: '/usr/sbin/apache2'
[Fri Sep 18 19:41:58.482166 2020] [mpm_event:notice] [pid 527:tid 139993478275136] AH00491: caught SIGTERM, shutting down

Hi @mobcer,

Thanks for using Bitnami. I check the error I think it’s related with this https://tracker.moodle.org/browse/MDL-66217

We suggest you to post your question on the official support forums of the application so others can help you, probably someone with more experience and knowledge about that specific tool can help you better than we can

https://moodle.org/login/index.php

Do not hesitate to write us back if you have any other questions regarding the Bitnami solutions or their configuration.

Regards,
Ibone,

Thanks for your replay @Ibone. I’ll update my post which whatever I get

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.