Nextcloud not working - Service Unavailable

NethServer Version: 7.9.2009 (final)
Module: Nextcloud
when trying to access my Nextcloud I just get a error Message:

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

I want to use Nextcloud as a virtual host.
when trying to add the hostname to the let’s encrypt certificate I get also an error message.

I had nexcloud running without a problem for a while with a few users. since no one neddet it I ignored the error when the Let’s encryt certificate could not update. Looks like there something complete brocken, I tried to reinstall, did’nt work eiter.

What is the status of the rh-php73-php-fpm service? Is it running?

systemctl -l status rh-php73-php-fpm

yes it is

And mysqld?

systemctl -l status mysqld

is not working

 systemctl -l status mysqld
● mysqld.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Son 2021-03-21 12:30:03 CET; 6h ago
 Main PID: 2297 (code=exited, status=0/SUCCESS)

Mär 21 12:30:03 home2.nemenz.at systemd[1]: Starting MariaDB database server...
Mär 21 12:30:03 home2.nemenz.at mariadb-prepare-db-dir[29488]: Socket file /var/lib/mysql/mysql.sock exists.
Mär 21 12:30:03 home2.nemenz.at mariadb-prepare-db-dir[29488]: Is another MySQL daemon already running with the same unix socket?
Mär 21 12:30:03 home2.nemenz.at systemd[1]: mysqld.service: control process exited, code=exited status=1
Mär 21 12:30:03 home2.nemenz.at systemd[1]: Failed to start MariaDB database server.
Mär 21 12:30:03 home2.nemenz.at systemd[1]: Unit mysqld.service entered failed state.
Mär 21 12:30:03 home2.nemenz.at systemd[1]: mysqld.service failed.

I’m getting an Error trying to start it:

echo ‘{“action”:“start”,“name”:“mysqld”}’ | /usr/bin/setsid /usr/bin/sudo /usr/libexec/nethserver/api/system-services/update | jq
{
“id”: “1616348286”,
“type”: “EventFailed”,
“message”: “Action failed”
}

First things first. Can you give some more info about your NethServer and Nexcloud install?

  • is your server directly connected to the internet?
  • did nextcloud ever ‘work’ as expected?
  • on what (sub)domain is/should be your nextcloud accessible?
  • is the (sub)domain correctly registered in public DNS?

If there is no other service/process using the socket you can try renaming the socket file and starting the mysqld service.

lsof /var/lib/mysql/mysql.sock        # check which process is using the file (if any)
mv /var/lib/mysql/mysql.sock{,.bak}   # rename the socket file
systemctl start mysqld

there was another process mysqld running. after I killed it, now mysql is up

systemctl -l status mysqld
● mysqld.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Son 2021-03-21 22:20:28 CET; 29s ago
Process: 28047 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)
Process: 28012 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)
Main PID: 28046 (mysqld_safe)
CGroup: /system.slice/mysqld.service
├─28046 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─28224 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock

Still

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

on the nextcloud virtual host

It appears to be:

dan@Dan-MacBook-Pro-2013  ~  host nextcloud.nemenz.at
nextcloud.nemenz.at is an alias for home.nemenz.at.
home.nemenz.at has address 178.115.248.17

There should be an error logged somewhere, either in one of the Apache log files or in /var/log/messages. Without that, we’re just guessing.

1 Like

not much in the logs:

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:38:22.887336 2021] [proxy:error] [pid 14463] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:38:22.887384 2021] [proxy_fcgi:error] [pid 14463] [client 192.168.178.167:55680] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
192.168.178.167 - - [21/Mar/2021:22:38:22 +0100] “GET / HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:38:29.765996 2021] [proxy:error] [pid 18130] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:38:29.766043 2021] [proxy_fcgi:error] [pid 18130] [client 62.178.130.125:56275] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
62.178.130.125 - - [21/Mar/2021:22:38:29 +0100] “GET /status.php HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Macintosh) mirall/2.5.2git (build 20190319) (Nextcloud)”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:38:31.909988 2021] [proxy:error] [pid 23506] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:38:31.910034 2021] [proxy_fcgi:error] [pid 23506] [client 62.178.130.125:56284] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
62.178.130.125 - - [21/Mar/2021:22:38:31 +0100] “GET /ocs/v2.php/core/navigation/apps?absolute=true&format=json HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Macintosh) mirall/2.5.2git (build 20190319) (Nextcloud)”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:38:40.571605 2021] [proxy:error] [pid 14621] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:38:40.571656 2021] [proxy_fcgi:error] [pid 14621] [client 62.178.46.74:21338] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
62.178.46.74 - - [21/Mar/2021:22:38:40 +0100] “GET / HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:39:01.749952 2021] [proxy:error] [pid 14777] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:39:01.750008 2021] [proxy_fcgi:error] [pid 14777] [client 62.178.130.125:56411] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
62.178.130.125 - - [21/Mar/2021:22:39:01 +0100] “GET /status.php HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Macintosh) mirall/2.5.2git (build 20190319) (Nextcloud)”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:39:03.789122 2021] [proxy:error] [pid 14460] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:39:03.789162 2021] [proxy_fcgi:error] [pid 14460] [client 62.178.130.125:56420] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
62.178.130.125 - - [21/Mar/2021:22:39:03 +0100] “GET /ocs/v2.php/core/navigation/apps?absolute=true&format=json HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Macintosh) mirall/2.5.2git (build 20190319) (Nextcloud)”
143.244.47.191 - - [21/Mar/2021:22:39:10 +0100] “GET /index.php?/categories&lang=kn_IN HTTP/1.1” 200 18689 “-” “Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:39:33.743993 2021] [proxy:error] [pid 14623] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:39:33.744051 2021] [proxy_fcgi:error] [pid 14623] [client 62.178.130.125:56551] AH01079: failed to make connection to backend: 127.0.0.1

==> /var/log/httpd/access_log <==
62.178.130.125 - - [21/Mar/2021:22:39:33 +0100] “GET /status.php HTTP/1.1” 503 299 “-” “Mozilla/5.0 (Macintosh) mirall/2.5.2git (build 20190319) (Nextcloud)”

==> /var/log/httpd/error_log <==
[Sun Mar 21 22:39:35.774918 2021] [proxy:error] [pid 17392] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9002 (*) failed
[Sun Mar 21 22:39:35.774967 2021] [proxy_fcgi:error] [pid 17392] [client 62.178.130.125:56560] AH01079: failed to make connection to backend: 127.0.0.1

noting in messages

It seems you have an old version of Nextcloud installed where rh-php72 is used:

systemctl -l status rh-php72-php-fpm

Updating your server should solve the problem.

1 Like

systemctl -l status rh-php72-php-fpm
● rh-php72-php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/rh-php72-php-fpm.service; disabled; vendor preset: disabled)
Active: inactive (dead)

intresting. I checked the Updates earlier today, there where none. now there where 44.
Still not working…

Just to be sure, let’s check the Neth version:

cat /etc/nethserver-release

You may start the service to check if it makes Nextcloud work:

systemctl start rh-php72-php-fpm

Do you use custom templates for Nextcloud?

1 Like

cat /etc/nethserver-release
NethServer release 7.9.2009 (final)

I dont think so

After startuing the php stack, nextcloud cam up with this message:
Exception: Updates between multiple major versions and downgrades are unsupported.

See this wiki article for solving this issue.

Thanks everyone, its working again.

1 Like

after a reboot I need to start php7.2 again on the terminal. How can I start it automatical?

You can enable it with

config setprop rh-php72-php-fpm status enabled

to start automatically.

But rh-php72 shouldn’t be needed by Nextcloud in recent versions.

Let’s check the nextcloud version:

rpm -q nethserver-nextcloud

Is it nethserver-nextcloud-1.16.6-1 ?

it is

rpm -q nethserver-nextcloud
nethserver-nextcloud-1.16.6-1.ns7.noarch