owntracks / quicksetup

A (mostly) automated installer for OwnTracks Recorder, Frontend with MQTT and Let's Encrypt
https://owntracks.org/booklet/guide/quicksetup/
9 stars 3 forks source link

mosquitto restart issue during install #45

Closed Roysteroonie closed 1 month ago

Roysteroonie commented 1 month ago

I'm using IONOS VPS and have tried this a couple of times now. It fails at the same stage. Even reimagining my server and starting fresh it appears. Anyone else encountered this?

image

Using Ubuntu 22.4

Some further info.

root@ubuntu:~# journalctl -xeu mosquitto.service ░░ Subject: Unit failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit mosquitto.service has entered the 'failed' state with result 'exit-code'. May 25 00:53:01 ubuntu systemd[1]: Failed to start Mosquitto MQTT Broker. ░░ Subject: A start job for unit mosquitto.service has failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit mosquitto.service has finished with a failure. ░░ ░░ The job identifier is 3958 and the job result is failed. May 25 00:53:01 ubuntu systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5. ░░ Subject: Automatic restarting of a unit has been scheduled ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ Automatic restarting of the unit mosquitto.service has been scheduled, as the result for ░░ the configured Restart= setting for the unit. May 25 00:53:01 ubuntu systemd[1]: Stopped Mosquitto MQTT Broker. ░░ Subject: A stop job for unit mosquitto.service has finished ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A stop job for unit mosquitto.service has finished. ░░ ░░ The job identifier is 4043 and the job result is done. May 25 00:53:01 ubuntu systemd[1]: mosquitto.service: Start request repeated too quickly. May 25 00:53:01 ubuntu systemd[1]: mosquitto.service: Failed with result 'exit-code'. ░░ Subject: Unit failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ The unit mosquitto.service has entered the 'failed' state with result 'exit-code'. May 25 00:53:01 ubuntu systemd[1]: Failed to start Mosquitto MQTT Broker. ░░ Subject: A start job for unit mosquitto.service has failed ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit mosquitto.service has finished with a failure. ░░ ░░ The job identifier is 4043 and the job result is failed.

Any help or advice greatly appreciated.

jpmens commented 1 month ago

I'm assuming this is using our Quickstart?

Please show the last portion of the mosquitto log file from /var/log/mosquitto/mosquitto.log, whether you see errors there.

Roysteroonie commented 1 month ago

Thanks for the response @jpmens here is the output. Ports are open as required, but as my hosting site already has SSL, I commented out the email as per the instructions. Not sure if this is the cause? But when I ran with email it also failed but a different error completely.

"email is the email address which we will use when enrolling a Let's Encrypt certificate on your behalf. We don't use this for anything else, and Let's Encrypt will send you mail only when your certificate is about to expire. You can omit this setting in which case we will configure Quicksetup without TLS/SSL; we don't recommend this, but it might be good for simple testing."

1716678864: Error: Unable to load CA certificates. Check cafile "/usr/local/owntracks/tls/cert.crt". 1716678864: OpenSSL Error[0]: error:80000002:system library::No such file or directory 1716678864: OpenSSL Error[1]: error:10000080:BIO routines::no such file 1716678864: OpenSSL Error[2]: error:05880002:x509 certificate routines::system lib 1716678864: mosquitto version 2.0.11 starting 1716678864: Config loaded from /etc/mosquitto/mosquitto.conf. 1716678864: Opening ipv4 listen socket on port 1883. 1716678864: Opening ipv4 listen socket on port 8883. 1716678864: Opening ipv6 listen socket on port 8883. 1716678864: Error: Unable to load CA certificates. Check cafile "/usr/local/owntracks/tls/cert.crt". 1716678864: OpenSSL Error[0]: error:80000002:system library::No such file or directory 1716678864: OpenSSL Error[1]: error:10000080:BIO routines::no such file 1716678864: OpenSSL Error[2]: error:05880002:x509 certificate routines::system lib 1716678864: mosquitto version 2.0.11 starting 1716678864: Config loaded from /etc/mosquitto/mosquitto.conf. 1716678864: Opening ipv4 listen socket on port 1883. 1716678864: Opening ipv4 listen socket on port 8883. 1716678864: Opening ipv6 listen socket on port 8883. 1716678864: Error: Unable to load CA certificates. Check cafile "/usr/local/owntracks/tls/cert.crt". 1716678864: OpenSSL Error[0]: error:80000002:system library::No such file or directory 1716678864: OpenSSL Error[1]: error:10000080:BIO routines::no such file 1716678864: OpenSSL Error[2]: error:05880002:x509 certificate routines::system lib

jpmens commented 1 month ago

You have not responded to my query regarding whether this was done with Quicksetup.

The error is clearly marked:

1716678864: Error: Unable to load CA certificates. Check cafile "/usr/local/owntracks/tls/cert.crt".

it would appear the bootstrap process didn't run correctly, or that you didn't specify an email address in the configuration.yaml file before bootstrapping. Is that it?

Roysteroonie commented 1 month ago

Yes via Quickstart, I have my own SSL on the VPS, so maybe wrongly assumed that it would use this? Apologies for delayed response as the mails are being treated as spam.

jpmens commented 1 month ago

Quickstart expects to take main control of the system, so no. (Didn't we already talk about this regarding HTTP port 80? I might be mistaking you, sorry.)

Roysteroonie commented 1 month ago

So maybe I'd have to purchase a new domain instead of using a current sub from my main ecommerce website, as that requires the ssl?

jpmens commented 1 month ago

There should be no need to purchase a new domain. You ought to be able to create a new record in DNS for your current domain (e.g. owntracks.example.com if your current is example.com) and point its A / AAAA record to the IPv4 / IPv6 address of the machine you intend running OwnTracks quickstart on.

Roysteroonie commented 1 month ago

Yeah I tried that, maybe the host had an issue. Anyway I removed my SSL which is ok as my main domain redirects to a shopify site anyway which already has SSL. So now after removing the SSL I reimaged and tried again, all worked! Many thanks for your help.

jpmens commented 1 month ago

Glad you got it sorted.