Mariadb not starting - timeout / internal Server error 500

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2):14.
Operating system and version (eg, Ubuntu 17.04): Ubuntu 16.04.05
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 7.1): 7.0

The issue you are facing: Internal server error 500

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. just open the Nexcloud page

The output of your Nextcloud log in Admin > Logging:

does nor exist

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


The output of your Apache/nginx/system log in /var/log/____:

● mariadb.service - MariaDB 10.1.36 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
   Active: failed (Result: timeout) since Wed 2018-10-24 19:37:46 CEST; 5min ago
     Docs: man:mysqld(8)
  Process: 2136 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1990 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 1986 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1982 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 2136 (code=exited, status=0/SUCCESS)

Oct 24 19:36:13 schulserver systemd[1]: Starting MariaDB 10.1.36 database server...
Oct 24 19:36:14 schulserver mysqld[2136]: 2018-10-24 19:36:14 140238430660864 [Note] /usr/sbin/mysqld (mysqld 10.1.36-MariaDB-1~xenial) starting as process 2136 ...
Oct 24 19:37:44 schulserver systemd[1]: mariadb.service: Start operation timed out. Terminating.
Oct 24 19:37:46 schulserver systemd[1]: Failed to start MariaDB 10.1.36 database server.
Oct 24 19:37:46 schulserver systemd[1]: mariadb.service: Unit entered failed state.
Oct 24 19:37:46 schulserver systemd[1]: mariadb.service: Failed with result 'timeout'.

Something seems wrong with your MariaDB setup. Please check it’s error log, usually in /var/log/mysql/error.log.

Just for information. I’m not very familar with Linux/Ubuntu. I had this system set up a while ago and all was working fine. From that working installation I did a backup image, which I had to recover today. After this recovery I get this 500 server error when accessing the nextcloud page. All I can see is that the mysql server refuses to start with a timeout error. I hope someone can help?

Seems I’m not allowed to pase the error log her :face_with_raised_eyebrow:

Well I got it working by deleteing all SQL related files (purge Maria and Mysql) also all folders which have been left after deinstallation. Than reinstall mysql - and all works fine now.