NextCloudPi/NextCloudPlus Internal Server Error

NextCloudPi/NextCloudPlus Internal Server Error
NextCloudPi version v1.35.0
NextCloudPi image NextCloudPlus_04-21-18
distribution Raspbian GNU/Linux 9 \n \l
automount yes
USB devices sda
datadir /media/USBdrive/ncdata
data in SD no
data filesystem btrfs
data disk usage 159G/3.7T
rootfs usage 2.5G/118G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check ok
Nextcloud version 20.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 192.168.0.153
gateway 192.168.0.1
interface wlan0
certificates mydomain.com
NAT loopback no
uptime 1:24

The issue you are facing:
Hi, My NexCloudPi/NextCloudPlus is suddenly showing Internal Server 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.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Corrupted Auto Upgrade or
  2. Corrupted RaspberryPi hardware

/var/log/ncp.log:

[ nc-limits ] (Sat 27 Feb 05:17:29 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ nc-limits ] (Sat 27 Feb 05:17:29 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ncp-update-nc]
Cannot load Zend OPcache - it was already loaded
Current   Nextcloud version 20.0.4.0
Available Nextcloud version 20.0.4
Nothing to update

[ncp-update-nc]
Cannot load Zend OPcache - it was already loaded
Current   Nextcloud version 20.0.4.0
Available Nextcloud version 20.0.4
Nothing to update

[ nc-limits ] (Sun 28 Feb 12:35:15 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ unattended-upgrades ] (Mon  1 Mar 06:25:30 UTC 2021)
Unattended upgrades active: yes (autoreboot true)

[ nc-autoupdate-nc ] (Mon  1 Mar 06:25:31 UTC 2021)
automatic Nextcloud updates enabled

[ncp-update-nc]
Cannot load Zend OPcache - it was already loaded
Current   Nextcloud version 20.0.4.0
Available Nextcloud version 20.0.8
Download Nextcloud 20.0.8...
Back up current instance...
Cannot load Zend OPcache - it was already loaded
check free space...
Cannot load Zend OPcache - it was already loaded
Maintenance mode enabled
backup database...
backup files...
backup /var/www//nextcloud-bkp_20210301_1614581841.tar.gz generated
Cannot load Zend OPcache - it was already loaded
Maintenance mode disabled
Install Nextcloud 20.0.8...
Fix permissions...
Upgrade...
Cannot load Zend OPcache - it was already loaded
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Disabled incompatible app: contacts
Disabled incompatible app: news
Disabled incompatible app: notes
Updating <files_sharing> ...
Updated <files_sharing> to 1.12.2
Updating <photos> ...
Updated <photos> to 1.2.3
Checking for update of app accessibility in appstore
Checked for update of app "accessibility" in appstore
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore
Checking for update of app cloud_federation_api in appstore
Checked for update of app "cloud_federation_api" in appstore
Checking for update of app comments in appstore
Checked for update of app "comments" in appstore
Checking for update of app contactsinteraction in appstore
Checked for update of app "contactsinteraction" in appstore
Checking for update of app dashboard in appstore
Checked for update of app "dashboard" in appstore
Checking for update of app dav in appstore
Checked for update of app "dav" in appstore
Checking for update of app federatedfilesharing in appstore
Checked for update of app "federatedfilesharing" in appstore
Checking for update of app federation in appstore
Checked for update of app "federation" in appstore
Checking for update of app files in appstore
Checked for update of app "files" in appstore
Checking for update of app files_pdfviewer in appstore
Checked for update of app "files_pdfviewer" in appstore
Checking for update of app files_rightclick in appstore
Checked for update of app "files_rightclick" in appstore
Checking for update of app files_sharing in appstore
Checked for update of app "files_sharing" in appstore
Checking for update of app files_trashbin in appstore
Checked for update of app "files_trashbin" in appstore
Checking for update of app files_versions in appstore
Checked for update of app "files_versions" in appstore
Checking for update of app files_videoplayer in appstore
Checked for update of app "files_videoplayer" in appstore
Checking for update of app firstrunwizard in appstore
Checked for update of app "firstrunwizard" in appstore
Checking for update of app logreader in appstore
Checked for update of app "logreader" in appstore
Checking for update of app lookup_server_connector in appstore
Checked for update of app "lookup_server_connector" in appstore
Checking for update of app nextcloud_announcements in appstore
Checked for update of app "nextcloud_announcements" in appstore
Checking for update of app notifications in appstore
Checked for update of app "notifications" in appstore
Checking for update of app oauth2 in appstore
Checked for update of app "oauth2" in appstore
Checking for update of app password_policy in appstore
Checked for update of app "password_policy" in appstore
Checking for update of app photos in appstore
Checked for update of app "photos" in appstore
Checking for update of app previewgenerator in appstore
Update app previewgenerator from appstore
Checked for update of app "previewgenerator" in appstore
Checking for update of app privacy in appstore
Checked for update of app "privacy" in appstore
Checking for update of app provisioning_api in appstore
Checked for update of app "provisioning_api" in appstore
Checking for update of app recommendations in appstore
Checked for update of app "recommendations" in appstore
Checking for update of app serverinfo in appstore
Checked for update of app "serverinfo" in appstore
Checking for update of app settings in appstore
Checked for update of app "settings" in appstore
Checking for update of app sharebymail in appstore
Checked for update of app "sharebymail" in appstore
Checking for update of app support in appstore
Checked for update of app "support" in appstore
Checking for update of app survey_client in appstore
Checked for update of app "survey_client" in appstore
Checking for update of app systemtags in appstore
Checked for update of app "systemtags" in appstore
Checking for update of app text in appstore
Checked for update of app "text" in appstore
Checking for update of app theming in appstore
Checked for update of app "theming" in appstore
Checking for update of app twofactor_backupcodes in appstore
Checked for update of app "twofactor_backupcodes" in appstore
Checking for update of app updatenotification in appstore
Checked for update of app "updatenotification" in appstore
Checking for update of app user_status in appstore
Checked for update of app "user_status" in appstore
Checking for update of app viewer in appstore
Checked for update of app "viewer" in appstore
Checking for update of app weather_status in appstore
Checked for update of app "weather_status" in appstore
Checking for update of app workflowengine in appstore
Checked for update of app "workflowengine" in appstore
Checking for update of app contacts in appstore
Checked for update of app "contacts" in appstore
Checking for update of app news in appstore
Checked for update of app "news" in appstore
Checking for update of app notes in appstore
Checked for update of app "notes" in appstore
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Check indices of the share table.
Check indices of the filecache table.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Done.
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Check columns of the comments table.
Done.
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Check primary keys.
Done.
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
Following columns will be updated:

* files_trash.auto_id

This can take up to hours, depending on the number of files in your instance!
Backup stored at /media/USBdrive/ncdata/ncp-update-backups/nextcloud-bkp_20210301_1614581841-20.0.4.0.tar.gz
Clean up...

[ncp-update-nc]
Cannot load Zend OPcache - it was already loaded
Current   Nextcloud version 20.0.8.1
Available Nextcloud version 20.0.8
Nothing to update

[ nc-limits ] (Wed  3 Mar 01:30:32 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ncp-update-nc]
Cannot load Zend OPcache - it was already loaded
Current   Nextcloud version 20.0.8.1
Available Nextcloud version 20.0.8
Nothing to update

[ nc-limits ] (Wed 10 Mar 04:17:29 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ nc-limits ] (Wed 10 Mar 04:58:37 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ nc-limits ] (Wed 10 Mar 05:17:28 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ nc-limits ] (Wed 10 Mar 09:34:45 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

[ nc-limits ] (Wed 10 Mar 12:30:02 UTC 2021)
Using 6 PHP threads
Using 192434176 memory for the database

What happened;

  1. Power failure at 27 Feb 2021
  2. AutoUpdate at 1 Mar 2021

What I already tried;

  1. Rebooted and noticed device unreachable every minute
  2. I cloned the SD card and used the new SD card to see if it is a bad SD card, same error, same ping up then down.
  3. Used the clone SD card on spare RaspberryPi, same error ‘Internal Server Error’, ping is stable and up.
  4. Tried to restore March 1 from nc-update-backups, same error ‘Internal Server Error’

Please help…

I think these backups only include the nextcloud files but not the ncp files. Id suggest you download latest ncp image, flash it to the second sdcard, initialize your new instance and then restore the backup from nc-update-backups again.

2 Likes

Thank you so much! I was hoping to avoid that, but that worked! May I also get your recommendation on how you backup the ncp files?

Should upgrade to 10, upgrade or do fresh install and restore from backup.

facing a simular problem with an nc instance on a shared hoster. Is flushing the system, reinstall, and init form backup best practice on this matter?

I dont backup the ncp instance itself anymore, also the settings backup is actually pointless, because it makes changes on the system when done, when you restore the settings i have experienced thst all changes need to be done again anyway (like setup the auto backups, cert renewal and other stuff) because the restore does not restore cron jobs and other stuff which has to be done again anyway