You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a case where the crawler just seemed to get stuck. Turns out it was because of a dml_write_exception being thrown from within crawl() in classes/robot/crawler.php. In my case it was because there was a page having a link that was longer than 1033 characters (the size of the url field). (This alone needs to be submitted as a separate issue.) What was confounding to me was that I had to dig to find the actual dml_write_exception because all I was seeing in my cron logs (PHP error logs were silent) was:
Adhoc task failed: tool_crawler\task\adhoc_crawl_task,Coding error detected, it must be fixed by a programmer: A lock was created but not released at: /path/to/moodle/admin/tool/crawler/classes/robot/crawler.php on line 526
Code should look like:
$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(Resource id #28399);
$lock->release(); // Locks must ALWAYS be released like this.
Wrapping the call to crawl() on line 541 in a try-catch-finally resolves this and you then actually see the error report in Moodle's cron output:
Execute adhoc task: tool_crawler\task\adhoc_crawl_task
... started 13:49:07. Current memory use 44.2MB.
... used 51 dbqueries
... used 0.75267791748047 seconds
Adhoc task failed: tool_crawler\task\adhoc_crawl_task,Error writing to database
The text was updated successfully, but these errors were encountered:
I had a case where the crawler just seemed to get stuck. Turns out it was because of a
dml_write_exception
being thrown from withincrawl()
inclasses/robot/crawler.php
. In my case it was because there was a page having a link that was longer than 1033 characters (the size of the url field). (This alone needs to be submitted as a separate issue.) What was confounding to me was that I had to dig to find the actualdml_write_exception
because all I was seeing in my cron logs (PHP error logs were silent) was:Wrapping the call to
crawl()
on line 541 in a try-catch-finally resolves this and you then actually see the error report in Moodle's cron output:The text was updated successfully, but these errors were encountered: