-
Notifications
You must be signed in to change notification settings - Fork 101
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
RIng MQTT has stopped working not sure where problem lies #450
Comments
I fixed issue logs show problem lied with Mosquito Broker
|
I'm having the same problem. What was the fix? Thanks! H |
Mosquito Broker says there is supposed to be a Username Configured under user names Home Assistant Add-on: Mosquitto broker Follow these steps to get the add-on installed on your system:
How to use The add-on has a couple of options available. To get the add-on running:
Create a new user for MQTT via your Home Assistant's frontend Configuration -> Users (manage users) , (i.e. not on Mosquitto's Configuration tab). Notes:
To use the Mosquitto as a broker, go to the integration page and install the configuration with one click:
If you have old MQTT settings available, remove this old integration and restart Home Assistant to see the new one. |
Just for clarity I would like to point out that, when using standard Home Assistant addons for MQTT, it should not be required to manually create users for ring-mqtt to operate as Home Assistant should automatically create the "addons" user, and ring-mqtt uses the Home Assistant API to detect this user and automatically get the password. Of course this only works when using the addon versions of Mosquitto and ring-mqtt, as well as a properly configured Home Assistant Mosquitto integration. This is why the "addon" username cannot be used for manual user configuration. While I've personally never had a single issue with the automatic configuration, some people do and it's difficult to troubleshoot, so I understand why people might choose to manually create users using the instructions above, and of course if you are not using the addons then manual configuration is generally required. |
This is interesting. I'm using the addon version of both Mosquito and Ring-MQTT. HA has not created an "addons" user. Should I create one? When I look at the Mosquitto integration config, this is how it's configured, with a user of Homeassistant, not addons. That's not something I did... I read in the Mosquitto docs that the user Homeassistant shouldn't be used as it's a reserved uid. Should I change this to another uid? Another thing to note is that all this was working perfectly for well over 2 years, then mid to late last week Mosquitto got updated and it hasn't worked since. Were there changes to the authentication system? Thanks in advance for all your help. It really is very much appreciated. Best H |
What do you mean by this? This user isn't visible anywhere in the UI that I'm aware of, it's just behind the scenes, which is why it's reserved. Your config looks correct to me, have you fully restarted Home Assistant since the Mosquitto update (I mean a full host reboot, not the restart in the UI, which only restarts the supervisor). Everything still works for me so I assume nothing has changed. Basically, the way it works is that, during the startup of the Mosquitto addon the first time it generates the homeassistant user and the addon user with a random password and stores those values in /data/system_user.json. For future starts of the addon, the values are read from this file instead. These values are automatically pushed to /etc/mosquitto/pw and /etx/mosqutto/acl during startup of the Mosquitto addon container. You can see the process in the startup script for the addon: https://github.com/home-assistant/addons/blob/master/mosquitto/rootfs/etc/cont-init.d/mosquitto.sh These are then sent to Home Assistant via the service discovery API so that other addons can use this API. You can see this in the discovery script of the Mosqutto addon: Basically, it should never be required for an addon to require manual MQTT user configuration since the addon user can be discovered as part of the MQTT service discovery API, and this is exactly what ring-mqtt does. Of course, if something is going wrong with this process, it's completely outside of ring-mqtt, all ring-mqtt does is use the API, via bashio, to get the username/password for the addon user which was automatically generated by the Mosquitto addon and pushed to the API. Other than via this services API, I don't believe the "addon" user is visible because it is not a Home Assistant user, it only exist within the Mosquitto addon. |
Interestingly, I found this issue: Which also has a link to a similar, recent (in the last week) issue with unauthorized user from Zigbee2MQTT as well: Both which happened after recent Mosquitto addon update, however, that thread indicates that this can be solved by verifying that the supervisor engine is fully updated. The 2022.08.5 update for the supervisor was released like 2 weeks ago. Are you definitely running the latest supervisor update? |
Well, after reading a little more, it doesn't seem like supervisor 2022.8.5 is the full fix, but something is definitely not right, lots of people having issues. I'll assume they'll eventually get it fixed, but definitely outside of ring-mqtt itself so I'd follow that issue. |
Thanks for all this info. I didn't know the addons uid was hidden so that explains it not showing up in my users list. I also didn't know that doing a restart from the UI didn't fully restart HA. I tried cycling the VM that HA is running in. It came back up without any problems but the issue is still there. It's interesting to know that other MQTT add-ons are seeing this problem also. I'm wondering if there's a way to roll back the Mosquitto update to the previous version? It would be good to get ring-mitt running again as I have built lots of automations that rely on it reporting the state of ring contact sensors. Thanks again for all your help. |
Found this in the Mosquitto Broker changelog.. 6.1.0 Update mosquitto to 2.0.11 |
Yes but only applies "if you have a heavily customized mosquitto config", which I'm assuming you do not, so unless you do, it's not likely to be the issue. Also, 6.1.0 was released in May, not really recently. The only recent update, on Aug 30th, was a very minor change in timestamp logging. I feel like that's unlikely to be the issue. Note that you can always follow the instructions above to manually create a user and password and define that in the MQTT URL of ring-mqtt. As I said, there's nothing really wrong with that approach, it just shouldn't technically be required, but troubleshooting the automatic user creation and service discovery when it goes wrong seems to be difficult for most people, likely because there is very little public facing user information about it. |
To be clear on this, it does restart HA itself, but what doesn't restart is all of the addons, because they are in their own containers. There is an option to reboot the host from the HA UI, but it's pretty well hidden and a lot of people don't know about it, under Settings...System...Hardware you can click the three dots and reboot host is there. Perhaps it's somewhere else that's more visible and I just don't know it. |
Can you verify you specific settings for Mosquitto addon and ring-mqtt addon, specifically, what are your settings for Start on Boot and Watchdog config options? |
I did customize the MQTT URL setting in ring-mqtt. I created a new user then substituted those credentials in place of auto_username and auto_password in the URL. That seems to be working now. ring-mqtt has enumerated my Ring devices. This is very odd as I tried this before first posting here and it did not work, but that was before I restarted the VM so maybe that indeed was the problem. The auto config still isn't working but at least I've found a work around with your help. I'm very, very grateful.. |
Glad you got it working, even with a workaround. One of the "joys" of Home Assistant is that it constantly breaks. The recent update of ZwaveJS2Mqtt broke my Z-wave devices, not due to the MQTT side, but due to the update Z-wave driver because they moved from v6.15 to v7.0.0 while calling the addon only a minor bump. Fortunately I always make and keep backups so I was able to easily revert to the prior version and it worked again. I'm honestly close to giving up on HA as these days I find I use it mostly begrudgingly as I just don't agree with much of the direction of the project, but I guess it's still the best open source/free home automation project at this time and I already have all of my automations there, but it breaks for me on average 3-4x times a year for no real benefit that I see and that's just annoying. |
Ha, I hear ya. I always read the breaking changes but things like this one fall through the cracks. Reminds me of the good old, bad old days of Windows, where you'd update a video driver and the network would stop working. So you'd update the network driver and lose your sound card. Ugh. Ive used several home automation systems over the years and Home Assistant is by far the most comprehensive and just over the last 3 years it's got so much easier to use. I'm going to stick with it but your comment about frequent backups is absolutely golden advice. Thanks again for all your help. It's really great when folks respond like this. Makes a huge difference. |
So my question is I have Homeassistant OS on Raspberry PI 4 |
MQTT setup is pretty straightforward, so it's difficult to offer a lot of suggestions that aren't just a Google search away. When attempting to troubleshoot the issue you should look at the logs from both the client (ring-mqtt) and the server (mosquitto) and between those it should be pretty clear what the problem is. As already mentioned in this thread, the auto_username and auto_password features seems to be having a problem for some users that appears to have been caused by some changes in Home Assistant, but I can't reproduce this issue. I only use automatic configuration with default addon options for both Mosquitto and ring-mqtt addons (Start on Boot, Watchdog disabled) and both my production and development instances still work just fine. My gut says it's perhaps some other issue caused by other HACS components delaying startup, but, again, I'm not 100% sure since I can't reproduce it. Regardless, if you manually set the username/password on the Mosquitto addon you must also replace the auto_username/auto_password options with that username/password. I wouldn't replace anything else in the URL. The MQTT URL has nothing to do with HTTP or web browser, the URL defines how ring-mqtt should connect to the MQTT broker. |
Thank You I did that s6-rc: info: service s6rc-oneshot-runner: starting |
That log shows no clients even attempting a connection to the broker, you need to verify your MQTT settings and make sure the MQTT URL is correct. |
Perhaps more importantly, it doesn't even show Home Assistant connecting to the broker so it doesn't matter if ring-mqtt connects to the broker or not. |
I will have to T/S further when I get home possibly enable debugging on the Broker |
12:22:55] INFO: Successfully send service information to the Supervisor. |
Broker debugging is rarely required to solve simple connection problems, this stuff is very, very basic. I noticed you keep editing logs and removing stuff, but that makes it almost impossible to help you troubleshoot, so, if you want help here, you'll need to post your logs. I noticed that you had two clients:
It looks like the first client is the Home Assistant integration and the second clients is probably ring-mqtt (unless you have some other addon that also uses MQTT and uses the mqttjs library). It appears that you've configured a username, but are using uppercase in one place and lowercase in another, in general, usernames are case sensitive. Also, if you are using any special characters in the password that are valid in a URL, you will need to manually URL encode them. |
I corrected the username - it is same in both but this does not change s6-rc: info: service s6rc-oneshot-runner: starting |
2022-09-12T23:55:43.742Z ring-attr [Front Door] ring/89b81f0f-89e0-4256-be09-1dc90f5177fa/camera/78db2f0c1b96/battery/attributes {"batteryLevel":"99"} |
I'm not sure why you decided to post a random segment of the log, but it shows that ring-mqtt is working as expected. |
tried copying the whole ring-mqtt log - I am still trying to T/S Mqtt Broker - checking all logs I have Rebooted Host , I do not have any other mqtt things - I have Zwavejs with zigbi on the USB stick. I am wondering if I am having problems with those ports like 1883 |
There's no problem with the ports as the logs you posted show a fully working ring-mqtt as it will not send data to the MQTT broker unless it has successfully made the connection to the broker, so it has clearly established the connection to MQTT. Of course that's only half of the requirement as the HA Mosquitto integration must also make a connection and read the data. Unfortunately, I can't help you troubleshoot your MQTT issues beyond ring-mqtt, which the logs you posted clearly showed is working. You might consider uninstalling everything, removing the Mosquitto addon and HA integration, and reinstalling everything from scratch following the instructions and don't change any defaults, that should be all that is required. |
Ok thanks - I activated Debugging and now see time="2022-09-12T20:40:56-04:00" level=debug msg="found in cache: mqtt-0517" 2022-09-12 20:41:59: Sending PUBLISH to 75I6DfGSHP4XvdKHiJh92G (d0, q0, r0, m0, 'ring/89b81f0f-89e0-4256-be09-1dc90f5177fa/camera/78db2f0c1b96/ding/attributes', ... (61 bytes)) |
I will consider starting from scratch - Thank You very much |
The above clearly shows ring-mqtt working, which means the messages are not getting to HA for whatever reason. Good luck! |
Obvious question but they are often the hard ones to ask yourself. Have you installed the MQTT integration as well as the Moquitto add-on?
… On Sep 12, 2022, at 5:47 PM, tsightler ***@***.***> wrote:
The above clearly shows ring-mqtt working, which means the messages are not getting to HA for whatever reason.
—
Reply to this email directly, view it on GitHub <#450 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADH477YRBWUGMZE3J4M6VYDV57FL3ANCNFSM6AAAAAAQEDA6MQ>.
You are receiving this because you commented.
--
All content is personal opinion. All content is copyright. All rights are
reserved. No reproduction in any form is allowed without prior written
permission
|
hdprice Under my intergrations I have only this and the ring |
Other question ? Does this need 1883 & 1884 (insecure) |
Assuming you are using defaults (you appear to be) only 1883 is used, but none of that should matter since all of that is needed only locally on the host, nothing externally is needed. Also, the logs you've posted clearly show both the HA client and the ring-mqtt client connecting to the MQTT broker successfully. Actually, your most recent screenshots appear to show a fully working setup, perhaps you should describe more clearly what exactly is not working. Even your screenshot above of the Mosquitto broker shows 21 devices. |
With the debugging of MQTT Mosquito Broker enabled there is communication with Broker to HA and ring-mqtt. |
It’s not required to set up ACL security. I haven’t done this on my deployment and it’s working as expected.
… On Sep 15, 2022, at 8:10 AM, gdg316 ***@***.***> wrote:
Does anyone know if these are necessary steps in the configuration of Mosquitto Broker ??
<https://user-images.githubusercontent.com/67116557/190440484-b8a280d3-4d99-4a52-b5d2-6e7173f87449.png>
—
Reply to this email directly, view it on GitHub <#450 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADH4775UVJ4KQLF44FG3QW3V6M37ZANCNFSM6AAAAAAQEDA6MQ>.
You are receiving this because you commented.
--
All content is personal opinion. All content is copyright. All rights are
reserved. No reproduction in any form is allowed without prior written
permission
|
Thanks I turned debugging off and seems to be issue with the MQTT Plugin, created ticket under Add on's |
They are not required, the vast majority of users leverage 100% defaults. The only thing I have different from defaults in my setup is that I use SSL/TLS to secure the connection to MQTT, but that's it. Everything in this addon is designed to work with just the default setup and thousands of users have managed to get it to work without issue. If you simply install everything with defaults it should work. If you do choose to use custom topic ACLs then you'll need to make sure that the accounts that you use have access to all topics, but since you can't even get the basic setup to work, I would strongly suggest not going down that path. I am going to lock this issue. I've noticed that you've opened at least three issues on the HA github, mulitple issues here, one issue on the MQTT Github. This is not proper community behavior and I'm finding it impossible to help you, as are all of the people on the other issues that you've created because you fail to communicate with useful information, fail to follow advice people give you, fail to respond to questions being asked, etc. Rather, you just randomly open issues on various projects hoping people will help you. If you truly want assistance to solve this issue, please open a new discussion thread (not an issue), communicate clearly what specifically is not working, what steps you've taken (did you reinstall all MQTT components using defaults as asked), and provide the logs and screenshots that people request to be able help you, and, most importantly, take the advice of the people who are attempting to help you and quit trying to do your own thing which clearly isn't working and is just wasting people's time. Failure to adhere to this request will force me to consider banning you from this repository. |
2022-09-04T00:04:20.333Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:20.339Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:21.341Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:21.347Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:22.351Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:22.357Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:23.360Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:23.366Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:24.369Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:24.376Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:25.379Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:25.386Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:26.388Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:26.395Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:27.399Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:27.406Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:28.409Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:28.419Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:29.422Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:29.429Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:30.433Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:30.440Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:31.443Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:31.453Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:32.458Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:32.467Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:33.469Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:33.478Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:34.481Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:34.487Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:35.490Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:35.497Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:36.500Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:36.508Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:37.511Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:37.519Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
2022-09-04T00:04:38.521Z ring-mqtt Attempting to reconnect to MQTT broker...
2022-09-04T00:04:38.530Z ring-mqtt Unable to connect to MQTT broker Connection refused: Not authorized
The text was updated successfully, but these errors were encountered: