[Stretch testing] Nextcloud / mariadb pb


I have a problem with nextcloud after doing the yunohost update in beta (debian 9).

  1. which user is used as root for mariadb? It’s root (system user)
    , no ?
root@charbowicz:~# mysqladmin -u root -p status
Enter password: 
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
  1. log of my problem
PHP message: PHP Fatal error:  Uncaught exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' in /var/www/nextcloud/lib/private/DB/Connection.php:64
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\DBAL\Connection->setTransaction


:~# systemctl status -l  mariadb.service 
● mariadb.service - MariaDB database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-05-09 13:09:59 CEST; 32min ago
  Process: 1595 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1579 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
  Process: 1114 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=exite
  Process: 1079 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 1034 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 1279 (mysqld)
   Status: "Taking your SQL requests now..."
    Tasks: 28 (limit: 4915)
   Memory: 107.8M
      CPU: 4.567s
   CGroup: /system.slice/mariadb.service
           └─1279 /usr/sbin/mysqld

May 09 13:30:02 charbowicz.fr mysqld[1279]: 2018-05-09 13:30:02 7f797f5c2700 InnoDB: Error: Column last_update in table "mysql"."innodb_table_stats" is INT UNSIGNED NOT NULL but should be BINARY(4) NOT NULL (typ

thx for your help.

I have nothing in this var … it’s this normal? (command executed as root)


That’s because you didn’t define the $MYSQL_ROOT_PWD_FILE variable :wink:

But you can directly : cat /etc/yunohost/mysql

Ok, but I do not find how fix this problem.
Any ideas ?
seems to be related to the database but … At worst I install Nextcloud one more time

Yes, reinstalling nextcloud might work. But the point of the testing is also to understand, test and fix bugs so that other can benefit from it :stuck_out_tongue:

I found a similar issue on Stack Overflow : https://dba.stackexchange.com/questions/139917/getting-innodb-internal-errors-on-every-query-run

So maybe something like this could help solve the thing :

# Export the mysql db ?
mysqldump --events --quick --single-transaction mysql > mysql-dump.sql

#Reimport it
mysql mysql < mysql-dump.sql

# Restart mysql
service mysql restart

Then see if systemctl status -l mariadb.service is happy now

OK it’work.

So for me


apt-get install php7.0-apcu -y
service nginx restart
systemctl reload php7.0-fpm.service

Maybe from the beginning the problem was php7.0-apcu .
So if you have my pb, check if you have php7.0-apcu.

And after, if you have always this pb, import and Reimport.

Log nextcloud : /home/yunohost.app/nextcloud/data/nextcloud.log

THX @Aleks @genma @Gildas

1 Like