Score:0

Issues with docerised mosquitto: Error opening password file

gb flag

I am very new to docker and pretty new to linux so please be gentle!

I am trying to get the official docker mosquitto image to work with a password file. My config file:

persistence true
persistence_location /mosquitto/data/

listener 1883
password_file /mosquitto/config/mqtt_passwd

my run command:

sudo docker run --rm -i -p 1883:1883 -v /volume1/mosquitto:/mosquitto eclipse-mosquitto:latest

when it runs:

1646914188: mosquitto version 2.0.14 starting
1646914188: Config loaded from /mosquitto/config/mosquitto.conf.
1646914188: Error: Unable to open pwfile "/mosquitto/config/mqtt_passwd".
1646914188: Error opening password file "/mosquitto/config/mqtt_passwd".

so the config file and the password file are in the same folder with the same permissions:

-rwxrwxrwx+ 1 1883 1883 114 Mar 10 12:09  mosquitto.conf
-rwxrwxrwx+ 1 1883 1883 121 Mar 10 11:14  mqtt_passwd

this 1883 user is weird. I think that the docker image changes the permissions when it boots up. within the container the permissions are:

----------    1 mosquitt mosquitt        71 Mar 10 12:18 mosquitto.conf                                                       
----------    1 mosquitt mosquitt       121 Mar 10 11:14 mqtt_passwd

it's strange to me that it can access the config file but it can't access the password file.

Many thanks for any help

cn flag
How are you running the container? Can you share the full command as it may shed some light!
gb flag
This is on Synology so it's done through a UI. I'll reverse engineer a run command though and update the post with it
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.