-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
4.2 regressions
-
None
To fetch the RSS feeds the library simplepie is utilised. This has been updated to 1.8.0 in the Moodle 4.2 release (see https://tracker.moodle.org/browse/MDL-76909). Unfortunately this is causing some issues. Once a URL that no longer exists, or returns no body, is passed to the library, it raises an error.
The library is in the process of releasing version 1.9.0, see https://github.com/simplepie/simplepie/pull/850. When the simplepie library was updated to the latest changes on the `master` branch, a new error occurred.
This issue is causing working urls to not synchronise too. To identify the failing external blogs there is a flag in the database schema in the table `mdl_blog_external`. The column `failedlastsync` is the flag that identifies is the last synchronisation has failed. The following query is used to identify these records.
SELECT *, to_timestamp(timefetched)::date as timefetcheddate |
FROM mdl_blog_external |
WHERE failedlastsync = 1 |
ORDER BY timefetched DESC; |
Steps to reproduce
- As a user, log in and open /blog/external_blogs.php
- Register an external blog with:
- A valid feed: https://developer.chrome.com/static/blog/feed.xml
- Name: invalid_feed_test
- Save changes.
- Update the database record by running the following SQL:
UPDATE mdl_blog_external SET url = 'https://fake-domain-1.com/feed.xml', timefetched = 0 WHERE name = 'invalid_feed_test';
- Open /admin/tool/task/schedule_task.php?task=core%5Ctask%5Cblog_cron_task
- Click 'Run now'
Expected (output on Moodle 4.1):
Execute scheduled task: Sync external blogs (core\task\blog_cron_task)
|
... started 13:43:11. Current memory use 18.1 MB. |
... used 3 dbqueries |
... used 0.43810200691223 seconds |
Scheduled task complete: Sync external blogs (core\task\blog_cron_task)
|
Actual (output on Moodle >= 4.2):
|
Execute scheduled task: Sync external blogs (core\task\blog_cron_task)
|
... started 13:45:47. Current memory use 18.5 MB. |
... used 1 dbqueries |
... used 0.27439188957214 seconds |
Scheduled task failed: Sync external blogs (core\task\blog_cron_task),strspn(): Argument #1 ($string) must be of type string, null given |
Backtrace:
|
* line 153 of /lib/simplepie/src/Content/Type/Sniffer.php: call to strspn() |
* line 124 of /lib/simplepie/src/Content/Type/Sniffer.php: call to SimplePie\Content\Type\Sniffer->unknown() |
* line 148 of /lib/simplepie/src/Locator.php: call to SimplePie\Content\Type\Sniffer->get_type() |
* line 173 of /blog/lib.php: call to SimplePie\Locator->is_feed() |
* line 55 of /lib/classes/task/blog_cron_task.php: call to blog_sync_external_entries() |
* line 405 of /lib/classes/cron.php: call to core\task\blog_cron_task->execute() |
* line 166 of /admin/cli/scheduled_task.php: call to core\cron::run_inner_scheduled_task() |
- duplicates
-
MDL-81008 Error when add new blog external
- Closed