Nextcloud Internal server error after reboot

Nextcloud version: 20.0.4
Operating system and version: Linux raspberrypi 5.4.83-v7l+
Apache or nginx version: nginx/1.14.2
PHP version : PHP 7.3.19-1~deb10u1

I installed Nextcloud with the install script, and it worked fine until I restarted my pi. It told me that there is an “Internal server error”. After I reinstalled Nextcloud it still said the same thing. Also my nginx doesnt start, it says it failed with an exit code.

The config.php file is empty.

Hi,

If your nginx doesn’t start then maybe first look into this issue? What does nginx -t tell you?

Simon

nginx is working fine, I just had the apache service simultaneously running, which appaerantly doesnt work. I shut down apache and started nginx, but now it just says that no connection can be established.

If no connection can be established the webserver does not seem to be reached, so to me it looks like there either still is an issue with your nginx setup - or the PHP-FPM server cannot be reached.

What’s in your nginx access and error logs (probably in /var/log/nginx/)

Access log:

cat access.log
192.168.2.145 - - [31/Jan/2021:16:39:29 +0100] "\x16\x03\x01\x01\xFC\x01\x00\x01\xF8\x03\x03\xAA\xC7h\xB2\xF9w\xA9\xAA\x00\xD8\xA4d\xB2\xA7!\x9D\x13\x01\x0B\xB6\xE4\xB3\x80_\xE2V5_\x15\xF4\xC0\xB7 \x04\xCB3\xE5\xDEU\xFE\xA8\xA8\x80$\x88:\xE1\x02\x9F\xB2\xB3\xBEtX\x0B\x8B\xEA\xCC\x22W\xB6\xCB\xBF\x7F6\x00$\x13\x01\x13\x03\x13\x02\xC0+\xC0/\xCC\xA9\xCC\xA8\xC0,\xC00\xC0" 400 173 "-" "-"
192.168.2.145 - - [31/Jan/2021:16:51:13 +0100] "GET / HTTP/1.1" 200 13 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
192.168.2.145 - - [31/Jan/2021:16:51:13 +0100] "GET /favicon.ico HTTP/1.1" 404 143 "http://192.168.2.137/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
192.168.2.145 - - [31/Jan/2021:16:54:11 +0100] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
184.105.247.194 - - [31/Jan/2021:17:14:53 +0100] "GET / HTTP/1.1" 200 13 "-" "-"

Error log:

cat error.log
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:39:36 [emerg] 12933#12933: still could not bind()
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 15:40:00 [emerg] 12990#12990: still could not bind()
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to 0.0.0.0:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: bind() to [::]:80 failed (98: Address already in use)
2021/01/31 16:36:07 [emerg] 14614#14614: still could not bind()
2021/01/31 16:57:17 [notice] 23993#23993: using inherited sockets from "6;7;"

Yeah, that’s what I had thought. Despite stopping Apache the relevant ports are still blocked.

Make sure to deactivate Apache (or uninstall it completely if not used anyway) and reboot.

I did that but the problem still persists.

The logs clearly stated that nginx tries to listen on http ports but they are already blocked by another application - so you need to find out who that is and stop it.

Try e.g.

$ sudo netstat -tnlp | grep :80

Well, that outputs nothing.

Okay, I’m sorry I can’t help - but with single-line responses I really don’t have enough information.

Im sorry, but what else can I say? I also tried other commands to see what is using port 80. I also deleted the error log so it can create a new one, which it did. That new error log is empty.

See, that’s already helpful.

Now you should also see entries pulling up in the access log once you try to access the server. Is the PHP-FPM service running and can nginx access it?