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
Connection to MQTT broker lost on restart #2073
Comments
I've been playing around a bit more and I think I've found the source: When I add it back everything works fine again. In my particular installation I'm handling containers externally so I don't understand why Gladys needs access to the Docker socket? |
@nataloko Hey ! Thanks for your bug report. There might be a bug indeed. This is the file initializing the MQTT integration => https://github.com/GladysAssistant/Gladys/blob/master/server/services/mqtt/lib/init.js I've tried on my side, and for now I can't reproduce the bug... This is my configuration :
When restarting, MQTT is connected with success Did you do a "Gladys based installation" before connecting to an external broker? |
Hi Pierre, I started to see this on a fresh installation. Also I've just checked the locker logs I see this warning when Gladys starts without the docker.sock link (it doesn't show when I add the link back)
|
@nataloko Thanks for your investigation, it helps a lot. I understand what's going on now, we check in this integration is "Docker based" on this line: https://github.com/GladysAssistant/Gladys/blob/master/server/services/mqtt/lib/getConfiguration.js#L23 If yes, we get the networkMode of the current container, and in your case it fails because the docker socket is not available. I'm going to add some safety checks to avoid breaking the MQTT integration in case the Docker socket is not here |
Fixed in PR : #2084 |
@nataloko Fix available in Gladys Assistant 4.42 |
Thank you, I can confirm it's working as expected now :) |
Describe the bug
I have Gladys running in docker and an external MQTT broker (Mosquitto), everything seems to work OK when I enter the address and login details but configuration gets lost when I reboot (or restart Gladys).
To Reproduce
Expected behavior
I expect the configured broker to stay saved.
Screenshots
Your Gladys installation (please complete the following information):
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: