eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.07k stars 2.39k forks source link

Unable to open config file /home/USER/mosquitto/mosquitto.conf #1128

Open chrysa95 opened 5 years ago

chrysa95 commented 5 years ago

Hello ,

I add the auth plugin in the mosquitto broker but when I am trying to run mosquitto -c /home/USER/mosquitto/mosquitto.conf it returns me the following error:

(i am following this tutorial http://www.yasith.me/2016/04/securing-mqtt-connection-using.html)

Error: Unable to open config file /home/USER/mosquitto/mosquitto.conf
Error found at /home/USER/mosquitto/mosquitto.conf:0.
Error: Unable to open configuration file.

Any ideas? Thanks !!

ralight commented 5 years ago

Do you definitely have the correct permission to access the file?

tamusjroyce commented 5 years ago

Commenting out the below in my config solved the above issue. It seems to know /var/lib/mosquitto/ is my persistent location without specifying it. For me, it was not a permissions issue.

#persistence_location /var/lib/mosquitto/

In some cases, I think it is able to open the configuration file. Even if you get the error "Error: Unable to open configuration file."

(I was hoping to see a reply from @chrysa95 how they resolved their issue?)

walidmr11 commented 3 years ago

oui pour moi la solution était de donner toutes les autorisations au système

ckrey commented 3 weeks ago

@chrysa95 did you solve the problem? Can the issue be closed?