Problem with NextCloudPi re-installation

Hi,

On my Raspberry Pi i got NextCloudPi working. However, after installing some add-ons like OnlyOffice and other suddnely I could not access the web UI. Now I get this message:

This page isn’t working
192.168.1.104 is currently unable to handle this request.
HTTP ERROR 500

Although, I am able to access the NextCloudPi Panel (settings: eg Backup, lets Encrypt etc).

so, I tried to re-install NextCloudPi and in the Terminal it aborts at this stage:

2019-01-20  1:27:49 1996152832 [Note] mysqld (mysqld 10.1.37-`MariaDB-0+deb9u1) starting as process 27197 ...`
2019-01-20  1:27:49 1996152832 [Warning] Can't create test file /var/lib/mysql/raspberrypi.lower-test
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2 "No such file or directory")
2019-01-20  1:27:49 1996152832 [ERROR] Aborting

I’m just wondering how I can fix this issue and get NextCloud working again. I have no idea why an Add-on would do this to an installation.

Any reply’s are appreciated. Thank you.

Seems your mariadb installation is broken? Did you try to reinstall?

1 Like

Do yu mean a complete reinstallation of NextCloud or mariadb? And (here’s the noob question) how would I go bout doing that? Thank you very much for the reply, by the way.

show the output of these commands:

sudo systemctl status mariadb
sudo ls -l /var/lib/mysql
sudo dpkg -l | grep mariadb

1 Like

Thank you very much. I’ll keep this code in my notes just in case it happens again. Thanks again.

So what did these commands show? This was just for analysis, they don’t change anything.

1 Like

sudo systemctl status mariadb

pi@raspberrypi:~ $ sudo systemctl status mariadb
â—Ź mariadb.service - MariaDB 10.1.37 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: 
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─ncp-delay-automount.conf
   Active: activating (start-pre) since Sun 2019-01-20 03:34:05 AEDT; 6s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 11949 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_W
  Process: 12006 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VA
  Process: 12001 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_STAR
  Process: 11997 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/r
 Main PID: 11949 (code=exited, status=1/FAILURE); Control PID: 12159 (sleep)
   CGroup: /system.slice/mariadb.service
           └─control
             └─12159 /bin/sleep 20

Jan 20 03:34:05 raspberrypi systemd[1]: Starting MariaDB 10.1.37 database server
lines 1-17/17 (END)

sudo ls -l /var/lib/mysql

pi@raspberrypi:~ $ sudo ls -l /var/lib/mysql
ls: cannot access '/var/lib/mysql': No such file or directory

sudo dpkg -l | grep mariadb

pi@raspberrypi:~ $ sudo dpkg -l | grep mariadb
ii  mariadb-client-10.1                   10.1.37-0+deb9u1                                  armhf        MariaDB database client binaries
ii  mariadb-client-core-10.1              10.1.37-0+deb9u1                                  armhf        MariaDB database core client binaries
ii  mariadb-common                        10.1.37-0+deb9u1                                  all          MariaDB common metapackage
ii  mariadb-server                        10.1.37-0+deb9u1                                  all          MariaDB database server (metapackage depending on the latest version)
ii  mariadb-server-10.1                   10.1.37-0+deb9u1                                  armhf        MariaDB database server binaries
ii  mariadb-server-core-10.1              10.1.37-0+deb9u1                                  armhf        MariaDB database core server files

try this:

sudo systemctl restart mariadb

Most likely this will fail. Next the status command again:

sudo systemctl restart mariadb

Maybe I could just do a complete reinstallation of Raspbian and NextCloudPi?

pi@raspberrypi:~ $ sudo systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
pi@raspberrypi:~ $ sudo systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

So did you do what the command suggested?

systemctl status mariadb.service

If it shows the same result as before, try:

sudo dpkg-reconfigure mariadb-server

Your database is not running. You must find out the cause for this, before nextcloud can run. This is difficult for me over a distance.

1 Like

systemctl status mariadb.service

â—Ź mariadb.service - MariaDB 10.1.37 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─ncp-delay-automount.conf
   Active: activating (auto-restart) (Result: exit-code) since Sun 2019-01-20 05:01:10 AEDT; 2s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 546 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
  Process: 474 ExecStartPre=/bin/sleep 20 (code=exited, status=0/SUCCESS)
  Process: 32763 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl s
  Process: 32758 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
  Process: 32753 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
 Main PID: 546 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"
   CGroup: /system.slice/mariadb.service

Jan 20 05:01:10 raspberrypi systemd[1]: Failed to start MariaDB 10.1.37 database server.
Jan 20 05:01:10 raspberrypi systemd[1]: mariadb.service: Unit entered failed state.
Jan 20 05:01:10 raspberrypi systemd[1]: mariadb.service: Failed with result 'exit-code'.

journalctl -xe

Jan 20 04:49:40 raspberrypi systemd[1]: nextcloud-domain.service: Main process e
Jan 20 04:49:40 raspberrypi systemd[1]: nextcloud-domain.service: Unit entered f
Jan 20 04:49:40 raspberrypi systemd[1]: nextcloud-domain.service: Failed with re
Jan 20 04:49:44 raspberrypi systemd[1]: mariadb.service: Service hold-off time o
Jan 20 04:49:44 raspberrypi systemd[1]: Stopped MariaDB 10.1.37 database server.
-- Subject: Unit mariadb.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has finished shutting down.
Jan 20 04:49:44 raspberrypi systemd[1]: Starting MariaDB 10.1.37 database server
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit mariadb.service has begun starting up.
Jan 20 04:49:45 raspberrypi systemd[1]: nextcloud-domain.service: Service hold-o
Jan 20 04:49:45 raspberrypi systemd[1]: Stopped Register Current IP as Nextcloud
-- Subject: Unit nextcloud-domain.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit nextcloud-domain.service has finished shutting down.
lines 1384-1406/1406 (END)

Thank you for your support. I am only learning still.

Try the
sudo dpkg-reconfigure mariadb-server

1 Like

Yes, I tried that, but did not work. It’s okay. I will reinstall everything.

Thank you for trying. It will be easier to reinstall, and then if the problem happens again I will come back tomorrow as I must get some sleep.

Thank yu very much for your help!

I would give it a try, but I would need access to your machine. Do your have some kind of VPN, or TeamViewer installed? What OS is running on your machine?

1 Like

Ok reinstalling is the best, I think too. But don’t trash MariaDB again :slight_smile:

1 Like