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
Mosquitto unable to start #2074
Comments
Sorry you're having problems. Do you know what version of Mosquitto you have? You might get more information on what is going wrong by starting Mosquitto manually:
|
Same problem here. Running the latest version in docker (2.0.7). My watchtower upgraded the container like it normally do, but everything was offline this morning. The container is reporting "Address not available" - but I'm not sure if it's something related to IPv6 (My local setup are IPv4 only). It's also reporting: Therefore, something groundbreaking must have changed, for the v.2+? Maybe something should be baked into the container, for better handling of the users running with the I've reverted back to the |
I had the same issue after watchtower upgraded to the latest version tonight. The only thing in the log that doesn't seem to be caused by my stuff is this: For every connection I am seeing this in the log:
What I tried:
So I think either there is something wrong with the latest version or there is a config thing or deprecation of some sort. |
This broke for me when Watchtower upgraded this to 2.0.7 also. Adding the following to the config file and a restart fixed things for me:
|
Version 2.0 was released at the start of December and it was made clear that it has breaking changes, with some documentation around the breaking changes: https://mosquitto.org/documentation/migrating-to-2-0/ The We advertised (email and twitter) a week ago that the Inevitably and understandably there will be people who aren't on the mailing list or saw the tweets, and I'm sorry for the disruption the upgrade can cause some people, but I hope you see that we tried hard to give the chance to upgrade without being disrupted. In general, I would suggest not using the |
@ScottRoach That makes totally sense, now that it's reported: So, the solution must be to add @ralight How can we subscribe to the email-information, what you're referring to? Also, good point about the |
@exetico The mailing list is https://accounts.eclipse.org/mailing-list/mosquitto-dev and twitter is https://twitter.com/MosquittoMQTT
The solution is to read the migration docs :) The changes are intended to nudge users into having to consider security. It was too easy before to unintentionally run the broker without any authentication. In brief: If you run without a config file, or without a If you define a listener, you must consider authentication, otherwise no access will be possible. Choices:
|
@ralight thank you for providing those information. That's very useful. That's still not working in my case but at least that gives me some directions to look into. Also, how about making the proper default changes in the default_config.conf file
this file hasn't changed since the last release in the snap library so that at least we don't get this message in our log files:
|
@pchevallier Do you mean on https://mosquitto.org/documentation/migrating-to-2-0/ ? I'm keen to improve anything that isn't clear so feel free to ask and I can then modify the document. Good point about |
I got bitten by this -- but it was the snap that got updated and took down my installation. The snap documentation (as far as I can see) was not updated to include the extra step of modifying the config files. |
@pjsg Exactly what also happened to me yesterday. The new version got released in the official Ubuntu repo, and has been automatically applied during a nightly maintenance window by the AWS system manager. @ralight yes, the current migration documentation doesn't cover the snap package management. It even has even some issues depending on the OS we are in. It behaves differently whether you are on Ubuntu or Centos. it's not Mosquitto related, but I haven't been able to get neither Mosquitto daemon to run using the legacy setup (version 1.6). |
The solution is |
@pjsg you're right that the snap documentation wasn't updated to point users to the need to configure authentication, I've now fixed that, thank you. The default configuration of the 2.0 snap package not authorising any connections is an oversight which I didn't catch because it seems I have only tested with different variations of configuration file, but not without a custom configuration file. It seems as though the same is true for all of the people who have been using the 2.0 snap over the past two months as well. Sorry for the disruption. The snap is now fixed to allow unauthenticated access from the local machine only, as per the default configuration. If you want to allow access from other computers you will need to configure a listener and an authentication method, either a password file, authentication plugin, or setting |
Hello everyone, I updated my docker image, changed config but the container start stay in status "unknown".
after few seconds I get:
after last line is nothing happens |
@Diddlik If you're willing to try that, just do the following steps: docker pull eclipse-mosquitto:2.0.7
docker run -it --name mosquitto1 -p 1883:1883 -v $(pwd)/conf/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto:2.0.7 Evertything looks just fine, in your config - and the output, too :-) However, I'll recommend you to add some auth to your setup. I really doubt that it's something related to the local files, though. I must have read your question a bit too fast. For inspiration, here's my simple config-file: allow_anonymous false
password_file /mosquitto/config/file_with_mqttpassword
listener 1883 And here's the part of my docker-compose, related to the mosquotto setup: # https://hub.docker.com/_/eclipse-mosquitto/
mqtt:
image: eclipse-mosquitto:2.0.7
container_name: mqtt
ports:
- "1883:1883"
- "9001:9001"
volumes:
- /home/USERNAME/mqtt/mosquitto.conf:/mosquitto/config/mosquitto.conf
- /home/USERNAME/mqtt/file_with_mqttpassword:/mosquitto/config/file_with_mqttpassword
restart: unless-stopped |
Tried it again. the same output. |
Well, have you checked the mosqutto-logs? :-) The status for my container looks just fine. Have you tried to define the full path, instead of using I can't bring other things to the table. But you can try and see the logs from the container? Maybe there's something usefull. |
it is nothing in logs, I htinks it is not started propertly |
Well, stop it, remove it, create a new one. There must be something with your setup, one way or another :-) Hopefully you'll figure it out, sooner or later. |
Hiya.. does anyone know whether the listener can be created through a ENV variable on docker run? |
It would really help if someone would update https://hub.docker.com/_/eclipse-mosquitto to actually mention that you require to include a configuration file, and what the content should be, if you even want to be able to connect to the darn thing running inside the container |
well that was a pain in the butt. I did a docker pull for the latest, and little did I know it would go to the 2.0 branch and break everything. Added volume for the pid file in
updated /opt/mosquitto/conf.d/default.conf:
updated /opt/mosquitto/config/mosquitto.conf:
chown everything to 1883.1883 and make sure read/write perms are safe |
I've encountered the same issue as everyone else. It's clearly my mistake for not locking the version, but it would be nice if the new version didn't require a configuration file. For example by setting an environment variable in the docker container. I guess that locking the server to local connections makes sense when running locally, but it's a pretty bad default when running in docker. Perhaps the docker image should include a default config with the old behavior or something like that. |
Can someone please explain what is not working and is there a fix? |
It may be that you are 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'm running into similar issue. If I do not mount any paths into the container, it starts fine. The moment I start overriding the (in-container) /mosquitto/config/mosquitto.conf file via a |
With config:
Runnning with command: Does not work. While the following config works but has undesirable paths:
Again launching with:
Gives this output:
|
With config:
Starting 2.0.13 as follows:
It both loads the config file found in <abs_path_on_host>/mosquitto/config and saves database to <abs_path_on_host>/mosquitto/data
This is probably what most people want. My guess is that the path /mosquitto/data might be defined in the docker image not letting it be overridden unless it is done explicitly. |
Also using
seems to disable logging to console which in combination with non working mounts make it seem like the docker image is doing nothing. |
Thank you. Had it in my config and was wondering why nothing is happening. |
Was creating items inside my OpenHab environment and all of a sudden everything went offline. Ive tried more then then I'd like to admit to try and resolve this but I ended up just removing all of eclipse and attemping to reinstall with (sudo apt-get purge --remove mosquitto*) but the error didn't change and I'm still dead in the water. Any insight or suggestions would be marvelous and much appreciated.
skynet@skynet:/etc/mosquitto$ sudo systemctl status mosquitto
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/mosquitto.service.d
└─override.conf
Active: failed (Result: exit-code) since Thu 2021-02-04 15:36:03 EST; 6min ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Main PID: 14891 (code=exited, status=1/FAILURE)
Feb 04 15:36:03 skynet systemd[1]: mosquitto.service: Scheduled restart job, restart counter is at 5.
Feb 04 15:36:03 skynet systemd[1]: Stopped Mosquitto MQTT Broker.
Feb 04 15:36:03 skynet systemd[1]: mosquitto.service: Start request repeated too quickly.
Feb 04 15:36:03 skynet systemd[1]: mosquitto.service: Failed with result 'exit-code'.
Feb 04 15:36:03 skynet systemd[1]: Failed to start Mosquitto MQTT Broker.
The text was updated successfully, but these errors were encountered: