Error: Database connection failed days after resizing disk

Keywords: Moodle - Google Cloud Platform - Technical issue - Other
bnsupport ID: 60caa476-3e4d-07fc-1609-983bf1bae508
Description:
Our server ran out of disk space on Saturday. I increased the disk space according to the documentation, and everything worked fine until today. It now shows the following error when we try to access the site:

Error: Database connection failed

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php

Please help

Hi @pieter,

Can you give us more information about your issue? Did you modify anything else on your server apart from the disk size?

I see MariaDB is not running on your server. Can you try to start it?

sudo /opt/bitnami/ctlscript.sh start

Can you check the MariaDB log to get any errors?

sudo tail -n 25 /opt/bitnami/mariadb/logs/mysqld.log

Thanks for the reply gongomgra!

I tried installing Plesk, to try find an easier way than the terminal to work to create back-ups. It did not work, so I aborted the attempt. That was on Saturday and it did not have a problem. Other than automatic Backups of my Moodle courses on Sunday, we did not do anything between Saturday and this morning when it stopped working.

I ran the Scripts to suggested. The service was started but if did not fix the problem (yet).

Here is an output of the error.log:
> 2021-03-16 6:35:29 0 [Note] InnoDB: Compressed tables use zlib 1.2.11

2021-03-16  6:35:29 0 [Note] InnoDB: Number of pools: 1
2021-03-16  6:35:29 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-03-16  6:35:29 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2021-03-16  6:35:29 0 [Note] InnoDB: Completed initialization of buffer pool
2021-03-16  6:35:29 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be 
changed. See the man page of setpriority().
2021-03-16  6:35:30 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=11927355927
2021-03-16  6:35:30 0 [Note] InnoDB: Starting final batch to recover 1 pages from redo log.
2021-03-16  6:35:30 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-03-16  6:35:30 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-03-16  6:35:30 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-03-16  6:35:30 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please 
wait ...
2021-03-16  6:35:30 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-03-16  6:35:30 0 [Note] InnoDB: Waiting for purge to start
2021-03-16  6:35:30 0 [Note] InnoDB: 10.3.26 started; log sequence number 11927356049; transaction id 28368344
2021-03-16  6:35:30 0 [Note] InnoDB: Loading buffer pool(s) from /bitnami/mariadb/data/ib_buffer_pool
2021-03-16  6:35:30 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-03-16  6:35:30 0 [Note] Recovering after a crash using tc.log
2021-03-16  6:35:30 0 [Note] Starting crash recovery...
2021-03-16  6:35:30 0 [Note] Crash recovery finished.
2021-03-16  6:35:30 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-03-16  6:35:30 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use
2021-03-16  6:35:30 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2021-03-16  6:35:30 0 [ERROR] Aborting

Apologies for my mistake: the output if for the mysql.log

I’m using Moodle 3.10.

Is this correct? in the config.php file?

$CFG->dbhost = ‘127.0.0.1’;

My previous installation before upgrading was ‘localhost’.

Can someone please help me find our what the problem is… we have students unable to continue with their studies while our site is down.

I’ve also tried logging into phpMyAdmin but the username: root with the application credential password given during the installation did not work.

Hi @pieter,

Thank you for sharing the MariaDB log. According to it, there is other database service using that port

I also found it in your bnsupport bundle. It looks like this service is the one from the system, not Bitnami’s.

mysql      519  0.0  3.1 1254880 89396 ?       Ssl  06:35   0:02 /usr/sbin/mysqld

Can you run the next commands to try to disable that service and start the Bitnami one?

sudo systemctl disable mysql
sudo systemctl stop mysql
sudo /opt/bitnami/ctlscript.sh start