-
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
Unable to open config file (Docker Compose - RPi 4) #2557
Comments
Ok I think I may have figured out the problem by RTFM properly.
Rebuilding the container with this new config results in no errors in the logs. I hope this is the last of my issues. Still a little perplexed as to why it didn't work as it was before... perhaps someone smarter than me can provide a reason. I'll keep this open a little longer until I have successfully connected Zigbee2mqtt and Home Assistant to the broker, and feed back shortly. |
This appears to be similar to #2512 Looking further, I noticed that the volumes aren't mapping properly. If I exec into the container and check the files, everything is there as it should be Inside
...but if I check inside the I've spent the last few hours playing around with volume mappings, permissions, and other things. There has to be a correct way of doing this. |
Still trying to get this to work. Error message returned in the command line is
Am I doing something wrong or is this image broken? Can someone help? I've spent way too many hours on this, no other image I've run on this host has taken so much of my time and energy. |
@IonicOwl I'm not using a RPi but found that had to use
Amusingly the config file works with just the top level directory but not the the other two if the explicit mappings are removed despite the directories being recreated.
Interestingly the permissions aren't the same, but doesn't seem that should be the cause of this issue.
And with
|
I've managed to get this working now, thanks to some help from someone on Reddit. Here is my working compose snippet:
Not sure if it helped, but I set the file and directory ownership of the mosquitto volume to the pi user (1000:1000), and specified the user in the compose file. I made an error in assuming that DNS would work between containers, so when trying to connect to the broker from my Home Assistant container via he hostname, it was failing to connect. Using the IP address of the container instead works for me. Strangely using the container name doesn't work like I'm lead to believe it should either. That's a problem for another day, not related to this. |
Hi, I've been struggling with getting this to work. I'm using Docker Compose on a Pi 4 to run all of my home automation stuff, and I can't get Mosquitto to start properly. The container itself starts up, but looking at the container log, I see this:
1654374192: Error: Unable to open config file /mosquitto/config/mosquitto.conf.
Here is the mosquitto section of my compose.yml file:
I created a folder structure for the config file before starting the container, and pre-populated the config file.
I should point out that the /data and /log directories were automatically created after starting the container for the first time.
The contents of the config file:
(I've commented out the auth stuff for now as i want to set this up after. I don't think it matters though because it's not picking up this file anyway)
One of the first things I checked was whether the files were available from within the container. If I exec into the container, I can see that the config file is indeed there:
Read permissions appear to be present and correct. If I cat the file, it's all in there:
I'm at a bit of a loss here. I get the feeling that I've missed something, or perhaps there's a problem with permissions/ownership somewhere. If you look at the directory listings above, everything is owned by root (from me running everything as sudo), aside from the mosquitto directory, which is owned by 1883:1883 recursively.
I'm not sure if I needed to specify something in the compose file, but It's clearly already looking in the right place for the config file, going by the container log. Perhaps it's missing a volume declaration? I did specify
/opt/cgten/mosquitto:/mosquitto
in the compose file though, and it put everything else in there as expected, so I don't know.Any help in the right direction would be massively appreciated.
**System Information**
Mosquitto Image Version:
2.0.14
Docker Version:
Docker-Compose Version:
Kernel Version:
5.15.32-v8+
Distribution Version:
The text was updated successfully, but these errors were encountered: