SensorsIot / IOTstack

Docker stack for getting started on IOT on the Raspberry PI
GNU General Public License v3.0
1.45k stars 308 forks source link

Node-Red unable to connect to Mosquitto #233

Open larrybell opened 3 years ago

larrybell commented 3 years ago

New install on SSD. In the process of migrating from VMs running on VMWare to IOTStack. The only issue so far is Mosquitto. Devices are not able to talk to Mosquitto.

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

This is a new error after migrating from the gcgarner repo. I was hoping to fix my first problem now i have this one.

Paraphraser commented 3 years ago

It probably means what it says (basically, your pwfile is in the wrong place or might have the wrong permissions).

You didn't include any of the relevant files in your issue so I can't immediately pinpoint the actual problem.

I'll step through how I would diagnose a problem like this on my own system. With luck, something I say will help you figure out what's what on your own system.

Starting with the template:

$ grep "password" ~/IOTstack/.templates/mosquitto/mosquitto.conf
#Uncomment to enable passwords
#password_file /mosquitto/pwfile/pwfile

$ grep "pwfile" ~/IOTstack/.templates/mosquitto/service.yml
      - ./volumes/mosquitto/pwfile:/mosquitto/pwfile

After the menu run, the active mosquitto.conf will wind up at:

~/IOTstack/services/mosquitto/mosquitto.conf

If passwords are enabled by uncommenting the "#password_file" line in the active mosquitto.conf then, taken together with the service.yml definition:

If I were having a problem like this, I'd:

If you need to move files around and/or change permissions within ./volumes/mosquitto, it's probably best if you start with:

$ cd ~/IOTstack
$ docker-compose stop mosquitto
$ docker-compose rm -f mosquitto

then do the work in the file system, then:

$ docker-compose up -d mosquitto

That's the only way I know to be certain that the running container has been recreated and sees the external file system the way you see it. I used to think a simple docker-compose restart mosquitto got the job done but I learned (the hard way) that that isn't always true.

larrybell commented 3 years ago

Thank you so much for the quick response. I was going to just give up and go back to running on VMware. I will give this a try as soon as I can.

Again, Thank you

Get Outlook for iOShttps://aka.ms/o0ukef


From: Phill notifications@github.com Sent: Monday, January 11, 2021 3:50:15 PM To: SensorsIot/IOTstack IOTstack@noreply.github.com Cc: Larry Bell larrybell@LEGALTECHSUPPORT.COM; Author author@noreply.github.com Subject: Re: [SensorsIot/IOTstack] Node-Red unable to connect to Mosquitto (#233)

It probably means what it says (basically, your pwfile is in the wrong place or might have the wrong permissions).

You didn't include any of the relevant files in your issue so I can't immediately pinpoint the actual problem.

I'll step through how I would diagnose a problem like this on my own system. With luck, something I say will help you figure out what's what on your own system.

Starting with the template:

$ grep "password" ~/IOTstack/.templates/mosquitto/mosquitto.conf

Uncomment to enable passwords

password_file /mosquitto/pwfile/pwfile

$ grep "pwfile" ~/IOTstack/.templates/mosquitto/service.yml

After the menu run, the active mosquitto.conf will wind up at:

~/IOTstack/services/mosquitto/mosquitto.conf

If passwords are enabled by uncommenting the "#password_file" line in the active mosquitto.conf then, taken together with the service.yml definition:

If I were having a problem like this, I'd:

to make sure that the critical line:

   - ./volumes/mosquitto/pwfile:/mosquitto/pwfile

is the same in all three. [1] is the definition. [2] is a copy of [1] created by a menu run. [3] is inserted from [2] by a menu run. If you're coming from gcgarner, [2] might be out of sync with [1].

If you need to move files around and/or change permissions within ./volumes/mosquitto, it's probably best if you start with:

$ cd ~/IOTstack $ docker-compose stop mosquitto $ docker-compose rm -f mosquitto

then do the work in the file system, then:

$ docker-compose up -d mosquitto

That's the only way I know to be certain that the running container has been recreated and sees the external file system the way you see it. I used to think a simple docker-compose restart mosquitto got the job done but I learned (the hard way) that that isn't always true.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/SensorsIot/IOTstack/issues/233#issuecomment-758247273, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIIT556GD7U5GCI3EOIAYKTSZNXBPANCNFSM4V6D6SIQ.