Moodle broken after Cloudron update – OAuth2 plugin causing SQL errors
-
Hi all,
Since the automatic Moodle update via Cloudron last night, my Moodle instance won’t start. The healthcheck fails (ECONNREFUSED), and PostgreSQL logs show repeated errors like:
2025-10-06 12:48:40.132 UTC ERROR: syntax error at or near "," at character 170 STATEMENT: INSERT INTO mdl_oauth2_endpoint (issuerid, name, url, usermodified, timecreated, timemodified) VALUES (1, 'authorization_endpoint', 'https://my.ciamtc.com/openid/auth', , 1759754919, 1759754919)
It seems Moodle is trying to insert an OAuth2 endpoint with an empty usermodified field, which produces a syntax error in PostgreSQL.
I’ve already tried:
Restoring the Cloudron DB backup
Running SQL fixes manually
cloudron repair
… but nothing works. The problem seems to be with the OAuth2 plugin code deployed with the update, not the DB itself.
Has anyone else experienced this issue after the Cloudron update? Any ideas on how to start Moodle without breaking the DB?
Thanks in advance!
-
Hi again,
I’ve tried installing Moodle on another Cloudron instance, but it doesn’t work either. Even with a fresh setup, the installation fails the same way as on my other instance.
It seems the issue is not limited to a single server, so it might be related to the recent update or the packaging itself.
Thanks!
-
You said you tried to restore the DB backup. Why not restore the whole backup taken before the update? You can then clone the instance and test and once the problem is resolved update the production instance. Just make sure you deactivate automatic updates.
For what it's worth, we don't use the Oauth plugin though it is installed and there were no issues with the update to 5.0.3.
-
Thank you for your answer. I tried to clone the version before the update but I have this error in logs :
=> Healtheck error: Error: connect EHOSTUNREACH 172.18.19.202:8000 Oct 06 23:10:53 => Healtheck error: Error: connect EHOSTUNREACH 172.18.19.202:8000 Oct 06 23:11:03 => Healtheck error: Error: connect EHOSTUNREACH 172.18.19.202:8000 Oct 06 23:11:13 => Healtheck error: Error: connect EHOSTUNREACH 172.18.19.202:8000 Oct 06 23:11:14 DELETE 0 Oct 06 23:11:14 ERROR: syntax error at or near "," Oct 06 23:11:14 LINE 1: ...n_endpoint', 'https://my.example.com/openid/auth', , 17597850... Oct 06 23:11:14 UPDATE 1
-
Hello,
I finally managed to solve the issue as suggested above. I installed a second instance, which ended up working, then created a backup of version 3.1.3 (the one that wasn’t working) and imported that backup into the new instance.
Thanks for your help!