"Nextcloud is currently down" after upgrading PHP

Support form info added below, as much as possible:

Support form:

system information

Running nc-info from SSH returns (personal info manually deleted):

NextcloudPi version v1.52.4
NextcloudPi image NextCloudPi_08-02-19
OS Armbian 23.8.1 bullseye \l . 4.14.133-odroidxu4 (armv7l)
automount yes
USB devices sda
datadir /media/USBdrive/ncdata
data in SD no
data filesystem btrfs
data disk usage 6.9T/11T
rootfs usage 5.1G/29G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check error
HTTPD service up
PHP service up
MariaDB service up
Redis service up
HPB service down
Postfix service up
Internet check ok
Public IPv4 (deleted)
Public IPv6 not found
Port 80 open
Port 443 open
IP 192.168.1.202
Gateway 192.168.1.1
Interface (deleted)
Certificates (deleted)
NAT loopback no
Uptime 16min

  • if you have systeminfo app installed you will find the required data on https://{your nextcloud}/settings/admin/serverinfo
  • collect anonymized system report using https://{your nextcloud}/settings/admin/support
Nextcloud version (eg, 26.0.1): 26.0.8

|Operating system and version (eg, Ubuntu 22.04):Armbian 23.8.1 bullseye \l . 4.14.133-odroidxu4 (armv7l)

|Apache or nginx version (eg, Apache 2.4.25): Unknown. I ran command “apache2 --version” (found command in a forum post), but it returned: [Sun Nov 05 14:48:56.553017 2023] [core:warn] [pid 10623] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

|Database (sqlite or MariaDB or Postgres): mysql, though system info also shows MariaDB Service running

|Docker (compose)||
|Snap||
|Is this the first time you’ve seen this error? Yes

The issue you are facing:

  • Steps to replicate it:
  1. Start system
  2. Open browser and navigate to what should be NCP web UI, and Nextcloud UI, and find both inoperable.
  • The output of your Nextcloud log in Admin > Logging:

(Unable to generate log because web UI is not functional. If there is a way to do so through SSH, please advise)

  • The output of your config.php file in /path/to/nextcloud**
    (use https://.../settings/admin/support which auto-removes identifying information!):
    (Unable due to web UI non-functional. If there is a way through SSH, please advise)

* The output of your Apache/nginx/system log in `/var/log/____`: (Unable due to web UI non-functional. If there is a way through SSH, please advise)

* errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors.
(Unable due to web UI non-functional. If there is a way through SSH, please advise)

Hardware: Odroid-HC2
NextcloudPi: 1.52.4

Hi, everyone. I did some updates this week to get my NC up to the most current version possible. I got Nextcloud 25 running after running a workaround I found on the forum here, making it at least workable with a 32-bit system. I had settled on running NC 25 until I found a 64-bit system, but then read that version 26 and beyond were 32-bit compatible.

I tried updating to version 26, but got the error that it wasn’t compatible with the PHP I was running (7.4, I think), and needed PHP 8 or beyond. The system undid the update and reverted back to version 25.

I then updated PHP following this guide: https://git.mdns.eu/nextcloud/passwords/-/wikis/Administrators/Guides/NextcloudPi/Upgrade-to-PHP-8.0 After completing, I then re-tried updating to Nextcloud 26. I got the error “Nextcloud is currently down” and was unable to proceed. At some point, I also got an error saying that “This version of Nextcloud is not compatible with PHP>=8.2. You are currently running 8.2.12.Abort” I have been unable to reproduce that message, though.

Now I am unable to proceed. My Nextcloudpi admin web UI appears to be a scrambled version of the “first activation” page and is no longer usable. I can log in through SSH only.

I’d appreciate any help. I am a bit of a Linux noob, so for any recommendations that require a command be run, please include the command text. Thanks!

You could try installing 8.1 instead

OK, thanks. How would I do that? I don’t know how to revert back to a lower version. I thought, based on the code, that I was installing 8.0 anyway, but ended up with a higher version.

After several hours of searching, I found an old post recommending this command to manually select the PHP version running:

sudo update-alternatives --config php

I was able to select PHP 8.0. I was then able to run the upgrade from NC 25 to 26. The update completed with no errors, but Nextcloud is still not working. The Nextcloudpi page is mostly HTML code, the Nextcloud logo, and a First Run wizard button.

The Nextcloud page is just code as seen here: https://pastebin.com/0ya75Pfz

Any suggestions appreciated - please be detailed (noob here). Thanks.

That is confusing, because that is the exact process described in your original instructions you linked. Still, the whole update process should have been managed through ncp itself rather than the manual method you are using, which afaik is outside the documentation recommendtions of docs.nextcloudpi.com :person_shrugging:

If it doesn’t, you should use update-alternatives --config php and set PHP 8.0 as default

Please fill out our support template. Here:

Hi @Skyhooker,
You are missing the required support template. Please fill this form out and edit into your post. You can also check the output of ncp-report.

This will give us the technical info and logs needed to help you! Thanks.

Hi, just, and thank you.

As I was going through the instructions on that page I linked, I got to the PHP version check, “php -v,” saw that it was 8.0 or above, and then skipped the next part of that section because it didn’t seem to be needed, and never read the code. I really wish I had, because it might have saved me about 3 hours of searching.

I had tried doing the whole update process through the NCP panel, but the update failed at the end because it was still on PHP 7.4, I believe, and then the process reversed itself and restored itself from the backup. I did not find any control within the NCP panel to upgrade the PHP version, so that’s what led me “off the path” from NCP.

I will fill out the form you linked and add it later this morning. Thanks again!

EDIT: Looking at the support form, much of this is going to be difficult because the NCP web panel is no longer functional. I will see how much I can get from the SSH control panel - please advise if there are ways to get the same information through SSH. Thanks.

Support form filled out above, as much as possible. Output of ncp-report in link below. Thank you!

ncp-report output

UPDATE: I re-ran the steps from the Upgrade PHP page I linked above for “Setup Apache” and restarted. Now everything seems to be working - the NCP admin console web UI is up, and Nextcloud is working. The only errors showing are:

Nextcloud check: error
HPB service: down

HPB does not seem to be critical, so let me know if further work needs to be done. Thanks!

UPDATE 2: Seems all is still not good. I ran nc-update-nc-apps from SSH and it returned the following:

Running nc-update-nc-apps
/usr/local/etc/library.sh: line 300: echo: write error: No space left on device
An unhandled exception has been thrown:
tee: /var/log/ncp.log: No space left on device
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(184): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(976): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(734): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1115): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2074): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(120): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(468): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1476): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(629): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1171): OC::init()
#38 /var/www/nextcloud/console.php(48): require_once(‘…’)
#39 /var/www/nextcloud/occ(11): require_once(‘…’)
#40 {main}/usr/local/etc/library.sh: line 321: echo: write error: No space left on device

Your disk is out of space.

It’s not that - it’s a 32GB SD card, with less than 6GB used. I think there must be some upper limit on some of these file sizes, such as logs. I have seen that several times in the last few days, with various files that were trying to be written to, but I don’t know what can be safely deleted.

EDIT: I just checked that library.sh file that said no space left - it’s only 17kb!

I’m now able to get to the nextcloudpi web UI. I found this on the Administration overview page:

There are some errors regarding your setup.

** It was not possible to execute the cron job via CLI. The following technical errors have appeared:**
** Your data directory is invalid. Ensure there is a file called “.ocdata” in the root of the data directory.**
** Cannot create “data” directory. This can usually be fixed by giving the web server write access to the root directory. See Introduction — Nextcloud latest Administration Manual latest documentation**

The page linked redirected to the home page of the admin guide, not to a particular page about this issue. I was unable to find such a page in the admin guide.

Not sure how to accomplish the steps to clear this up (noob, as I said). Thanks.