Closed imranoftherings closed 10 months ago
I would also like to add that rolling back to 5.5.1 allows ring-mqtt to connect to mosquitto just fine, without any changes to the config.json
As there were no changes in ring-mqtt code around MQTT connectivity, and really there haven't been for years (quite literally the mqtt.js code hasn't even been touched in 8 months), it's hard to see what this could be, but, as a theory, there was a major new version of MQTTjs from v4.x to v5.x, which was released back in July. I did bump dependencies to this new major version in the 5.6.x releases, so maybe there's a bug there, but hard to see what it could be as 1000's of users have upgraded already and there are no other reports of this issue.
One thing that is super confusing, the log you sent doesn't match the config, for example in the log it says:
MQTT URL: mqtt://mosquitto.ix-mosquitto.svc.cluster.local:1883
While in the config you have:
"mqtt_url": "mqtt://<user>:<pass>@192.168.1.3:1883"
This seems...strange. The URL in the log should match the URL in the config other than the password would be obscured in the log.
As there were no changes in ring-mqtt code around MQTT connectivity, and really there haven't been for years (quite literally the mqtt.js code hasn't even been touched in 8 months), it's hard to see what this could be, but, as a theory, there was a major new version of MQTTjs from v4.x to v5.x, which was released back in July. I did bump dependencies to this new major version in the 5.6.x releases, so maybe there's a bug there, but hard to see what it could be as 1000's of users have upgraded already and there are no other reports of this issue.
One thing that is super confusing, the log you sent doesn't match the config, for example in the log it says:
MQTT URL: mqtt://mosquitto.ix-mosquitto.svc.cluster.local:1883
While in the config you have:
"mqtt_url": "mqtt://:@192.168.1.3:1883"
This seems...strange. The URL in the log should match the URL in the config other than the password would be obscured in the log.
Yes. I did notice that mqtt.js file wasn't touched in 8months. so that's why this seemed very weird. I thought maybe something else in my environment changed and hence I did a rollback of the container to the older image to check and the older image still works.
Good catch about the URL. See attached logs after rollback. The URL after rollback is as defined in config.json
I do see connection attempts in Mosquitto logs with the 5.6.2 version. So I am not sure whether this is an indication of an issue or a red herring.
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/ring-mqtt.sh
-------------------------------------------------------
| Ring-MQTT with Video Streaming |
| Docker Edition |
| |
| For support questions please visit: |
| https://github.com/tsightler/ring-mqtt/discussions |
-------------------------------------------------------
cont-init: info: /etc/cont-init.d/ring-mqtt.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun ring-mqtt (no readiness notification)
s6-rc: info: service legacy-services successfully started
-------------------------------------------------------
ring-mqtt.js version: 5.5.1
Node version v18.17.0
NPM version 9.1.2
git version 2.38.5
-------------------------------------------------------
Running ring-mqtt...
2023-09-08T03:07:42.159Z ring-mqtt Detected runmode: docker
2023-09-08T03:07:42.160Z ring-mqtt Configuration file: /data/config.json
2023-09-08T03:07:47.262Z ring-mqtt Reading latest data from state file: /data/ring-state.json
2023-09-08T03:07:47.295Z ring-mqtt MQTT URL: mqtt://<user>:********@192.168.1.3:1883
2023-09-08T03:07:47.305Z ring-mqtt Attempting connection to Ring API using saved refresh token...
2023-09-08T03:07:49.597Z ring-mqtt Successfully established connection to Ring API using saved token
2023-09-08T03:07:49.598Z ring-mqtt Received updated refresh token
2023-09-08T03:07:49.598Z ring-mqtt Saving updated refresh token to state file
2023-09-08T03:07:50.618Z ring-mqtt Successfully saved updated state file: /data/ring-state.json
2023-09-08T03:07:51.597Z ring-mqtt Attempting connection to MQTT broker...
2023-09-08T03:07:51.699Z ring-mqtt MQTT connection established, processing Ring locations...
This may be a problem with TrueCharts, which is what I am using for ring-mqtt installation. I just checked their commits and saw this
https://github.com/truecharts/charts/pull/11905/commits/8ee41c2d59f748661a54fe9315a564280c2df707
Let me dig around a bit more
Yes, TrueCharts changed how the configuration was being passed to the container. I fixed my setup to adapt to the new format and it worked.
Thanks for your help!
Hi, I tried to install this custome component on HA Home Assistant 2023.8.4 using HACS, but I obtained this error:
<Integration tsightler/ring-mqtt> Repository structure for v5.6.2 is not compliant
I see you marked it as bug, but I don't understand why this issue was closed...problem isn't solved...?!
@pilot1981 The issue was resolved, which is why it was closed, and it was not directly related to any bug in this project anyway (the problem was with a 3rd party which repackages this project). This project has nothing to do with HACS and the instructions for installing this project in Home Assistant do not mention HACS. https://hacs.xyz/docs/faq/addons/.
Yes, TrueCharts changed how the configuration was being passed to the container. I fixed my setup to adapt to the new format and it worked.
Thanks for your help!
Please, can you share workaround for it?
regards
Describe the Bug
Connection to mosquitto broker getting rejected with Not Authorized message
Steps to Reproduce
Install/Upgrade ring-mqtt to 5.6.2 and connect to mosquitto 2.0.17 with "allow_anonymous false"
Expected Behavior
Connection should be successful
Log Output
Screenshots
No response
Config File
Install Type
Docker
Version
5.6.2
Operating System
TrueNAS Scale 22.12.3.2
Architecture
x86_64
Machine Details
Physical x86_64