nextcloudpi icon indicating copy to clipboard operation
nextcloudpi copied to clipboard

[NCP] Internal Server Error & 1146 Table 'nextcloud.oc_mounts' doesn't exist`

Open kmpfwrst opened this issue 1 year ago • 1 comments

Hello, since a few days I cannot access my nextcloudpi via hte DNS nor the IP. But it is possible to enter the admin panel. I am getting the 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."

Withe following command I get: ncc notify_push:self-test An exception occurred while executing a query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_mounts' doesn't exist

I used google and internal search but didn'T find a solution for this bug.

NextCloudPi diagnostics

NextCloudPi version  v1.49.0
NextCloudPi image    NextCloudPi_01-14-19
OS                   Raspbian GNU/Linux 10. 5.10.103-v7+ (armv7l)
automount            yes
USB devices          sda
datadir              /media/USBdrive/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      693G/932G
rootfs usage         3.5G/30G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    23.0.6.1
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          down
Postfix service      up
Internet check       ok
public IP            ***REMOVED SENSITIVE VALUE***
public IP            ***REMOVED SENSITIVE VALUE***
Port check 80        open (ipv4)
Port check 443       open (ipv4)
IP                   ***REMOVED SENSITIVE VALUE***
Gateway              192.168.178.1
Interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
Uptime               59min


Nextcloud configuration

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "5": "nextcloudpi.local",
            "1": "***REMOVED SENSITIVE VALUE***",
            "4": "***REMOVED SENSITIVE VALUE***",
            "20": "192.168.178.1",
            "2": "***REMOVED SENSITIVE VALUE***",
            "": "nextcloudpi"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "23.0.6.1",
        "overwrite.cli.url": "https:\/\/nextcloudpi\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "\/media\/USBdrive\/ncdata\/tmp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "maintenance": false,
        "logfile": "\/media\/USBdrive\/ncdata\/nextcloud.log",
        "loglevel": "2",
        "log_type": "file",
        "htaccess.RewriteBase": "\/",
        "jpeg_quality": "60",
        "app_install_overwrite": [
            "calendar"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "data-fingerprint": "145b8b8456f1475fa848fca8e5811e12"
    }
}

HTTPd logs

[Sat Sep 03 11:56:54.227819 2022] [proxy_fcgi:error] [pid 1199:tid 1689695232] (104)Connection reset by peer: [client 192.168.178.20:51178] AH01075: Error dispatching request to :4443:
[Sat Sep 03 11:56:54.262470 2022] [proxy_fcgi:error] [pid 1199:tid 1681294336] [client 192.168.178.20:51178] AH01067: Failed to read FastCGI header
[Sat Sep 03 11:56:54.262609 2022] [proxy_fcgi:error] [pid 1199:tid 1681294336] (104)Connection reset by peer: [client 192.168.178.20:51178] AH01075: Error dispatching request to :4443:
[Sat Sep 03 11:56:54.268484 2022] [proxy_fcgi:error] [pid 1199:tid 1740092416] [client 192.168.178.20:51178] AH01067: Failed to read FastCGI header
[Sat Sep 03 11:56:54.268628 2022] [proxy_fcgi:error] [pid 1199:tid 1740092416] (104)Connection reset by peer: [client 192.168.178.20:51178] AH01075: Error dispatching request to :4443:
[Sat Sep 03 11:56:54.447513 2022] [mpm_event:notice] [pid 1198:tid 1996104256] AH00491: caught SIGTERM, shutting down
[Sat Sep 03 11:57:16.431960 2022] [ssl:warn] [pid 889:tid 1993208384] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sat Sep 03 11:57:16.434439 2022] [ssl:error] [pid 889:tid 1993208384] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Sat Sep 03 11:57:16.434513 2022] [ssl:error] [pid 889:tid 1993208384] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sat Sep 03 11:57:16.515855 2022] [ssl:warn] [pid 1200:tid 1993208384] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sat Sep 03 11:57:16.516287 2022] [ssl:error] [pid 1200:tid 1993208384] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Sat Sep 03 11:57:16.516319 2022] [ssl:error] [pid 1200:tid 1993208384] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sat Sep 03 11:57:16.521391 2022] [mpm_event:notice] [pid 1200:tid 1993208384] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1n configured -- resuming normal operations
[Sat Sep 03 11:57:16.521555 2022] [core:notice] [pid 1200:tid 1993208384] AH00094: Command line: '/usr/sbin/apache2'
[Sat Sep 03 12:21:30.688501 2022] [mpm_event:notice] [pid 1200:tid 1993208384] AH00493: SIGUSR1 received.  Doing graceful restart
[Sat Sep 03 12:21:30.736133 2022] [ssl:warn] [pid 1200:tid 1993208384] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Sat Sep 03 12:21:30.736599 2022] [ssl:error] [pid 1200:tid 1993208384] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Sat Sep 03 12:21:30.736638 2022] [ssl:error] [pid 1200:tid 1993208384] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Sat Sep 03 12:21:30.738784 2022] [mpm_event:notice] [pid 1200:tid 1993208384] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1n configured -- resuming normal operations
[Sat Sep 03 12:21:30.738822 2022] [core:notice] [pid 1200:tid 1993208384] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2022-09-03 11:57:48 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-09-03 11:57:48 0 [Note] InnoDB: Number of pools: 1
2022-09-03 11:57:48 0 [Note] InnoDB: Using generic crc32 instructions
2022-09-03 11:57:48 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 1, chunk size = 128M
2022-09-03 11:57:48 0 [Note] InnoDB: Completed initialization of buffer pool
2022-09-03 11:57:48 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2022-09-03 11:57:49 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-09-03 11:57:49 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-09-03 11:57:49 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-09-03 11:57:49 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-09-03 11:57:49 0 [Note] InnoDB: 10.3.34 started; log sequence number 15738077585; transaction id 61195219
2022-09-03 11:57:49 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-09-03 11:57:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-09-03 11:57:49 0 [Note] Server socket created on IP: '127.0.0.1'.
2022-09-03 11:57:49 0 [Note] Reading of all Master_info entries succeeded
2022-09-03 11:57:49 0 [Note] Added new Master_info '' to hash table
2022-09-03 11:57:49 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.34-MariaDB-0+deb10u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Raspbian 10
2022-09-03 11:57:49 0 [Note] InnoDB: Buffer pool(s) load completed at 220903 11:57:49
2022-09-03 11:57:55 10 [Warning] Aborted connection 10 to db: 'nextcloud' user: 'ncadmin' host: 'localhost' (Got an error reading communication packets)

kmpfwrst avatar Sep 03 '22 12:09 kmpfwrst

Hi kmpfwurst,

i'm having the same Problem after My NCP Instance updated itself on saturday morning from Nextcloud Version 23.0.6.1 to 24.0.3, but ran into an problem with the not installed PHP7.4. The Rollback failed and Nextcloud remained in maintenance mode. I switched it off in the NCP Admin Panel, but i cant access my Nextcloud. Since then i'm searching for a hint or solution to get it back running.

The /var/log/ncp.log contained this:

Sat 17 Sep 06:25:03 CEST 2022 - Running /etc/cron.daily/ncp-autoupdate...
[ nc-update-nc-apps-auto ]
checking for updates...
[ncp-update-nc]
Current   Nextcloud version 23.0.6.1
Available Nextcloud version 24.0.3
Download Nextcloud 24.0.3...
Back up current instance...
check free space...
Maintenance mode enabled
backup database...
backup files...
backup /var/www//nextcloud-bkp_20220917_1663389339.tar.gz generated
Maintenance mode disabled
Install Nextcloud 24.0.3...
Fix permissions...
Upgrade...
This version of Nextcloud requires at least PHP 7.4<br/>You are currently running 7.3.31-1~deb10u1. Please update your PHP version.Abort
Clean up...
Rolling back to backup /var/www/nextcloud-bkp_20220917_1663389339-23.0.6.1.tar.gz...
check free space...
extracting backup file /var/www/nextcloud-bkp_20220917_1663389339-23.0.6.1.tar.gz...
restore files...
restore database...
ERROR 2006 (HY000) at line 697: MySQL server has gone away
Error restoring nextcloud database
Cleanup...
Rollback failed! Data left at /var/www/ncp-data.ADJT3Q

damadis avatar Sep 18 '22 13:09 damadis

Hi, sorry for the late reply. There's been a lot going on lately with the v1.50.0 release that kept me busy.

First of all: The cause for your issues will be prevented going forward by a check in the ncp-update-nc script. However, unfortunately this doesn't help you anymore.

In your case I recommend to restore the backup that has been created before the attempted update (var/www//nextcloud-bkp_20220917_1663389339.tar.gz in @damadis' case; @kmpfwrst, please check your /var/log/ncp.log for the exact path). To do so, first make sure that mariadb is running (sudo service mariadb start) and then run sudo ncp-restore /var/www/nextcloud-bkp_20220917_1663389339.tar.gz. Hopefully the restore will succeed this time

theCalcaholic avatar Sep 26 '22 20:09 theCalcaholic

@theCalcaholic Thanks for your reply. I allready restored the backup and my NC runs fine again. I deactivated the autoupdate_nc for now and wait until the problem with PHP8 in #1542 is resolved to make the upgrade to bullseye

damadis avatar Sep 27 '22 05:09 damadis

Sorry I dont get it - what excatly do you mean "the exact path". I say i cannot find the back up. ALready tried it before. Do you know how I can access my data on the external drive? If i can access it i just reinstall everything.

kmpfwrst avatar Sep 27 '22 15:09 kmpfwrst

He means that the location of your backup and the exact path where it should be located is written in the ncp.log 🙂

You should be able to access the files by connecting the drive to another Linux computer and accessing it that way. You should be able to move the files as root, it can potentially mess up the permissions a little, if that happens it's easily fixed with the chown or chmod command

ZendaiOwl avatar Sep 27 '22 16:09 ZendaiOwl

@kmpfwrst Connect to your ncp instance using ssh or by connecting a keyboard and a screen.

Check the output of sudo less /var/log/ncp.log It should contain at least one line like this:

backup /data/docker-startup-backups/nextcloud-bkp_20220928_1664409578.tar.gz generated

This file contains your configuration, database and nextcloud installation. It should also contain your data if you didn't move the data directory. If you moved the data directory, it should still be in the location you moved it to.

theCalcaholic avatar Sep 29 '22 00:09 theCalcaholic