After updating my DietPi to the last version, i tried to access NC but im getting this error:
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
I canβt find were is the log file to check more details about this error.
Iβve turned my RPI on and I was about to test you commands in your last answer, but before I start trying those commands, I tried one more time to access my nextcloud in the Browser.
Unexpectedly, i got this message: Unable to connect. Browser canβt establish a connection to the server at βmy-ip-hereβ.
I ran DietPi-Services, and now i got this:
DietPi-Services
βββββββββββββββββββββββββββββββββββββββββββββββββββββ
Mode: status
[ OK ] DietPi-Services | redis-server active (running) since Tue 2020-07-14 12:41:39 BST; 5min ago
[FAILED] DietPi-Services | β mariadb.service - MariaDB 10.3.22 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-07-14 12:41:43 BST; 5min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 654 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
Process: 655 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 657 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: 714 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
Main PID: 714 (code=exited, status=1/FAILURE)
Status: "MariaDB server is down"
Jul 14 12:41:39 DietPi systemd[1]: Starting MariaDB 10.3.22 database server...
Jul 14 12:41:40 DietPi mysqld[714]: 2020-07-14 12:41:40 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) starting as process 714 ...
Jul 14 12:41:40 DietPi mysqld[714]: 2020-07-14 12:41:40 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Jul 14 12:41:43 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 12:41:43 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jul 14 12:41:43 DietPi systemd[1]: Failed to start MariaDB 10.3.22 database server.
[ OK ] DietPi-Services | php7.3-fpm active (running) since Tue 2020-07-14 12:41:43 BST; 5min ago
[FAILED] DietPi-Services | β lighttpd.service - Lighttpd Daemon
Loaded: loaded (/lib/systemd/system/lighttpd.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-07-14 12:41:46 BST; 5min ago
Process: 800 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Process: 805 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255/EXCEPTION)
Main PID: 805 (code=exited, status=255/EXCEPTION)
Jul 14 12:41:46 DietPi systemd[1]: lighttpd.service: Service RestartSec=100ms expired, scheduling restart.
Jul 14 12:41:46 DietPi systemd[1]: lighttpd.service: Scheduled restart job, restart counter is at 5.
Jul 14 12:41:46 DietPi systemd[1]: Stopped Lighttpd Daemon.
Jul 14 12:41:46 DietPi systemd[1]: lighttpd.service: Start request repeated too quickly.
Jul 14 12:41:46 DietPi systemd[1]: lighttpd.service: Failed with result 'exit-code'.
Jul 14 12:41:46 DietPi systemd[1]: Failed to start Lighttpd Daemon.
[ OK ] DietPi-Services | cron active (running) since Tue 2020-07-14 12:41:43 BST; 5min ago
[ OK ] DietPi-Services | dropbear active (running) since Tue 2020-07-14 12:41:38 BST; 5min ago
[ OK ] DietPi-Services | dietpi-ramlog active (exited) since Tue 2020-07-14 09:19:30 BST; 3h 28min ago
[ OK ] DietPi-Services | dietpi-preboot active (exited) since Tue 2020-07-14 09:19:30 BST; 3h 28min ago
[ OK ] DietPi-Services | dietpi-boot active (exited) since Tue 2020-07-14 12:41:38 BST; 5min ago
[ OK ] DietPi-Services | dietpi-postboot active (exited) since Tue 2020-07-14 12:41:38 BST; 5min ago
[ INFO ] DietPi-Services | dietpi-wifi-monitor inactive (dead)
Server is not even running nowβ¦
Note: I didnβt ran the commands of your last answer yet.
You have 2 failing services now. Both web server as well as database are not working. But we would need to fix one by one. Pls can you check if you have sufficient space on your SD card
ok space is not an issue and all data seems to located on the SD card as well. Pls can you perform the checks I ask for above to be able to have a look into database first
systemctl restart mariadb.service
journalctl -u mariadb
cat /var/log/mysql/error.log
readlink /var/lib/mysql
readlink -f /var/lib/mysql
sudo -u mysql -g mysql touch /var/lib/mysql/demo.file
Failed to connect to bus: No such file or directory
Then i ran again as sudo:
sudo systemctl restart mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
sudo journalctl -u mariadb
-- Logs begin at Thu 2019-02-14 10:11:58 GMT, end at Tue 2020-07-14 13:34:14 BST. --
Jul 14 12:41:39 DietPi systemd[1]: Starting MariaDB 10.3.22 database server...
Jul 14 12:41:40 DietPi mysqld[714]: 2020-07-14 12:41:40 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) starting as p
rocess 714 ...
Jul 14 12:41:40 DietPi mysqld[714]: 2020-07-14 12:41:40 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Jul 14 12:41:43 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 12:41:43 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jul 14 12:41:43 DietPi systemd[1]: Failed to start MariaDB 10.3.22 database server.
Jul 14 13:33:14 DietPi systemd[1]: Starting MariaDB 10.3.22 database server...
Jul 14 13:33:14 DietPi mysqld[1160]: 2020-07-14 13:33:14 0 [Note] /usr/sbin/mysqld (mysqld 10.3.22-MariaDB-0+deb10u1) starting as
process 1160 ...
Jul 14 13:33:14 DietPi mysqld[1160]: 2020-07-14 13:33:14 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Jul 14 13:33:17 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jul 14 13:33:17 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jul 14 13:33:17 DietPi systemd[1]: Failed to start MariaDB 10.3.22 database server.
readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
readlink -f /var/lib/mysql
/mnt/dietpi_userdata/mysql
sudo -u mysql -g mysql touch /var/lib/mysql/demo.file
touch: cannot touch '/var/lib/mysql/demo.file': Permission denied
Note: Yesterday i couldnβt access /var/log/lighttpd so i ran sudo chown -R my_username /var/log/lighttpd . Maybe this caused some side effectsβ¦
And lastly (sorry for the extensive output, i had to delete some lines in the middle, they where the same error but for other directories):
sudo cat /var/log/mysql/error.log
2020-07-14 13:33:14 0 [Note] InnoDB: Using Linux native AIO
2020-07-14 13:33:14 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-07-14 13:33:14 0 [Note] InnoDB: Uses event mutexes
2020-07-14 13:33:14 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-07-14 13:33:14 0 [Note] InnoDB: Number of pools: 1
2020-07-14 13:33:14 0 [Note] InnoDB: Using generic crc32 instructions
2020-07-14 13:33:14 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-07-14 13:33:14 0 [Note] InnoDB: Completed initialization of buffer pool
2020-07-14 13:33:14 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-07-14 13:33:14 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/gtid_slave_pos.ibd' OS error: 81
2020-07-14 13:33:14 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
..... (more lines with the same access rights errors for other directories)
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Cannot open datafile for read-only: './nextcloud/oc_webauthn.ibd' OS error: 81
2020-07-14 13:33:14 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``nextcloud`.`oc_webauthn``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 0 [Warning] InnoDB: Ignoring tablespace for `nextcloud`.`oc_webauthn` because it could not be opened.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Cannot open datafile for read-only: './nextcloud/oc_whats_new.ibd' OS error: 81
2020-07-14 13:33:14 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Could not find a valid tablespace file for ``nextcloud`.`oc_whats_new``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 0 [Warning] InnoDB: Ignoring tablespace for `nextcloud`.`oc_whats_new` because it could not be opened.
2020-07-14 13:33:14 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-07-14 13:33:14 0 [Note] InnoDB: 10.3.22 started; log sequence number 46552637; transaction id 115418
2020-07-14 13:33:14 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/dietpi_userdata/mysql/ib_buffer_pool
2020-07-14 13:33:14 2 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`innodb_index_stats` in the cache. Attempting to load the tablespace with space id 2
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_index_stats.ibd' OS error: 81
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_index_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 4 [ERROR] InnoDB: Failed to find tablespace for table `nextcloud`.`oc_authtoken` in the cache. Attempting to load the tablespace with space id 57
2020-07-14 13:33:14 4 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 4 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 4 [ERROR] InnoDB: Cannot open datafile for read-only: './nextcloud/oc_authtoken.ibd' OS error: 81
2020-07-14 13:33:14 4 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 4 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-07-14 13:33:14 4 [ERROR] InnoDB: Could not find a valid tablespace file for ``nextcloud`.`oc_authtoken``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Failed to find tablespace for table `mysql`.`innodb_table_stats` in the cache. Attempting to load the tablespace with space id 1
2020-07-14 13:33:14 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Cannot open datafile for read-only: './mysql/innodb_table_stats.ibd' OS error: 81
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 0 [Note] Recovering after a crash using tc.log
2020-07-14 13:33:14 2 [ERROR] InnoDB: Could not find a valid tablespace file for ``mysql`.`innodb_table_stats``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 0 [ERROR] Bad magic header in tc log
2020-07-14 13:33:14 0 [ERROR] Crash recovery failed. Either correct the problem (if it's, for example, out of memory error) and restart, or delete tc log and start mysqld with --tc-heuristic-recover={commit|rollback}
2020-07-14 13:33:14 0 [ERROR] Can't init tc log
2020-07-14 13:33:14 0 [ERROR] Aborting
2020-07-14 13:33:14 2 [ERROR] InnoDB: Failed to find tablespace for table `nextcloud`.`oc_appconfig` in the cache. Attempting to load the tablespace with space id 8
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Cannot open datafile for read-only: './nextcloud/oc_appconfig.ibd' OS error: 81
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Could not find a valid tablespace file for ``nextcloud`.`oc_appconfig``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Failed to find tablespace for table `nextcloud`.`oc_jobs` in the cache. Attempting to load the tablespace with space id 40
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Cannot open datafile for read-only: './nextcloud/oc_jobs.ibd' OS error: 81
2020-07-14 13:33:14 2 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:14 2 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2020-07-14 13:33:14 2 [ERROR] InnoDB: Could not find a valid tablespace file for ``nextcloud`.`oc_jobs``. Please refer to https://mariadb.com/kb/en/innodb-data-dictionary-troubleshooting/ for how to resolve the issue.
2020-07-14 13:33:14 0 [ERROR] InnoDB: Cannot open '/mnt/dietpi_userdata/mysql/ib_buffer_pool.incomplete' for writing: Permission denied
2020-07-14 13:33:17 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2020-07-14 13:33:17 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
it was on purpose to change user for all directories to td? Now, database user mysql doesnβt have write access to database files anymore. Therefore your database is failing to start
drwxr-xr-x 5 dt mysql 4096 Jun 11 08:34 mysql
It seems you changed it for entire /mnt directory path
This will change main folder only, as Iβm not sure what kind of data you have inside.
For the following 2 folder, we will do a recursive adjustment to have them changed completely.
A problem could be dietpi-backup folder, as you changed all files and permissions inside your backup as well. If you go to restore your system now, you will overwrite all your files with incorrect user settings. I would recommend to create a complete new backup and delete the current one, if all working fine.