-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't start mosquitto.service #1603
Comments
Try doing |
Hi,
for a few weeks it worked and since yesterday it no longer works. |
Dear people, i am a newbee and im proud to got the instal on mij raspberri pi. (domnoticz works fine) A have a mqtt stick, it works fine i think, i can ad and a see the zigbee sensor but than... Nothing, got a tip i should test if the server is running, It dit not, so thats the problem. I found in ssh the error, but i have no clou.. Hope you know what i could do.. ● mosquitto.service - Mosquitto MQTT v3.1/v3.1.1 Broker dec 30 21:47:33 raspberrypi systemd[1]: mosquitto.service: Service RestartSec=100ms expired, scheduling restart. |
In my case the issue is that the log file at /var/log/mosquitto/mosquitto.log is corrupt. This is the first time I've seen a corrupt file on a GNU/Linux system. $ ls -la /var/log/mosquitto/
ls: cannot access '/var/log/mosquitto/mosquitto.log': No such file or directory
total 40
drwxr-xr-x 2 root root 4096 Feb 3 00:00 .
drwxr-xr-x 1 root root 4096 Feb 5 00:00 ..
c????????? ? ? ? ? ? mosquitto.log
-rw-rw-rw- 1 root root 27127 Feb 3 00:00 mosquitto.log.1.gz I did have a power outage a couple of days ago but the system came back online without a hitch, it was only after a proper system shutdown last night that mosquitto wouldn't start. No idea whether this is a mosquitto issue or a system issue, everything else seems unaffected though. |
@lost-RD wow, that looks like filesystem corruption to me - I'd make sure you've got your data off there. Everybody else - my comment about running |
Wrote an empty file to the file address and chmod 666 and mosquitto is back up and running, I'll take that advice and backup. |
@lost-RD I had a similar file corruption happen recently to my mosquitto log file too. I'm working in a multi-tenant environment, so I do not have the permissions to remove the corrupted file myself. I'm using the most recent docker image as of 2/19/2021 |
On further reading you can get this sort of effect if the
In conclusion - I'm not much the wiser as to what could have caused it, or why it's showing as it is. |
It sounds like you might be trying to start Mosquitto twice, the first time is a leftover from earlier versions that need deletion. The words below are from a post in another thread. There was a root CRON job that runs How did I find it. Well once I found CRON has a @reboot option I looked further and found CRON is by user including root. So I winged it and tried After that it was a tidy up of all the other things I had tweaked and re-enable the systemd job on reboot. So now have 2.0.11 working as I like. I suspect that CRON job was a left over from earlier versions of Mosquitto (I was on 1.5 or 1.6) but the update to 2.0.11 didn't delete it when it created the mosquitto.service job. |
I had the same issue after typing the command
I found out I had multiple config files, so I removed the old ones. Hope it helps! |
: mosquitto.service: Scheduled restart job, restart counter is at 5. When I checked service logs via
It pointed out default configuration file line 11 where it includes custom configurations directory. Then I noticed a whitespace at the end of the line
I removed the whitespace character and saved the file. It's all OK now. |
I have a similar problem
|
I have run into this problem after making configured SSL for a droplet server running on NGINX. Configurations I have for mymain domain:
the idea was to add sumdomain Here are
|
I ran into a similar problem (shown below). By looking at /var/log/mosquitto/mosquitto.log I figured out I needed to change the permissions/user of the passwd file: sudo chmod 700 passwd it went from: it works now. mosquitto.service - Mosquitto MQTT Broker May 18 16:47:43 focus systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5. |
hi, installed with the apt-get install method.
Can't autostart so I ran
sudo systemctl start mosquitto.service
and thensudo systemctl status mosquitto.service
and this is the output:Loaded: loaded (/etc/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-02-18 18:54:47 WET; 4s ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Process: 1949 ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf (code=exited, status=1/FAILURE)
Main PID: 1949 (code=exited, status=1/FAILURE)
Feb 18 18:54:47 raspberrypi systemd[1]: mosquitto.service: Service RestartSec=100ms expired, scheduling restart.
Feb 18 18:54:47 raspberrypi systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Feb 18 18:54:47 raspberrypi systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker.
Feb 18 18:54:47 raspberrypi systemd[1]: mosquitto.service: Start request repeated too quickly.
Feb 18 18:54:47 raspberrypi systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Feb 18 18:54:47 raspberrypi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker.
so i executed
/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
and it outputed:1582051833: mosquitto version 1.5.7 starting
1582051833: Config loaded from /etc/mosquitto/mosquitto.conf.
1582051833: Error: Unable to open pwfile "/etc/mosquitto/passwd ".
1582051833: Error opening password file "/etc/mosquitto/passwd ".
it seems to be a permissions problem, tried some things but can't get it to work. Can anybody help pls?
The text was updated successfully, but these errors were encountered: