Nextcloud on Dietpi v6.34.3

Thanks, found it. but the error.log is empty

:/var/log/mysql# ls -l
total 0
-rw-rw---- 1 mysql adm 0 Jan 20 09:17 error.log

I am trying a fresh install again, install NC and then try the restore… fingers crossed!

ok let’s check how the database will look like afterwards.

Did a fresh install dietpi, installed NC, did a restore.
Same issue, NC does not work. mariadb does not start,

I think this is because I have pointed the dietpi_userdata to external drive, but this has to be on external drive due to huge size of photos and videos.

I feel if the dietpi_userdata is on the default location in /mnt, the database should be good.

Is there a fix for this… Without a working restore, NC is not a good solution on Dietpi.

Any help here MichaIng Joulinar

ok let’s try to see what happen with the database

systemctl restart mariadb.service
journalctl -u mariadb
cat /var/log/mysql/error.log
readlink /var/lib/mysql
readlink -f /var/lib/mysql

these are the outputs:

dietpi@NextCloud:/home$ 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 cod                                                                             e.
See "systemctl status mariadb.service" and "journalctl -xe" for details.



dietpi@NextCloud:/home$ sudo journalctl -u mariadb
-- Logs begin at Thu 2019-02-14 02:11:59 PST, end at Thu 2021-01-21 07:45:09 PST. --
Jan 21 07:33:17 NextCloud systemd[1]: Starting MariaDB 10.3.27 database server...
Jan 21 07:33:19 NextCloud mysqld[634]: 2021-01-21  7:33:19 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 634 ...
Jan 21 07:33:19 NextCloud mysqld[634]: 2021-01-21  7:33:19 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Jan 21 07:33:19 NextCloud mysqld[634]: 2021-01-21  7:33:19 0 [Warning] Can't create test file /var/lib/mysql/NextCloud.lower-test
Jan 21 07:33:19 NextCloud mysqld[634]: [97B blob data]
Jan 21 07:33:19 NextCloud mysqld[634]: 2021-01-21  7:33:19 0 [ERROR] Aborting
Jan 21 07:33:19 NextCloud systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 07:33:19 NextCloud systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 21 07:33:19 NextCloud systemd[1]: Failed to start MariaDB 10.3.27 database server.
Jan 21 07:41:17 NextCloud systemd[1]: Starting MariaDB 10.3.27 database server...
Jan 21 07:41:17 NextCloud mysqld[1554]: 2021-01-21  7:41:17 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 1554 ...
Jan 21 07:41:17 NextCloud mysqld[1554]: 2021-01-21  7:41:17 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Jan 21 07:41:17 NextCloud mysqld[1554]: 2021-01-21  7:41:17 0 [Warning] Can't create test file /var/lib/mysql/NextCloud.lower-test
Jan 21 07:41:17 NextCloud mysqld[1554]: [97B blob data]
Jan 21 07:41:17 NextCloud mysqld[1554]: 2021-01-21  7:41:17 0 [ERROR] Aborting
Jan 21 07:41:17 NextCloud systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 07:41:17 NextCloud systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 21 07:41:17 NextCloud systemd[1]: Failed to start MariaDB 10.3.27 database server.
Jan 21 07:44:47 NextCloud systemd[1]: Starting MariaDB 10.3.27 database server...
Jan 21 07:44:48 NextCloud mysqld[1728]: 2021-01-21  7:44:48 0 [Note] /usr/sbin/mysqld (mysqld 10.3.27-MariaDB-0+deb10u1) starting as process 1728 ...
Jan 21 07:44:48 NextCloud mysqld[1728]: 2021-01-21  7:44:48 0 [Warning] Could not increase number of max_open_files to more than 16384 (request: 32186)
Jan 21 07:44:48 NextCloud mysqld[1728]: 2021-01-21  7:44:48 0 [Warning] Can't create test file /var/lib/mysql/NextCloud.lower-test
Jan 21 07:44:48 NextCloud mysqld[1728]: [97B blob data]
Jan 21 07:44:48 NextCloud mysqld[1728]: 2021-01-21  7:44:48 0 [ERROR] Aborting
Jan 21 07:44:48 NextCloud systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jan 21 07:44:48 NextCloud systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 21 07:44:48 NextCloud systemd[1]: Failed to start MariaDB 10.3.27 database server.
dietpi@NextCloud:/home$



dietpi@NextCloud:/home$ sudo cat /var/log/mysql/error.log
dietpi@NextCloud:/home$



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



dietpi@NextCloud:/home$ readlink -f /var/lib/mysql
dietpi@NextCloud:/home$

Thanks for these commands, looks like the database is not available for the service to start.

Note that the dietpi_userdata has been moved to external drive - this was done with a working NC setup on Dietpi, backup restored to fresh Dietpi installation.

mysql files are still available on the external drive

When the dietpi restore is completed, will the dietpi_userdata be pointed to the external drive from the data in backup?

I modified your post a little bit to get the coding more readable. Hope it is ok for you.

Question:

  • what data are included into your backup?
  • To which location you restored the backup?

Can you share ls -la /mnt

thanks for adjusting the format!!

Steps for Restore performed - used completely separate external drive and microSD Card (dietpi on RPi) for the restore

  1. Copied the dietpi_userdata from old to new external drive with same folder / file hierarchy
  2. Restored the backup using the dietpi-back to the freshly installed Dietpi with NextCloud.
dietpi@NextCloud:/home$ ls -la /mnt
total 32
drwxr-xr-x  8 root   root   4096 Jan 20 17:04 .
drwxr-xr-x 21 root   root   4096 Sep 10 05:30 ..
dr-xr-xr-x  2 root   root   4096 Jan 20 17:04 XXXXXXXX-bcab-48e3-90a9-XXXXXXXXXXXX
drwxr-xr-x  4 root   root   4096 Jan 19 15:57 XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX
drwxr-xr-x 17 root   root   4096 Jan 20 07:01 XXXXXXXX-31ca-463d-af29-XXXXXXXXXXXX
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:/home$

ok we are getting closer, you are missing the link dietpi user data pointing to your HDD

basically you would need to mound the HDD to /mnt/<hdd_name> and create a symlink.

Can you share ls -la /mnt from the original system pls

this is the output from the original NC Dietpi Setup:

dietpi@NextCloud:~$ ls -la /mnt
total 32
drwxr-xr-x  8 root   root   4096 Jan 19 07:47 .
drwxr-xr-x 21 root   root   4096 Sep 10 05:30 ..
drwxr-xr-x  2 root   root   4096 Dec 30 11:24 XXXXXXXX3E77XXXX
drwxr-xr-x  5 root   root   4096 Dec 30 13:08 XXXXXXXX-bcab-48e3-90a9-XXXXXXXXXXXX
drwxr-xr-x 17 root   root   4096 Jan 20 07:01 XXXXXXXX-31ca-463d-af29-XXXXXXXXXXXX
lrwxrwxrwx  1 root   root     57 Dec 29 14:09 dietpi_userdata -> /mnt/XXXXXXXX-bcab-48e3-90a9-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:~$

there you see the link pointing to your HDD

lrwxrwxrwx  1 root   root     57 Dec 29 14:09 dietpi_userdata -> /mnt/XXXXXXXX-bcab-48e3-90a9-XXXXXXXXXXXX/dietpi_userdata

That’s what need to be created on your new system pointing to your new HDD

you mean the symlink to point to HDD… doing it now

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

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?




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:~$



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



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:~$



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:~$



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:~$



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



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

yes we are getting closer :slight_smile:

can you share ls -la /mnt/XXXXXXXX-8746-493a-8398-XXXXXXXXXXXX/dietpi_userdata/mysql

this is the output:

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:~$

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

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

id mysql
id redis

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

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

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.

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

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

mysql -u root -e "SET PASSWORD FOR 'oc_admin'@localhost = PASSWORD('topsecret');"
dietpi-services restart

Nextcloud should have access to the database now.

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?

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 https://dietpi.com/forum/t/qbittorrent-version-shipping-with-dietpi/2326/9