Good morning everyone,
I recently upgraded from 3.8.1 to 3.10 in a test environment installed on debian 9 with php 7.4, something really strange is happening:
every scheduled task that cron.php tries to run, fails, but if I use the "run now" function, the task completes itself without any problem, the error is a database writing error one, i can assure you crontab is set with the same php path as the one in "system paths" inside moodle, the full error with debug on is the following:
Execute scheduled task: Pulizia eventi del monitoraggio eventi (tool_monitor\task\clean_events)
... started 10:57:04. Current memory use 12,9MB.
... used 0 dbqueries
... used 0,004119873046875 seconds
Scheduled task complete: Pulizia eventi del monitoraggio eventi (tool_monitor\task\clean_events)
... used 1 dbqueries
... used 0,0048439502716064 seconds
Scheduled task failed: (tool_monitor\task\clean_events), Error writing to database (Column count doesn't match value count at row 1
INSERT INTO mdl_task_log (type,component,classname,userid,timestart,timeend,dbreads,dbwrites,result,output,hostname,pid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => 0,
1 => 'tool_monitor',
2 => 'tool_monitor\\task\\clean_events',
3 => 0,
4 => 1606989424.157285,
5 => 1606989424.164242,
6 => 0,
7 => 0,
8 => 0,
9 => 'Execute scheduled task: Pulizia eventi del monitoraggio eventi (tool_monitor\\task\\clean_events)
... started 10:57:04. Current memory use 12,9MB.
... used 0 dbqueries
... used 0,004119873046875 seconds
Scheduled task complete: Pulizia eventi del monitoraggio eventi (tool_monitor\\task\\clean_events)
',
10 => 'host',
11 => 25516,
)])
Debug info:
Column count doesn't match value count at row 1
INSERT INTO mdl_task_log (type,component,classname,userid,timestart,timeend,dbreads,dbwrites,result,output,hostname,pid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => 0,
1 => 'tool_monitor',
2 => 'tool_monitor\\task\\clean_events',
3 => 0,
4 => 1606989424.157285,
5 => 1606989424.164242,
6 => 0,
7 => 0,
8 => 0,
9 => 'Execute scheduled task: Pulizia eventi del monitoraggio eventi (tool_monitor\\task\\clean_events)
... started 10:57:04. Current memory use 12,9MB.
... used 0 dbqueries
... used 0,004119873046875 seconds
Scheduled task complete: Pulizia eventi del monitoraggio eventi (tool_monitor\\task\\clean_events)
',
10 => 'host',
11 => 25516,
)]
Backtrace:
* line 1357 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1403 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
* line 86 of /lib/classes/task/database_logger.php: call to mysqli_native_moodle_database->insert_record()
* line 306 of /lib/classes/task/logmanager.php: call to core\task\database_logger::store_log_for_task()
* line 917 of /lib/classes/task/manager.php: call to core\task\logmanager::finalise_log()
* line 262 of /lib/cronlib.php: call to core\task\manager::scheduled_task_complete()
* line 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task()
Does anyone know what might be going on here and can advice on how to fix it?
Best regards