White page after login


#1

Since a few days my nextcloud server went in error (after more then 1 month of fine running).
The server itself is still up, and it’s possible for me (and anyone else) to login, but beyond login the page keeps empty (http error 500). Even the registration part of new users still works, till they officialy login the first time.
Due to the fact I can’t get beyond the login page, I can’t get into the admin panel either.

Also after reboot (a few times) and after updating all packages, the state keeps the same.
After login it goed to ‘/index.php/apps/files/’ which page appears empty.
The android app is also no longer usable since this popped up.

After some check’s, I noticed the MySQL server is stopped. And when trying to start it up, it returns a startup failure.
In the details it says: 'Failed to start LSB: Start and stop the mysql database server daemon.'
This is due to the fact it can’t find something called ‘/usr/bin/mysqld_safe’

Only sort of reason I could think of is an update of 3 days before nextcloud went offline.
MariaDB upgraded (automatically). Since that was the last log action before it went down. But however it is weird it still was working for so long after the upgrade.

But now I’m stuck.
There are around 15 users with shared and non-shared folder and now I’m afraid I can’t fix this and/or can’t back-up it anymore.

Nextcloud version: 12.0.5
Operating system and version: Ubuntu 16.04 LTS
Apache or nginx version: Apache 2.4.18
PHP version: 7.0.25
New or updated: New install

The issue you are facing:

Is this the first time you’ve seen this error?: Y

Steps to replicate it:
N/A

The output of your Nextcloud log in Admin > Logging:

I Can't acces this location (anymore)

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

None, the file is empty

I really hope someone can help me with this, since all this stuff is new to me and I’m really desperate at this point.
Thank you in advance for all your help!


#2

Seems the MariaDB upgrade broke something. Can you open the database on the command line? Is there something in /var/log/mysql.err or /var/log/mysql.log?


#3

Thanks for your reply,
Both these files don’t exist? Do you mean /var/log/mysql/error.log ?

How can I open the database from a command line? (I’m pretty new to this stuff, sorry)


#4

You find the database name, user and password in your config/config.php:

‘dbname’ => ‘owncloud’,
‘dbuser’ => ‘owncloud’,
‘dbpassword’ => ‘xxxxxx’,

Use this command:

mysql -u owncloud -p owncloud

Now enter the password. Use your values for dbuser and dbname. If this works, enter command

show tables;

If you get a listing of the database tables, this is fine. But if you can’t log in to the database at all, you must solve this problem first. Nextcloud will not work without database access.

https://dev.mysql.com/doc/refman/5.7/en/


#5

To make it even more complicated, the config.php is empty.[quote=“eehmke, post:4, topic:28828”]
Use this command:

mysql -u owncloud -p owncloud
[/quote]

When performing this line, I get:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

I’ve no clue?


#6

Sorry, but when the config.php is empty, your nextcloud never has been installed at all. You said it has been running before, so it is broken. Do you have a backup?

Beside, your MySQL installation seems to be broken. Perhaps you should ask for help in a MySql or MariaDB group.

Maybe this helps:
https://mariadb.com/kb/en/library/troubleshooting-connection-issues/


#7

@eehmke
It runned fine for more then one month. I never set config.php myself. I did everything by the installer (in the GUI). So I never had to set anything up in that file. But I understood in the setup manual, when the config.php is not used, the default shall be used. So I tried to login into the database with the labels as in the default file.

Do you know a way to get all the files from the server manually otherwise?


#8

You must get your database running. Before this, nothing will work. Check the link I sent in my last post.


#9

@eehmke But since the issue seems to be in mysql, is it a possibility to delete it and then re-install? or does that mean instant loss on anything?
Because mysql is not startup at all at this moment, so perhaps that creates the error as well?


#10

If you delete the database, you will lose all users and their passwords, and shares, if they created some. The data should be kept.

I am pretty sure you can get the database running. I had a similar issue when I moved from MySql to MariaDb. Does the socket /var/run/mysqld/mysqld.sock exist?


#11

https://mariadb.com/kb/en/library/missing-mysqldsock-file/


#12

/var/run/mysqld/mysqld.sock did not excist.
However when I do a search to all (find / -type s)
I get 1 restult called:
/tmp/snap.0_nextcloud_le0obz/tmp/sockets/mysql.sock
Could this be the ‘lost’ one?

However I wasn’t planning to delete the database it self but just the program mysql (sudo apt-get purge mysql-server) Do you know if this is possible?
Thank you for all your patience


#13

In your link, they state, while mariadb is not running the socket will not be there. But I can’t start mysql/mariadb, since then it returns a failure:
Failed to start LSB: Start and stop the mysql database server daemon.


#14

That’s the problem. What version do you have?

sudo dpkg -l | grep mariadb-server

Try this:

sudo dpkg-reconfigure mariadb-server
sudo service mysql restart
sudo service mysql status

Good night


#15

10.0.34

It returns, mariadb-server is not installed.
Can this be correct?
Should I install it now? How can it find a version, while it is not installed??


#16

You said at the beginning that MariaDb was installed automatically. Let’s check what you have.

sudo dpkg -l | grep mysql
sudo dpkg -l | grep mariadb

should show all relevant packages. Is the installation complete?

sudo apt update
sudo apt list --upgradable


#17

ii libdbd-mysql-perl 4.033-1ubuntu0.1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient20:amd64 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database client library
ii libqt4-sql-mysql:amd64 4:4.8.7+dfsg-5ubuntu2 amd64 Qt 4 MySQL database driver
iU mysql-client-5.7 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database client binaries
iU mysql-client-core-5.7 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.7.21-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
iU mysql-server 5.7.21-0ubuntu0.16.04.1 all MySQL database server (metapackage depending on the latest version)
ic mysql-server-5.7 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database server binaries and system database setup
iU mysql-server-core-5.7 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database server binaries
ii php-mysql 1:7.0+35ubuntu6.1 all MySQL module for PHP [default]
ii php7.0-mysql 7.0.25-0ubuntu0.16.04.1 amd64 MySQL module for PHP

and:

rc mariadb-client-10.0 10.0.34-0ubuntu0.16.04.1 amd64 MariaDB database client binaries
ii mariadb-common 10.0.34-0ubuntu0.16.04.1 all MariaDB common metapackage
rc mariadb-server-10.0 10.0.34-0ubuntu0.16.04.1 amd64 MariaDB database server binaries

There are no ‘real’ updates waiting

apparmor/xenial-updates 2.10.95-0ubuntu2.9 amd64 [upgradable from: 2.10.95-0ubuntu2.8]
libapparmor-perl/xenial-updates 2.10.95-0ubuntu2.9 amd64 [upgradable from: 2.10.95-0ubuntu2.8]
libapparmor1/xenial-updates 2.10.95-0ubuntu2.9 amd64 [upgradable from: 2.10.95-0ubuntu2.8]
libgcrypt20/xenial-updates 1.6.5-2ubuntu0.4 amd64 [upgradable from: 1.6.5-2ubuntu0.3]
update-notifier/xenial-updates 3.168.8 amd64 [upgradable from: 3.168.7]
update-notifier-common/xenial-updates,xenial-updates 3.168.8 all [upgradable from: 3.168.7]

And again thank you already so much for your time!


#18

I am afraid here I have to quit. There are some incompatible issues that do not allow to upgrade from MySQL 5.7 to MariaDb 10.0. That’s why the upgrade failed.

AFAIK, Upgrade to 10.1 should work, but this is not what this Ubuntu/Debian version offers. Try to reinstall Mysql 5.7. But here please get some help in a Mysql group. I am at the end of my knowledge. You must aim to uninstall all MariaDb packages and reinstall the mysql-server package.

Version dependencies can really suck.


#19

Even although the problem is yet not solved, you helped me a lot so far and therefor I’m really thankful for that. Tomorrow I shall have a look in the mysql group.


#20

This might solve your problem:
https://askubuntu.com/questions/773287/how-to-repair-corrupt-package-installation-mysql/773441
Seems this is the same problem. Read to the end, do not start following the steps at the top of the post.