Internal server error - DB problem :/

Hi guys :slight_smile:

My server frozed last Thursday night and i have to reboot it manually.
All is up and running except Nextcloud (admin interface is ok) ! :confused:

I’m running unRAID with the NCP’s docker (already made a post there but no response :cry:)

unRAID log :

Starting Redis
Starting Cron
Starting Postfix
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
/run-parts.sh: line 47: /etc/services-enabled.d/services-enabled.d: Is a directory

e
/run-parts.sh: line 6: /etc/services-enabled.d/services-enabled.d: Is a directory
stopping Cron...
stopping Redis...
stopping Postfix...
stopping HPB...
notify_push: no process found
Stopping apache
Stopping PHP-fpm
Stopping mariaDB
stopping Cron...
stopping Redis...
stopping Postfix...
stopping HPB...
notify_push: no process found
Stopping apache
Stopping PHP-fpm
Stopping mariaDB
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

This file do exist :
Nextcloud

MySQL error log :

[Warning] The parameter innodb_file_format is deprecated and has no effect. It may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
2021-10-16 10:23:28 0 [Note] InnoDB: Using Linux native AIO
2021-10-16 10:23:28 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-10-16 10:23:28 0 [Note] InnoDB: Uses event mutexes
2021-10-16 10:23:28 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-10-16 10:23:28 0 [Note] InnoDB: Number of pools: 1
2021-10-16 10:23:28 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-10-16 10:23:28 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
2021-10-16 10:23:28 0 [Note] InnoDB: Completed initialization of buffer pool
2021-10-16 10:23:28 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-10-16 10:23:28 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=14054915147
2021-10-16 10:23:28 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-10-16 10:23:28 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-10-16 10:23:28 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-10-16 10:23:28 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-10-16 10:23:28 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-10-16 10:23:28 0x1525cac94700  InnoDB: Assertion failure in file /build/mariadb-10.3-XTU5dn/mariadb-10.3-10.3.29/storage/innobase/include/fut0lst.ic line 85
InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
InnoDB: about forcing recovery.
211016 10:23:28 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

2021-10-16 10:23:28 0 [Note] InnoDB: 10.3.29 started; log sequence number 14054915200; transaction id 26904017
To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

Server version: 10.3.29-MariaDB-0+deb10u1
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467429 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x1525b4000c08
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x1525cac93d58 thread_stack 0x49000
2021-10-16 10:23:28 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-10-16 10:23:28 0 [Note] Recovering after a crash using tc.log
2021-10-16 10:23:28 0 [Note] InnoDB: Loading buffer pool(s) from /data/database/ib_buffer_pool
2021-10-16 10:23:28 0 [Note] Starting crash recovery...
2021-10-16 10:23:28 0 [Note] Crash recovery finished.
mysqld(my_print_stacktrace+0x2e)[0x559fc83ad31e]
mysqld(handle_fatal_signal+0x54d)[0x559fc7ed857d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x1525fa84e730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b)[0x1525fa6b27bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121)[0x1525fa69d535]
2021-10-16 10:23:28 0 [Note] Server socket created on IP: '127.0.0.1'.
mysqld(+0x4e92f9)[0x559fc7c1a2f9]
mysqld(+0x4e5ffa)[0x559fc7c16ffa]
mysqld(+0xa15865)[0x559fc8146865]
mysqld(+0xa162f4)[0x559fc81472f4]
mysqld(+0xa022d8)[0x559fc81332d8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3)[0x1525fa843fa3]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x1525fa7744cf]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x0): (null)
Connection ID (thread ID): 1
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on

The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.

We think the query pointer is invalid, but we will try to print it anyway. 
Query: 

Writing a core file...
Working directory at /data/database
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            unlimited            unlimited            bytes     
Max core file size        0                    0                    bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             256163               256163               processes 
Max open files            40960                40960                files     
Max locked memory         unlimited            unlimited            bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       256163               256163               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: core

# 

Already tried :

  • Delete and rebuild the container as well as the docker’s image - No success
  • Copy the nextcloud dir to a new docker - Successfully recovered Nextcloud settings (with littles exceptions, like MFA), but no DB~~

MySQL won’t start, so cannot use mysqldump :scream:

Is there a kind soul to help me pretty please ? :pray:

Do no hesitate to ask if you need more details :slight_smile:

Unfamiliar with unRaid , but I’d try running ncp-report inside the ncp container and check ncp.log for clues why connecting to db fails.

Thank you for responding OliverV :wink:

Here’s the log of ncp-report :

/mnt/user/Nextcloud/bin# ncp-report 
<--! Paste this in GitHub report -->

<details>
<summary>NextCloudPi diagnostics</summary>
bash: /usr/local/bin/ncp-diag: No such file or directory
</details>

<details>
<summary>Nextcloud configuration</summary>
sudo: unknown user: www-data
sudo: error initializing audit plugin sudoers_audit
</details>

<details>
<summary>HTTPd logs</summary>
tail: cannot open '/var/log/apache2/error.log' for reading: No such file or directory
</details>

<details>
<summary>Database logs</summary>
tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory
</details>

grep: /var/www/nextcloud/config/config.php: No such file or directory

<details>
<summary>Nextcloud logs</summary>
tail: cannot open '/nextcloud.log' for reading: No such file or directory
</details>

The content of NCP “tools dir” :

/mnt/user/Nextcloud/bin# ls -al
total 180
drwxr-xr-x 1 root   root    574 Oct  7 21:53 ./
drwxrwxrwx 1 nobody users    66 Oct 16 08:55 ../
-rwxr-xr-x 1 root   root    418 Oct  7 21:52 nc-previews*
-rwxr-xr-x 1 root   root     64 Oct  7 21:52 ncc*
drwxr-xr-x 1 root   root     98 Oct  7 21:52 ncp/
-rwxr-xr-x 1 root   root   3138 Oct  7 21:52 ncp-backup*
-rwxr-xr-x 1 root   root    721 Oct  7 21:52 ncp-check-nc-version*
-rwxr-xr-x 1 root   root    392 Oct  7 21:52 ncp-check-updates*
-rwxr-xr-x 1 root   root    905 Oct  7 21:52 ncp-check-version*
-rwxr-xr-x 1 root   root   3738 Oct  7 21:52 ncp-config*
-rw-r--r-- 1 root   root   4780 Oct  7 21:52 ncp-diag
-rwxr-xr-x 1 root   root   3707 Oct  7 21:52 ncp-dist-upgrade*
-rwxr-xr-x 1 root   root    797 Oct  7 21:52 ncp-notify-unattended-upgrade*
-rwxr-xr-x 1 root   root    727 Oct  7 21:52 ncp-notify-update*
-rw-r--r-- 1 root   root   2040 Oct  7 21:52 ncp-provisioning.sh
-rwxr-xr-x 1 root   root   1917 Oct  7 21:52 ncp-report*
-rwxr-xr-x 1 root   root   5579 Oct  7 21:52 ncp-restore*
-rwxr-xr-x 1 root   root     39 Oct  7 21:53 ncp-scan*
-rw-r--r-- 1 root   root   1128 Oct  7 21:52 ncp-suggestions
-rwxr-xr-x 1 root   root    977 Oct  7 21:52 ncp-test-updates*
-rwxr-xr-x 1 root   root   1544 Oct  7 21:52 ncp-update*
-rwxr-xr-x 1 root   root   7764 Oct  7 21:52 ncp-update-nc*
-rw-r--r-- 1 root   root    822 Oct  7 21:52 nextcloud-domain.sh
-rwxr-xr-x 1 root   root  87624 Oct  7 21:53 noip2*

And, when i’m going in the docker’s console and try to run ncp-diag from “/usr/local/bin/ncp-diag”, it tells me :

# ncp-diag
sh: 11: ncp-diag: Permission denied
# sudo ncp-diag
sudo: ncp-diag: command not found

Lots of

Is ncp.log not present either?

I’d remove the old and start a fresh container and restore from backup, or simply use same volume. But as said never used unraid, and only have basic docker skills and use this doc

Think not supposed to run directly from terminal, try ncp-config and then run nc-info.

/var/log/ncp.log ?

Here it is :

[ nc-previews-auto ]
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refuse
d in /data/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /data/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /data/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Ar
ray)
#4 /data/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /data/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /data/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /data/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /data/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /data/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#11 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#12 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache
\\Fac...')
#16 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\U
tility\{closure}(Object(OC\Server))
#17 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#18 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 /data/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#23 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#24 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 /data/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 /data/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /data/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#31 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#32 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 /data/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 /data/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /data/nextcloud/lib/base.php(1076): OC::init()
#38 /data/nextcloud/console.php(49): require_once('/data/nextcloud...')
#39 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#40 {main}An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refuse
d in /data/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /data/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /data/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Ar
ray)
#4 /data/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /data/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /data/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /data/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /data/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /data/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#11 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#12 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache
\\Fac...')
#16 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\U
tility\{closure}(Object(OC\Server))
#17 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#18 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 /data/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#23 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#24 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 /data/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 /data/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /data/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#31 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#32 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 /data/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 /data/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /data/nextcloud/lib/base.php(1076): OC::init()
#38 /data/nextcloud/console.php(49): require_once('/data/nextcloud...')
#39 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#40 {main}An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refuse
d in /data/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /data/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /data/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Ar
ray)
#4 /data/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /data/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /data/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /data/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /data/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /data/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#11 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#12 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache
\\Fac...')
#16 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\U
tility\{closure}(Object(OC\Server))
#17 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#18 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 /data/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#23 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#24 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 /data/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 /data/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /data/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#31 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#32 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 /data/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 /data/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /data/nextcloud/lib/base.php(1076): OC::init()
#38 /data/nextcloud/console.php(49): require_once('/data/nextcloud...')
#39 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#40 {main}An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refuse
d in /data/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /data/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /data/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Ar
ray)
#4 /data/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /data/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /data/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /data/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /data/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /data/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#11 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#12 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache
\\Fac...')
#16 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\U
tility\{closure}(Object(OC\Server))
#17 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#18 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 /data/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#23 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#24 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 /data/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 /data/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /data/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#31 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#32 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 /data/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 /data/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /data/nextcloud/lib/base.php(1076): OC::init()
#38 /data/nextcloud/console.php(49): require_once('/data/nextcloud...')
#39 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#40 {main}Sun Oct 17 04:50:17 UTC 2021 - Running /etc/cron.daily/ncp-autoupdate...
[ nc-update-nc-apps-auto ]
checking for updates...
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refuse
d in /data/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /data/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /data/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
#3 /data/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Ar
ray)
#4 /data/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /data/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /data/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /data/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /data/nextcloud/lib/private/legacy/OC_App.php(965): OC\AppConfig->getValues(false, 'installed_versi...')
#9 /data/nextcloud/lib/private/Server.php(682): OC_App::getAppVersions()
#10 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#11 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#12 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
#13 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', false)
#14 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Memcache\\Fac...')
#15 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache
\\Fac...')
#16 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\U
tility\{closure}(Object(OC\Server))
#17 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#18 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
#19 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', false)
#20 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\ICacheFacto...')
#21 /data/nextcloud/lib/private/Server.php(1031): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
#22 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#23 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#24 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
#25 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', false)
#26 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
#27 /data/nextcloud/lib/private/Server.php(1990): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
#28 /data/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /data/nextcloud/lib/private/Server.php(430): OC\Files\View->__construct()
#30 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}(Object(OC\Server))
#31 /data/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utilit
y\{closure}(Object(Pimple\Container))
#32 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
#33 /data/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', false)
#34 /data/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query('OC\\Files\\Node\\H...')
#35 /data/nextcloud/lib/private/Server.php(1353): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
#36 /data/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /data/nextcloud/lib/base.php(1076): OC::init()
#38 /data/nextcloud/console.php(49): require_once('/data/nextcloud...')
#39 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#40 {main}
[ncp-update-nc]
Nextcloud is currently down

# 

Thank you :wink:

It tells this :

# ncp-config
Running nc-info
Gathering information...
NextCloudPi version  v1.40.4
NextCloudPi image    NextCloudPi_docker_10-07-21
distribution         Debian GNU/Linux 10 \n \l
automount            no
USB devices          sdb 
datadir              /data/nextcloud/data
data in SD           yes
data filesystem      fuseblk
data disk usage      507G/932G
rootfs usage         13G/20G
swapfile             none
dbdir                /data/database
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      down
Redis service        up
HPB service          down
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.1.45
gateway              192.168.1.1
interface            eth0
certificates         none
NAT loopback         no
uptime               3days

You should run Lets Encrypt for trusted encrypted access
You should use nc-datadir to move your files to your plugged in USB drive
You should enable automount to use your plugged in USB drive
Done. Press any key...

Yep, tried that yesterday, made another NCP docker to restore the last backup.

First, i had a “can only restore from ext/btrfs filesystems”
Wierd that NCP cannot restore it’s own backup O_o
but i found how to circumvent this. The backup restored but in the end, something like the ncp.log errors and no access to data :cry:

There might have been an issue with database user password getting re-generated at reboot.
Not sure, but can research this forum and github issues.
Mayby check if password for the client in /root/.my.cnf and dbpassword in NC’s config.php are the same.

They’re exactly the same :+1:

Okay, too much downtime, restored a bakup from one month ago manually and that’s it.

Thank you anyway :slight_smile: