Error writing to the Moodle database

Hello,

I am a administrator technical of the site ambroug.bzh on Moodle. It is dedicated to learning the Breton language for adults.
The site has been running for several years without any problems, although many updates have been performed since its launch in 2020, if I’m not mistaken.
However, since the last update (from version 4.5.11 to version 4.5.12), the site no longer works.
The update went smoothly but one or two days later, the site stopped working with this message “Database write error”.
I reinstated a backup from before the update via the OVH manager, but nothing helped...
I am out of solutions right now because I am afraid of making mistakes by operating directly in the database.

Could anyone possibly guide me out of this predicament, please?

Best regards

Hi @Offpix

If restoring from the manager didn’t work, the most likely cause is the database credentials or Moodle configuration after the update. I suggest following these steps:

  1. Check the connection details: Make sure the Moodle configuration file (config.php) contains the same credentials (database name, user, password, and server) as those shown in the OVH client area, under the databases section of your hosting. An error in these details is the most common cause of the “Error al escribir en la base de datos” message.

  2. Try development mode: Enable development mode on your hosting from the OVH manager. This will make PHP errors visible on screen and give you a more concrete clue about where the database connection is failing.

  3. Review the hosting logs: Check your hosting logs in the client area. Detailed errors that can point to the root cause are usually recorded there.

The Moodle update may have changed a server requirement, such as the PHP version. I suggest reviewing the official Moodle documentation to ensure your PHP version is compatible with the new version you installed.

Let us know, cheers.
Sergio Turpín

If the error persists you could also restore the database separately. Sometimes a full host restoration isn’t enough. Try importing a backup of your database manually (you can download it from the manager and upload it again).

Let us know :slightly_smiling_face:
Sergio Turpín

Thank you very much for the time you took to answer me.
The site is active again now :slight_smile:

And ... what restoration operations have you performed?

Well, it was enough to change the server name xxx.eu.clouddb.ovh.net:35385 to xxx.mysql.db in Moodle’s config.php file.
OVH must have made changes on their server without notifying me…

I admit I find it hard to accept what you're saying.

Hello @Offpix

It's a rule that has been in effect for at least 10 years

I don’t agree with you

Historically they weren’t clouddb but rather local suffixes like .60gp, .1000gp, etc

I think @Offpix must have used a clouddb at some point, for example included in a Pro/Perf offering.

Yes, thank you for all your messages :slight_smile:
Indeed, the database to connect is indeed on Web Cloud Databases (hence the naming of the type xxx.eu.clouddb.ovh.net).
Since I hadn't had to touch this site for a while, I kept trying to connect an outdated database over 2 years old...
I just realized my mistake this morning.
Errare humanum est!