NGiNX stops running

I am having an issue that NGiNX will stop running for no particular reason this causes Nextcloud to lose connection with Onlyoffice document server.

nginx version: nginx/1.18.0 (Ubuntu)

systemctl status:

● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
     Active: failed (Result: core-dump) since Thu 2021-11-04 00:00:26 UTC; 12h ago
       Docs: man:nginx(8)
    Process: 201 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 239 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 341961 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=0/SUCCESS)
   Main PID: 265 (code=dumped, signal=SEGV)
      Tasks: 0 (limit: 38351)
     Memory: 20.8M
     CGroup: /system.slice/nginx.service

Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187951 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187952 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187953 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187927 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187949 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187950 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187951 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187952 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Killing process 187953 (nginx) with signal SIGKILL.
Nov 04 00:00:26 onlyoffice systemd[1]: nginx.service: Failed with result 'core-dump'.

error.log

2021/11/04 12:28:36 [info] 422964#422964: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2021/11/03 00:00:06 [emerg] 265#265: chown("/dev/null", 33) failed (1: Operation not permitted)
2021/11/04 00:00:26 [notice] 341961#341961: signal process started
2021/11/01 18:32:21 [info] 26904#26904: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2021/11/01 18:33:26 [info] 27872#27872: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2021/11/01 18:43:39 [info] 202#202: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2021/11/01 18:44:51 [info] 201#201: Using 32768KiB of shared memory for nchan in /etc/nginx/nginx.conf:63
2021/11/03 00:00:05 [notice] 187841#187841: signal process started

Why is this happening? How can I fix this?

Hello cahixiv.

The error looks similar to the one encountered by another user.

Try the described solution (unlink /etc/nginx/modules-enabled/50-mod-http-perl.conf) and let us know the result: Nginx exit with error code - #2 by Alexandre

NB! We recommend you to prepare whole server backup just in case.

I have done that and it is running so far. I did run the command:

root@onlyoffice:~# apt list --installed | grep onlyoffice

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

onlyoffice-documentserver/squeeze,now 6.4.2-6 amd64 [installed]
1 Like