Nextcloud on Dietpi v6.34.3 Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
cktechie
Posts: 37
Joined: Tue Jan 05, 2021 1:34 am

Re: Nextcloud on Dietpi v6.34.3

Post by cktechie »

you mean the symlink to point to HDD.. doing it now
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud on Dietpi v6.34.3

Post by Joulinar »

yes because this is pointing to your entire database directory and it is missing completely on the system you restored. Therefore you did not get any response on readlink -f /var/lib/mysql. Usually it should return path to your HDD.
dietpi@NextCloud:/home$ readlink -f /var/lib/mysql
dietpi@NextCloud:/home$
You would need to create that missing link pointing to the HDD you restored dietpi userdata on
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cktechie
Posts: 37
Joined: Tue Jan 05, 2021 1:34 am

Re: Nextcloud on Dietpi v6.34.3

Post by cktechie »

I did the symlink and still getting error, I ran the commands you gave earlier, and it seems to be some access permissions issue now, an improvement from situation..

What kind of access rights permission and owner rights should the restored folder (nextcloud_data & mysql) should have?



Code: Select all

dietpi@NextCloud:~$ ls -la /mnt
total 32
drwxr-xr-x  8 root   root   4096 Jan 21 16:57 .
drwxr-xr-x 21 root   root   4096 Sep 10 05:30 ..
dr-xr-xr-x  2 root   root   4096 Jan 21 16:29 XXXXXXXX-bcab-48e3-90a9-XXXXXXXXXXXX
drwxr-xr-x  4 root   root   4096 Jan 19 15:57 XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX
drwxr-xr-x 18 root   root   4096 Jan 22 07:00 XXXXXXXX-31ca-463d-af29-XXXXXXXXXXXX
lrwxrwxrwx  1 root   root     57 Jan 21 16:57 dietpi_userdata -> /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata
drwxrwxr-x  2 dietpi dietpi 4096 Sep 10 05:28 ftp_client
drwxrwxr-x  2 dietpi dietpi 4096 Sep 10 05:30 nfs_client
drwxrwxr-x  2 dietpi dietpi 4096 Sep 10 05:30 samba
dietpi@NextCloud:~$ 

Code: Select all

dietpi@NextCloud:~$ readlink -f /var/lib/mysql
/mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql
dietpi@NextCloud:~$

Code: Select all

dietpi@NextCloud:~$ systemctl restart mariadb.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'mariadb.service'.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
dietpi@NextCloud:~$

Code: Select all

dietpi@NextCloud:~$ sudo journalctl -u mariadb
-- Logs begin at Thu 2021-01-21 23:00:05 PST, end at Fri 2021-01-22 08:33:53 PST. --
Jan 21 23:01:16 NextCloudPi systemd[1]: Starting MariaDB 10.3.27 database server...
Jan 21 23:01:17 NextCloudPi mysqld[693]: 2021-01-21 23:01:17 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 693 ...
Jan 21 23:01:17 NextCloudPi mysqld[693]: 2021-01-21 23:01:17 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32185)
Jan 21 23:01:17 NextCloudPi mysqld[693]: 2021-01-21 23:01:17 0 [Warning] Can't create test file /var/lib/mysql/NextCloudPi.lower-test
Jan 21 23:01:18 NextCloudPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 23:01:18 NextCloudPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 21 23:01:18 NextCloudPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
Jan 22 08:33:37 NextCloudPi systemd[1]: Starting MariaDB 10.3.27 database server...
Jan 22 08:33:38 NextCloudPi mysqld[1392]: 2021-01-22  8:33:38 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 1392 ...
Jan 22 08:33:38 NextCloudPi mysqld[1392]: 2021-01-22  8:33:38 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32185)
Jan 22 08:33:38 NextCloudPi mysqld[1392]: 2021-01-22  8:33:38 0 [Warning] Can't create test file /var/lib/mysql/NextCloudPi.lower-test
Jan 22 08:33:38 NextCloudPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jan 22 08:33:38 NextCloudPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 22 08:33:38 NextCloudPi systemd[1]: Failed to start MariaDB 10.3.27 database server.
dietpi@NextCloud:~$

Code: Select all

dietpi@NextCloud:~$ sudo cat /var/log/mysql/error.log
2021-01-22  8:33:38 0 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2021-01-22  8:33:38 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2021-01-22  8:33:38 0 [ERROR] Plugin 'Aria' init function returned error.
2021-01-22  8:33:38 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2021-01-22  8:33:38 0 [Note] InnoDB: Using Linux native AIO
2021-01-22  8:33:38 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-01-22  8:33:38 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-01-22  8:33:38 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-01-22  8:33:38 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-01-22  8:33:38 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-22  8:33:38 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2021-01-22  8:33:38 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-01-22  8:33:38 0 [ERROR] Aborting

Warning: Memory not freed: 392
dietpi@NextCloud:~$

Code: Select all

dietpi@NextCloud:~$ readlink /var/lib/mysql
/mnt/dietpi_userdata/mysql
dietpi@NextCloud:~$

Code: Select all

dietpi@NextCloud:~$ readlink -f /var/lib/mysql
/mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql
dietpi@NextCloud:~$
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud on Dietpi v6.34.3

Post by Joulinar »

yes we are getting closer :)

can you share ls -la /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cktechie
Posts: 37
Joined: Tue Jan 05, 2021 1:34 am

Re: Nextcloud on Dietpi v6.34.3

Post by cktechie »

this is the output:

Code: Select all

dietpi@NextCloud:~$ ls -la /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql/
total 176212
drwxr-xr-x 5 redis  redis      4096 Jan 20 13:29 .
drwxrwxr-x 8 dietpi dietpi     4096 Jan 20 12:21 ..
-rw-rw---- 1 redis  redis     16384 Jan 20 13:24 aria_log.00000001
-rw-rw---- 1 redis  redis        52 Jan 20 13:24 aria_log_control
-rw-r--r-- 1 root   root          0 Jan 20 12:09 debian-10.3.flag
-rw-rw---- 1 redis  redis      4100 Jan 20 13:23 ib_buffer_pool
-rw-rw---- 1 redis  redis  50331648 Jan 20 13:28 ib_logfile0
-rw-rw---- 1 redis  redis  50331648 Jan 20 12:09 ib_logfile1
-rw-rw---- 1 redis  redis  79691776 Jan 20 13:29 ibdata1
-rw-rw---- 1 redis  redis         0 Jan 20 12:10 multi-master.info
drwx------ 2 redis  redis      4096 Jan 20 12:10 mysql
-rw-rw---- 1 root   root         16 Jan 20 12:10 mysql_upgrade_info
drwx------ 2 redis  redis     12288 Jan 20 12:25 nextcloud
drwx------ 2 redis  redis      4096 Jan 20 12:10 performance_schema
-rw-r----- 1 root   root      24576 Jan 19 18:54 tc.log
dietpi@NextCloud:~$
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud on Dietpi v6.34.3

Post by Joulinar »

ok whole database folder is owned by user redis. I guess Redis grepped user ID of Database user mysql during installation of the new system. This could happen as DietPi did not force a specific user id during setup.

let's change it back

Code: Select all

chown -R mysql:mysql /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql/
This should fix the access for the database

Out of curiosity, let's check user id's on the original and the new system

Code: Select all

id mysql
id redis
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
cktechie
Posts: 37
Joined: Tue Jan 05, 2021 1:34 am

Re: Nextcloud on Dietpi v6.34.3

Post by cktechie »

Mariadb service starts now however the nextcloud page still does not load.

Code: Select all

dietpi@NextCloud:~$ sudo cat /var/log/mysql/error.log
2021-01-22 16:18:32 43 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:18:32 44 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:19:45 45 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:19:45 46 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:20:01 47 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:25:02 48 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:27:24 49 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:27:24 50 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:30:01 51 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:33:32 52 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:33:32 53 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:34:46 54 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:34:46 55 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:35:02 56 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:40:01 57 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:43:28 58 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:43:28 59 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:44:01 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2021-01-22 16:44:01 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-01-22 16:44:01 0 [Note] InnoDB: FTS optimize thread exiting.
2021-01-22 16:44:01 0 [Note] InnoDB: Starting shutdown...
2021-01-22 16:44:01 0 [Note] InnoDB: Dumping buffer pool(s) to /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql/ib_buffer_pool
2021-01-22 16:44:01 0 [Note] InnoDB: Buffer pool(s) dump completed at 210122 16:44:01
2021-01-22 16:44:08 0 [Note] InnoDB: Shutdown completed; log sequence number 4313952; transaction id 3096
2021-01-22 16:44:08 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-01-22 16:44:20 0 [Note] /usr/sbin/mysqld: Shutdown complete

2021-01-22 16:44:20 0 [Note] InnoDB: Using Linux native AIO
2021-01-22 16:44:20 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-01-22 16:44:20 0 [Note] InnoDB: Uses event mutexes
2021-01-22 16:44:20 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-01-22 16:44:20 0 [Note] InnoDB: Number of pools: 1
2021-01-22 16:44:20 0 [Note] InnoDB: Using generic crc32 instructions
2021-01-22 16:44:20 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-01-22 16:44:20 0 [Note] InnoDB: Completed initialization of buffer pool
2021-01-22 16:44:20 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-01-22 16:44:23 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-01-22 16:44:23 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-01-22 16:44:23 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-01-22 16:44:23 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-01-22 16:44:23 0 [Note] InnoDB: 10.3.27 started; log sequence number 4313952; transaction id 3095
2021-01-22 16:44:23 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql/ib_buffer_pool
2021-01-22 16:44:23 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-22 16:44:23 0 [Note] InnoDB: Buffer pool(s) load completed at 210122 16:44:23
2021-01-22 16:44:25 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-01-22 16:44:25 0 [Note] Reading of all Master_info entries succeeded
2021-01-22 16:44:25 0 [Note] Added new Master_info '' to hash table
2021-01-22 16:44:25 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.27-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Raspbian 10
2021-01-22 16:45:01 36 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:48:32 37 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:48:32 38 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:49:24 39 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:49:24 40 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:49:25 41 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:49:25 42 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:49:51 43 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:49:51 44 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:50:02 45 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:52:13 46 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
2021-01-22 16:52:13 47 [Warning] Access denied for user 'oc_admin'@'localhost' (using password: YES)
dietpi@NextCloud:~$
Still get the same error on nextcloud

Code: Select all

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.
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud on Dietpi v6.34.3

Post by Joulinar »

ok NextCloud is not able to access the database. I guess password did not fit. Probably NextCloud generate random password during setup.

NextCloud is storing db user password inside /var/www/nextcloud/config/config.php

Code: Select all

root@DietPi:~# cat /var/www/nextcloud/config/config.php | grep dbpassword
  'dbpassword' => 'topsecret',
root@DietPi:~#
Anyway, let's change it inside the database. Take your topsecret password from config.php and add it to the database

Code: Select all

mysql -u root -e "SET PASSWORD FOR 'oc_admin'@localhost = PASSWORD('topsecret');"
dietpi-services restart
Nextcloud should have access to the database now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
krtpowa
Posts: 12
Joined: Wed Jan 31, 2018 1:10 am
Location: Spain
Contact:

Re: Nextcloud on Dietpi v6.34.3

Post by krtpowa »

I take advantage of this post.
I have the same version of Dietpi (Stretch)
And nextcloud is warning that it will no longer support Mariadb 10.1
I can't update to a higher version, how can I do it?
For Buster there are superior versions of mariaDb, for Stretch there?
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud on Dietpi v6.34.3

Post by Joulinar »

@krtpowa
The version of DietPi has no real relation to the Debian version. There will be no new version for MariaDB as you are on Stretch. You would need to upgrade to Debian Buster to get further updates. Current version of MariaDB on Buster is 10.3.

Even if we did not support Debian version upgrades, you might have a look into this post viewtopic.php?p=18988#p18988
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply