NextcloudPi: Nextcloud not running after changing SD card

Hi guys and girls,

unfortunately my sd card of my raspberry pi in my nextcloudbox failed. For 2 days I am trying to get it working again. I have downloaded a new image and restored (without data) nextcloud with nc-restore. Then I also restored NCP but this failed because the backup was too old. Then I copied all data back to the datafolder and rescanned everything and had some problems with letsencrypt. Then I was kind of desperate and tried some things without exactly knowing what I doing. Anyhow now I am stuck. When I try to connect to the homepage I get this:

@author Joas Schilling * @author Jörn Friedrich Dreyer * @author Lukas Reschke * @author Morris Jobke * @author Robin Appelman * @author Sergio Bertolín * @author Thomas Müller * @author Vincent Petry * * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * */ require_once DIR . ‘/lib/versioncheck.php’; try { require_once DIR . ‘/lib/base.php’; OC::handleRequest(); } catch(\OC\ServiceUnavailableException $ex) { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); //show the user a detailed error page OC_Template::printExceptionErrorPage($ex, 503); } catch (\OC\HintException $ex) { try { OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503); } catch (Exception $ex2) { try { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); \OC::$server->getLogger()->logException($ex2, array(‘app’ => ‘index’)); } catch (Throwable $e) { // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here } //show the user a detailed error page OC_Template::printExceptionErrorPage($ex, 500); } } catch (\OC\User\LoginException $ex) { OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403); } catch (Exception $ex) { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); //show the user a detailed error page OC_Template::printExceptionErrorPage($ex, 500); } catch (Error $ex) { try { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); } catch (Error $e) { http_response_code(500); header(‘Content-Type: text/plain; charset=utf-8’); print(“Internal Server Error\n\n”); print(“The server encountered an internal error and was unable to complete your request.\n”); print(“Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n”); print(“More details can be found in the webserver log.\n”); throw $ex; } OC_Template::printExceptionErrorPage($ex, 500); }

NCP-report shows
<–! Paste this in GitHub report -->

NextCloudPi diagnostics

Cannot load Zend OPcache - it was already loaded
NextCloudPi version  v1.8.0
NextCloudPi image    NextCloudPi_01-14-19
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda
datadir              /media/drive/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      118G/932G
rootfs usage         2.2G/15G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    15.0.4.0
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            wlan0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               4:44

Nextcloud configuration

Cannot load Zend OPcache - it was already loaded
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "1": "192.168.1.115",
            "5": "nextcloudpi.local",

        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/XXXXX,
        "dbtype": "mysql",
        "version": "15.0.4.0",
        "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***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "maintenance": false,
        "mail_smtpsecure": "tls",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": "2",
        "updater.release.channel": "stable",
        "logfile": "\/media\/drive\/ncdata\/nextcloud.log",
        "log_type": "file",
        "htaccess.RewriteBase": "\/",
        "data-fingerprint": "9384b224e1eef2210aca032dbee289d9"
    }
}

HTTPd logs

[Tue Feb 26 19:00:39.178676 2019] [ssl:error] [pid 5324:tid 1996259568] 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]
[Tue Feb 26 19:00:39.178693 2019] [ssl:error] [pid 5324:tid 1996259568] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Tue Feb 26 19:00:40.097055 2019] [ssl:warn] [pid 5328:tid 1996259568] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Feb 26 19:00:40.097691 2019] [ssl:error] [pid 5328:tid 1996259568] 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]
[Tue Feb 26 19:00:40.097723 2019] [ssl:error] [pid 5328:tid 1996259568] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Tue Feb 26 19:00:41.006084 2019] [mpm_event:notice] [pid 5328:tid 1996259568] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2q configured -- resuming normal operations
[Tue Feb 26 19:00:41.006333 2019] [core:notice] [pid 5328:tid 1996259568] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 26 19:01:16.408096 2019] [mpm_event:notice] [pid 5328:tid 1996259568] AH00491: caught SIGTERM, shutting down
[Tue Feb 26 19:01:16.583942 2019] [ssl:warn] [pid 5505:tid 1995616496] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Feb 26 19:01:16.584403 2019] [ssl:error] [pid 5505:tid 1995616496] 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]
[Tue Feb 26 19:01:16.584422 2019] [ssl:error] [pid 5505:tid 1995616496] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Tue Feb 26 19:01:17.084233 2019] [ssl:warn] [pid 5507:tid 1995616496] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Feb 26 19:01:17.084925 2019] [ssl:error] [pid 5507:tid 1995616496] 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]
[Tue Feb 26 19:01:17.084962 2019] [ssl:error] [pid 5507:tid 1995616496] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Tue Feb 26 19:01:18.006013 2019] [mpm_event:notice] [pid 5507:tid 1995616496] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2q configured -- resuming normal operations
[Tue Feb 26 19:01:18.006248 2019] [core:notice] [pid 5507:tid 1995616496] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 26 19:02:07.989282 2019] [authz_host:error] [pid 5508:tid 1664087088] [client 176.32.33.80:52824] AH01753: access check of 'localhost' to /recordings/ failed, reason: unable to get the remote host name
[Tue Feb 26 19:02:07.989378 2019] [authz_core:error] [pid 5508:tid 1664087088] [client 176.32.33.80:52824] AH01630: client denied by server configuration: /var/www/ncp-web/recordings
[Tue Feb 26 19:03:10.102961 2019] [authz_host:error] [pid 5508:tid 1630516272] [client 176.32.33.80:33950] AH01753: access check of 'localhost' to /recordings/ failed, reason: unable to get the remote host name
[Tue Feb 26 19:03:10.103090 2019] [authz_core:error] [pid 5508:tid 1630516272] [client 176.32.33.80:33950] AH01630: client denied by server configuration: /var/www/ncp-web/recordings

Database logs

2019-02-26 14:22:31 1996320560 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

2019-02-26 14:22:31 1996320560 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-02-26 14:22:31 1996320560 [Note] InnoDB: The InnoDB memory heap is disabled
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-02-26 14:22:31 1996320560 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Using Linux native AIO
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Using generic crc32 instructions
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Completed initialization of buffer pool
2019-02-26 14:22:31 1996320560 [Note] InnoDB: Highest supported file format is Barracuda.
2019-02-26 14:22:32 1996320560 [Note] InnoDB: 128 rollback segment(s) are active.
2019-02-26 14:22:32 1996320560 [Note] InnoDB: Waiting for purge to start
2019-02-26 14:22:32 1996320560 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.41-84.1 started; log sequence number 452476211
2019-02-26 14:22:32 1379922752 [Note] InnoDB: Dumping buffer pool(s) not yet started
2019-02-26 14:22:32 1996320560 [Note] Plugin 'FEEDBACK' is disabled.
2019-02-26 14:22:32 1996320560 [Note] Server socket created on IP: '127.0.0.1'.
2019-02-26 14:22:32 1996320560 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.37-MariaDB-0+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Raspbian 9.0

Nextcloud logs

{"reqId":"KgjhceS7wIrSUgTSh9l6","level":3,"time":"2019-02-26T12:45:21+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_get_contents(\/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#216","userAgent":"--","version":"15.0.4.0"}
{"reqId":"KgjhceS7wIrSUgTSh9l6","level":3,"time":"2019-02-26T12:45:21+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"stat(): stat failed for \/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#142","userAgent":"--","version":"15.0.4.0"}
{"reqId":"KgjhceS7wIrSUgTSh9l6","level":3,"time":"2019-02-26T12:45:21+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"filesize(): stat failed for \/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json at \/var\/www\/nextcloud\/lib\/private\/LargeFileHelper.php#171","userAgent":"--","version":"15.0.4.0"}
{"reqId":"KgjhceS7wIrSUgTSh9l6","level":3,"time":"2019-02-26T12:45:26+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_put_contents(\/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#220","userAgent":"--","version":"15.0.4.0"}
{"reqId":"kLZGiCWMFlU1wfbXtINk","level":3,"time":"2019-02-26T13:45:22+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_get_contents(\/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#216","userAgent":"--","version":"15.0.4.0"}
{"reqId":"kLZGiCWMFlU1wfbXtINk","level":3,"time":"2019-02-26T13:45:22+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"stat(): stat failed for \/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#142","userAgent":"--","version":"15.0.4.0"}
{"reqId":"kLZGiCWMFlU1wfbXtINk","level":3,"time":"2019-02-26T13:45:22+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"filesize(): stat failed for \/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json at \/var\/www\/nextcloud\/lib\/private\/LargeFileHelper.php#171","userAgent":"--","version":"15.0.4.0"}
{"reqId":"kLZGiCWMFlU1wfbXtINk","level":3,"time":"2019-02-26T13:45:24+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_put_contents(\/media\/drive\/ncdata\/appdata_oc6ato6252xl\/appstore\/apps.json): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#220","userAgent":"--","version":"15.0.4.0"}
{"reqId":"XHV5wn8AAQEAAEztn-YAAAAE","level":2,"time":"2019-02-26T17:39:15+00:00","remoteAddr":"145.129.117.13","user":"--","app":"core","method":"PROPFIND","url":"\/remote.php\/dav\/files\/Josien\/","message":"Login failed: 'Josien' (Remote IP: '145.129.117.13')","userAgent":"Mozilla\/5.0 (Windows) mirall\/2.3.3 (build 1) (Nextcloud)","version":"15.0.4.0"}

Somehow issue got solved, I think I forgot to execute below command:
systemctl reload apache2

1 Like

Thanks for reporting!
Glad you got it up and running :wink: