I don’t know if this helps find the root cause (I’m just digging around):
root@behome:/var/www/nextcloud# sudo -u www-data php occ status
An unhandled exception has been thrown:
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:139
root@behome:/var/www/nextcloud# sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-02-09 01:13:21 UTC; 1h 12min ago
root@behome:/var/www/nextcloud# sudo mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.6.11-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
MariaDB [(none)]> SELECT host, user FROM mysql.user;
+-----------+-------------+
| Host | User |
+-----------+-------------+
| localhost | behome |
| localhost | mariadb.sys |
| localhost | root |
+-----------+-------------+
3 rows in set (0.002 sec)
root@behome:/var/www/nextcloud# mysql -u behome -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 41
Server version: 10.6.11-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
…but I’ve still got “Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”
Get these in my /var/log/apache2/nextcloud.error about every 30 sec or so.
[Thu Feb 09 06:12:31.171072 2023] [proxy_fcgi:error] [pid 1537] [client 192.168.1.10:60245] AH01079: failed to make connection to backend: httpd-UDS
[Thu Feb 09 06:12:33.482561 2023] [proxy:error] [pid 1536] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.4-fpm.sock (*) failed
I only have PHP 8.1 installed
behome@behome:/var/log/apache2$ sudo update-alternatives --config php
There is only one alternative in link group php (providing /usr/bin/php): /usr/bin/php8.1
Any hints on which config file is still configured to 7.4?
Thanks - there was no reference to " :/var/run/php/php7.4-fpm -http.sock" or similar in any of the config files in either directory.
I did a search for “php7.4-fpm” and did find two entries in var/www/nextcloud/core/doc/admin/installation/nginx.html which I then changed to 8.1
Now my error log says [proxy:error] [pid 76604] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php8.1-fpm.sock (*) failed
Have you tried to stop and disable php7.4, remove all php7.4 packages. Install php8.1 with all your packages, then start and enable the service (php8.1-fpm.service) .
Make sure php7.4 mod is disabled and php8.1 is enabled in Apache2.
I had this issue as well, the fix for me in the end after making sure everything was installed correctly and the /run/php directory existed with .sock files was to make sure that in the /etc/php/8.1/fpm/pool.d/www.conf file the listen line stated the correct .sock file name. In my case it was php8.1-fpm.nextcloud.sock. after changing that and restarting php8.1-fpm.service the socket was created and everything started working again.
in order to get it to use php8.1-fpm.nextcloud.sock and not php7.4-fpm.nextcloud.sock I needed to edit the /etc/apache2/sites-enabled/ files and set the correct entry for the PHP sock.
After all that I also had realized part of my problem was the PHP8.1-fpm default config uses php8.1-fpm.sock and my nextcloud for some reason was configured with php8.1-fpm.nextcloud.sock. I’ve since removed the mention of ‘nextcloud’ from the php8.1-fpm.sock file name to prevent that issue for happening again in future updates.