Getting 503 Service Unavailable - RESOLVED?

Nextcloud version: 16.0.3.0
Operating system and version: Ubuntu 18.04LTS
Apache Version 2.4.29
PHP version 7.2.19-0ubuntu0.18.04.1

The issue you are facing:

Unable to login to either NC webpage OR Linux Client (2.5.2git).
Client gets red banner “No connection to Nextcloud at https://cloud.mydomain.org, Server replied “503 Service Unavailable” to GET “https://cloud.mydomain.org/status.php” and NC webpage just shows " Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”

My Nextcloud install is running on a 2Gb KVM vps which took some kind of an outage early this morning, and once the node came back up, this malfunction began.

Each time I hit the NC webpage at https://cloud.mydomain.org I get the following errors from /var/log/apache2/error.log

[Sun Jul 28 17:37:40.126643 2019] [proxy:error] [pid 16096] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.nextcloud.sock (*) failed
[Sun Jul 28 17:37:40.126764 2019] [proxy_fcgi:error] [pid 16096] [client xx.xx.xx.xx:35996] AH01079: failed to make connection to backend: httpd-UDS

Upon checking the /run/php directory there is nothing in it…

Not sure what got bent when the vps went down unexpectedly…
Prior to this morning, the installation was working fine…

Sometimes the sock file won’t get created, I’ve never really understood why

If you run touch /run/php/php7.2-fpm.nextcloud.sock then change the permissions to you web worker e.g chmod www-data:www-data /run/php/php7.2-fpm.nextcloud.sock it might do the trick.

Tried touching the .sock as root, then chown to www-data:www-data, and now I get the following in /var/log/apache2

[Mon Jul 29 06:44:50.533546 2019] [proxy:error] [pid 22554] (111)Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.nextcloud.sock (*) failed
[Mon Jul 29 06:44:50.533832 2019] [proxy_fcgi:error] [pid 22554] [client xx.xx.xx.xx:39454] AH01079: failed to make connection to backend: httpd-UDS

Something sure got blown up when the vps shut down uncleanly…
Help!!

Finally tracked the problem down… the php7.2-fpm.service was in a
failed state. Not sure why, and I’d rebooted the host server quite a few times and apparently that service wouldn’t start each time. But it is running now (for how long I don’t know) and NC is working… fingers crossed…

Thanks!!

1 Like

Thanks for this post @Dave_Frandin, it helped me a lot.

I have Nextcloud Pi running Nextcloud 24.0.6 in a raspberry 4, and after a power loss, I was also receiving 503 - Service Unavailable. No matter how many times I rebooted, the problem persisted.

After ssh’ng into the raspberry, I followed your solution and fixed it by:

$ sudo systemctl stop php8.1-fpm.service
$ sudo systemctl disable php8.1-fpm.service
$ sudo systemctl enable php8.1-fpm.service
$ sudo systemctl start php8.1-fpm.service

Sorry for reviving such an old thread; it’s for future reference, if more people end up with this problem. This thread was the second result on google, searching for “nextcloud 503 service unavailable”.

1 Like