Problems with Nextcloud

Changed mysql root password?

Can you enter mysql on command line without password:

mysql

1 Like

Hi,

i can enter msql via command line without pw.

Regards

Uwe

have you done something with the php version?

2 Likes

No, nothing.

It seems a database connection problem.
Check if you have some updates of 3rd parts plugin into Nextcloud. Then post systemctl status mysqld result.

Thanks.

1 Like

Only TOTP Authenticator app is running.

Here is the result of systemctl status mysql:

● mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor prese t: disabled)
Active: active (running) since Sat 2019-09-07 07:50:31 CEST; 3h 37min ago
Main PID: 2046 (mysqld_safe)
CGroup: /system.slice/mysqld.service
├─2046 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─2405 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql…

Sep 07 07:50:19 server.xxx.com systemd[1]: Starting MariaDB data…
Sep 07 07:50:20 server.xxx.com mariadb-prepare-db-dir[1554]: Dat…
Sep 07 07:50:20 server.xxx.com mariadb-prepare-db-dir[1554]: If …
Sep 07 07:50:21 server.xxx.com mysqld_safe[2046]: 190907 07:50:2…
Sep 07 07:50:22 server.xxx.com mysqld_safe[2046]: 190907 07:50:2…
Sep 07 07:50:31 server.xxx.com systemd[1]: Started MariaDB datab…
Unit result.service could not be found.
Hint: Some lines were ellipsized, use -l to show in full.

Besides the error message, is Nextcloud still working?

1 Like

Hi Marc,

Nextcloud works without noticeable problems

Your problem looks similar to this one:

When logged in as admin, on Nextcloud aministration overview, do you get a warning about “Background jobs: Last job execution ran X hours/weeks/months ago. Something seems wrong” ?

1 Like

In administration overview i can see these warnings:

MySQL is used as database but does not support 4-byte characters. To be able to handle 4-byte characters (like emojis) without issues in filenames or comments for example it is recommended to enable the 4-byte support in MySQL. For further details read the documentation page about this.

Your web server is not properly set up to resolve “/.well-known/caldav”. Further information can be found in the documentation.

Your web server is not properly set up to resolve “/.well-known/carddav”. Further information can be found in the documentation.

Just in case… can you test if you get the php fatal error message (mail, console or logs) when executing:

sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M -f /usr/share/nextcloud/cron.php
1 Like

[root@server ~]# sudo -u apache scl enable rh-php72 – php -dmemory_limit=512M -f /usr/share/nextcloud/cron.php
[root@server

Nothing to see. Not as mail, not in the console and not in the log.

Any clue on /var/opt/rh/rh-php72/log/php-fpm/error.log ?

1 Like

Here is the error log:

[01-Sep-2019 14:09:55] NOTICE: error log file re-opened
[01-Sep-2019 22:16:35] NOTICE: Terminating …
[01-Sep-2019 22:16:35] NOTICE: exiting, bye-bye!
[02-Sep-2019 07:50:08] NOTICE: fpm is running, pid 1541
[02-Sep-2019 07:50:08] NOTICE: ready to handle connections
[02-Sep-2019 07:50:08] NOTICE: systemd monitor interval set to 10000ms
[02-Sep-2019 22:00:35] NOTICE: Terminating …
[02-Sep-2019 22:00:35] NOTICE: exiting, bye-bye!
[03-Sep-2019 07:50:20] NOTICE: fpm is running, pid 1537
[03-Sep-2019 07:50:20] NOTICE: ready to handle connections
[03-Sep-2019 07:50:20] NOTICE: systemd monitor interval set to 10000ms
[03-Sep-2019 17:17:51] NOTICE: Terminating …
[03-Sep-2019 17:17:51] NOTICE: exiting, bye-bye!
[03-Sep-2019 17:17:51] NOTICE: fpm is running, pid 17245
[03-Sep-2019 17:17:51] NOTICE: ready to handle connections
[03-Sep-2019 17:17:51] NOTICE: systemd monitor interval set to 10000ms
[03-Sep-2019 17:18:36] NOTICE: Terminating …
[03-Sep-2019 17:18:36] NOTICE: exiting, bye-bye!
[03-Sep-2019 17:20:29] NOTICE: fpm is running, pid 1531
[03-Sep-2019 17:20:29] NOTICE: ready to handle connections
[03-Sep-2019 17:20:29] NOTICE: systemd monitor interval set to 10000ms
[03-Sep-2019 21:49:40] NOTICE: Terminating …
[03-Sep-2019 21:49:40] NOTICE: exiting, bye-bye!
[04-Sep-2019 07:50:42] NOTICE: fpm is running, pid 1538
[04-Sep-2019 07:50:42] NOTICE: ready to handle connections
[04-Sep-2019 07:50:42] NOTICE: systemd monitor interval set to 10000ms
[04-Sep-2019 21:20:29] NOTICE: Terminating …
[04-Sep-2019 21:20:29] NOTICE: exiting, bye-bye!
[05-Sep-2019 07:50:06] NOTICE: fpm is running, pid 1537
[05-Sep-2019 07:50:06] NOTICE: ready to handle connections
[05-Sep-2019 07:50:06] NOTICE: systemd monitor interval set to 10000ms
[05-Sep-2019 22:07:12] NOTICE: Terminating …
[05-Sep-2019 22:07:12] NOTICE: exiting, bye-bye!
[06-Sep-2019 07:50:08] NOTICE: fpm is running, pid 1535
[06-Sep-2019 07:50:08] NOTICE: ready to handle connections
[06-Sep-2019 07:50:08] NOTICE: systemd monitor interval set to 10000ms
[06-Sep-2019 21:17:48] NOTICE: Terminating …
[06-Sep-2019 21:17:48] NOTICE: exiting, bye-bye!
[07-Sep-2019 07:50:26] NOTICE: fpm is running, pid 1539
[07-Sep-2019 07:50:26] NOTICE: ready to handle connections
[07-Sep-2019 07:50:26] NOTICE: systemd monitor interval set to 10000ms

My bad, nothing useful on that log.

I kind of reproduced the problem:

forcing nextcloud cron job to execute when mysql is not running
[root@server ~]# systemctl stop mysqld
[root@server ~]# sudo -u apache scl enable rh-php72 -- php -dmemory_limit=512M -f /usr/share/nextcloud/cron.php
PHP Fatal error:  Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /usr/share/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\DB\Connection->connect()
#1 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /usr/share/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMyS in /usr/share/nextcloud/lib/private/DB/Connection.php on line 64
PHP Fatal error:  Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory in /usr/share/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(448): OC\DB\Connection->connect()
#1 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(410): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(354): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(710): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /usr/share/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /usr/share/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(181): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOMyS in /usr/share/nextcloud/lib/private/DB/Connection.php on line 64

So an explanation or sequence of events could be that:

  1. mysqld service was stopped or restarting
  2. then, the nextcloud cron job ran
  3. cron.php failed to connect to mysql’s unix socket
  4. cron job failed and mailed the error
  5. after that, mysqld service was back online, no more errors and nextcloud still works
1 Like

My Nethserver restarts every morning at 07:45. The mail with the error message came at 07:50.
I think it’s because the restart and cron job are temporally together. Could that be a possibility?

Yes, that plausible, according to mariadb/mysqld service:

Just compare the timing between the cron job execution and mariadb/mysqld service start.

1 Like

Is it possible to terminate the cron job to a later time?

The nextcloud cron job is set to run every 5 minutes. I don’t see the need to change it, if our findings are correct the message can be ignored.

2 Likes

Ok, thanks to you and all the other helpers.

Regards

Uwe