After php Update: Service not available

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 20.0.14
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.4): 7.4.27

The issue you are facing:

I decided to update my nextcloud instance (running for long time - sinf version 12 i guess) from version 19.x to the most actual one.
First step, was to newest version 19 → success (via web-gui)
Second: Update from version 19 to 20.0.14 - success, but some warning regarding indexes and so on - I fixed them by execute the suggested occ commands. Also warning about php version 7.2 - that nextcloud 20 is the last version, that support this. Also one warning regarding one file, that has wrong hash (mimetypelist.js)
No more update were available from GUI - so I started to update php to version 7.4
After several steps, I saw that php 8.x is installed - everything worked, but still warning of “old version 7.2 in update screen”. I order to get also version 21, I moved on:
I did the mistake I think: I removed all php 7.x versions. After that nothing worked anymore.
Webseite shows: Service unavailable.

I reinstalled php version 7.4 . x

sudo apt-get install php7.4-mysql php7.4-curl php7.4-zip php7.4-mbstring php7.4-gd php7.4-intl

I also uninstalled php version 8.x

I am not a linux pro - I like nextcloud a lot, but this time I did something wrong, and I even dont know , into which logs I have to look into.
Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

Not accessible - because no GUI available

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


<?php
$CONFIG = array (
  'passwordsalt' => 'xxxx',
  'secret' => 'xxxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'xxx-mylocalip-xxx',
    2 => 'xxx-mydomain-xxx',
  ),
  'datadirectory' => '/mnt/ncdata',
  'overwrite.cli.url' => 'https://xxx-mydomain-xxx',
  'dbtype' => 'pgsql',
  'version' => '20.0.14.2',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'xxx',
  'mail_smtpmode' => 'smtp',
  'log_rotate_size' => '10485760',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'xxx',
  ),
  'htaccess.RewriteBase' => '/',
  'maintenance' => false,
  'updater.release.channel' => 'beta',
  'theme' => '',
  'loglevel' => 2,
  'cache_chunk_gc_ttl' => 10800,
  'trashbin_retention_obligation' => 'auto',
  'updater.secret' => 'xxx',
);

The output of your Apache/nginx/system log in /var/log/____ This errors were there before also!:

[Wed Feb 02 13:23:53.987442 2022] [proxy:error] [pid 2175] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.nextcloud.sock (*) failed
[Wed Feb 02 13:23:53.987480 2022] [proxy_fcgi:error] [pid 2175] [client xxx:52030] AH01079: failed to make connection to backend: httpd-UDS
[Wed Feb 02 13:24:23.955661 2022] [proxy:error] [pid 7639] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.nextcloud.sock (*) failed
[Wed Feb 02 13:24:23.956237 2022] [proxy_fcgi:error] [pid 7639] [client xxx:52035] AH01079: failed to make connection to backend: httpd-UDS
[Wed Feb 02 13:24:23.964450 2022] [proxy:error] [pid 2184] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.nextcloud.sock (*) failed
[Wed Feb 02 13:24:23.964486 2022] [proxy_fcgi:error] [pid 2184] [client xxx:52036] AH01079: failed to make connection to backend: httpd-UDS

So what I see from the messages from /var/log is that you have a socket pointing to a PHP 7.2 location while you have installed PHP 7.4. Thus this may be already a good pointer to start.

The easiest thing I would try is that you try to replace in your configuration all PHP 7.2 with PHP 7.4 mentions. I bet that this is also the reason why PHP 8.x did not work for you.

Can you tell me, in which config you mean?

I got it:

  • copy nextcloud.conf from /etc/php/7.2/fpm/pool.d to /etc/php/7.4/fpm/pool.d
  • replaced all 7.2 with 7.4 in this new nextcloud.conf
  • replaced 7.2 with 7.4 in /etc/apache2/sites-available/
  • installed missing packets:
    apt install php-redis
    apt install php-apcu
    apt-get install php7.4-redis
    apt-get install php7.4-apcu
  • restart php: systemctl restart php7.4-fpm.service
  • restart apache: systemctl apache2 restart

Thats it - at least for the php-error.
GUI is working again!