[Solved] A newbie needs help (Unable to start service nginx)

Hello,
I have a VPS server with Ionos and tried installing Mattermost omnibus. I keep running into the same issue below. Any help would be much appreciated!

fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “Unable to start service nginx: Job for nginx.service failed because the control process exited with error code.\nSee "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.\n”}

What do “systemctl status nginx.service” and “journalctl -xeu nginx.service” say?

Hi @john.oliver I ended up reinstalling ubuntu fresh on the server to get rid of Plesk, so I can install Mattermost straight away. it worked, but I’m unable to get to the server interface so far (using an IP address, no domain)

Are you connecting to http://<ip.address>:8065 ?

Precisely, to no avail

‘systemctl status mattermost.service’?

@john.oliver Thanks for your help, I really appreciate it!

mattermost.service - Mattermost
Loaded: loaded (/lib/systemd/system/mattermost.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mattermost.service.d
└─omnibus-overrides.conf
Active: activating (auto-restart) (Result: resources) since Mon 2024-01-22 15:15:27 UTC; 9s ago
CPU: 0

Jan 22 15:15:27 ubuntu systemd[1]: mattermost.service: Failed with result ‘resources’.
Jan 22 15:15:27 ubuntu systemd[1]: Failed to start Mattermost.

What do “systemctl status mattermost.service” and “journalctl -xeu mattermost.service” say?

See below, thanks!!

root@ubuntu:~# systemctl status mattermost.service
● mattermost.service - Mattermost
Loaded: loaded (/lib/systemd/system/mattermost.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mattermost.service.d
└─omnibus-overrides.conf
Active: activating (auto-restart) (Result: resources) since Mon 2024-01-22 15:52:10 UTC; 9s ago
CPU: 0

Jan 22 15:52:10 ubuntu systemd[1]: Failed to start Mattermost.


░░ Support: Enterprise open source support | Ubuntu
░░
░░ Automatic restarting of the unit mattermost.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jan 22 15:52:41 ubuntu systemd[1]: Stopped Mattermost.
░░ Subject: A stop job for unit mattermost.service has finished
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A stop job for unit mattermost.service has finished.
░░
░░ The job identifier is 25247 and the job result is done.
Jan 22 15:52:41 ubuntu systemd[1]: mattermost.service: Failed to load environment files: No such file or directory
Jan 22 15:52:41 ubuntu systemd[1]: mattermost.service: Failed to run ‘start’ task: No such file or directory
Jan 22 15:52:41 ubuntu systemd[1]: mattermost.service: Failed with result ‘resources’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit mattermost.service has entered the ‘failed’ state with result ‘resources’.
Jan 22 15:52:41 ubuntu systemd[1]: Failed to start Mattermost.
░░ Subject: A start job for unit mattermost.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit mattermost.service has finished with a failure.
░░
░░ The job identifier is 25247 and the job result is failed.
Jan 22 15:52:51 ubuntu systemd[1]: mattermost.service: Scheduled restart job, restart counter is at 268.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ Automatic restarting of the unit mattermost.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jan 22 15:52:51 ubuntu systemd[1]: Stopped Mattermost.
░░ Subject: A stop job for unit mattermost.service has finished
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A stop job for unit mattermost.service has finished.
░░
░░ The job identifier is 25339 and the job result is done.
Jan 22 15:52:51 ubuntu systemd[1]: mattermost.service: Failed to load environment files: No such file or directory
Jan 22 15:52:51 ubuntu systemd[1]: mattermost.service: Failed to run ‘start’ task: No such file or directory
Jan 22 15:52:51 ubuntu systemd[1]: mattermost.service: Failed with result ‘resources’.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit mattermost.service has entered the ‘failed’ state with result ‘resources’.
Jan 22 15:52:51 ubuntu systemd[1]: Failed to start Mattermost.
░░ Subject: A start job for unit mattermost.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit mattermost.service has finished with a failure.
░░
░░ The job identifier is 25339 and the job result is failed.

Look in your systemd unit file, probably /lib/systemd/system/mattermost.service Look at ExecStart and WorkingDirectory Do an ‘ls -lZ’ on both.

Also, tail out /opt/mattermost/logs/mattermost.log Look for errors there.

@john.oliver thank you for your help. I don’t know how to do either of these things, a true newbie :). Thanks in advance for any advice/guidance you can provide to perform these checks

root@ubuntu:~# /lib/systemd/system/mattermost.service
-bash: /lib/systemd/system/mattermost.service: Permission denied

‘cat /lib/systemd/system/mattermost.service’

[Unit]
Description=Mattermost
After=network.target

[Service]
Type=notify
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
KillMode=mixed
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
User=mattermost
Group=mattermost
LimitNOFILE=49152

[Install]
WantedBy=multi-user.target

Look at the contents of ExecStart and WorkingDirectory. Do an ‘ls -lZ’ on each. Make sure they match what’s on your system, that ExecStart is the mattermost binary with execute permissions and that WorkingDirectory is a valid directory that the mattermost user can read and write into.

@john.oliver happy to report I fixed it in a rather unrefined manner: I re-installed Linux on the server from scratch and ran the omnibus install again. I believe the core of my issue was that I tried installing Mattermost omnibus after a partially failed attempt at a prior Mattermost install. Some files must have been in conflict. Thanks a lot for your help!

1 Like

I’m unable to get to the server interface so far (using an IP address, no domain)

Also, tail out /opt/mattermost/logs/mattermost.log Look for errors there..
.