-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
Embedded MQTT Broker failing on 0.48.0 #8315
Comments
Happening here too:
Raspbian jessie on Pi 3 with |
Also having this issue, per the original post in the forums. Will add here that |
I'm trying to reproduce this issue, but I could use some help on troubleshooting. I'm running a clean install of HA, off of the 0.48 branch. I've added the following to my configuration.yaml: 80 mqtt:
81
82 sensor:
83 - platform: mqtt
84 state_topic: "home/bedroom/temperature" And I'm able to run HA |
I'm using the When I comment out the When I look on one of my MQTT Sensors I see that they can connect to the broker. So this seems to be started (I can see a python3 listener on port 1883 as well with Do you get any readings from your test sensor? |
My dummy sensor doesn't have any data in it, i'm pretty new to MQTT in general, so I'm just trying to bootstrap my setup. I was able to get a similar error when shutting down my dev server: 2017-07-03 14:19:42 ERROR (Dummy-3) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 179, in _step
result = coro.send(None)
File "/Users/kw/python3/hass/lib/python3.6/site-packages/hbmqtt/broker.py", line 666, in _broadcast_loop
handler.mqtt_publish(broadcast['topic'], broadcast['data'], qos, retain=False),
AttributeError: 'NoneType' object has no attribute 'mqtt_publish'
Exception ignored in: <generator object ProtocolHandler.mqtt_deliver_next_message at 0x10699e780>
Traceback (most recent call last): But I haven't been able to reproduce the error. The only change I've seen in the change log in 0.48 was upgrading the mqtt client (#8125). I don't know why this would raise an exception in the broker, but I was going to try to get something that was consistently reproducible, then try downgrading the mqtt client. |
I am using mosquitto and mqtt has stopped working after I updated from 47.1 > 48. I am using AIO on a RP3. I can get it working again by commenting out When not working my log file shows
|
That does appear to be an something that is called out in 1.2.3 to 1.3.0 in paho-mqtt changelog (BREAKING tls_insecure_set() must now be called after tls_set().). @matust7 can you put your config for your mqtt section into a gist and link it here? |
@karlw00t I can be more help tonight, I'm about to walk out the door to work. This is my mqtt setup
|
i was able to reproduce something similar by creating a slider that tries to push it value to mqtt. When i try to shutdown hass, i get this error: Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py", line 179, in _step
result = coro.send(None)
File "/Users/kw/python3/hass/lib/python3.6/site-packages/hbmqtt/broker.py", line 666, in _broadcast_loop
handler.mqtt_publish(broadcast['topic'], broadcast['data'], qos, retain=False),
AttributeError: 'NoneType' object has no attribute 'mqtt_publish' i downgraded the paho-mqtt client to version to 1.2.3, and I'm still getting the above error. Which makes sense, the above error is in the broker, not the client. |
Just to put a fine tip on it, downgrading to 0.47, everything work as expected and I don't get an error on shutdown. |
Here's my setup that I'm using to troubleshoot: mqtt:
tls_insecure: false
sensor:
- platform: mqtt
state_topic: "home/bedroom/temperature"
input_slider:
target_temp:
name: Target Heater Temperature Slider
min: 1
max: 30
step: 1
unit_of_measurement: step
icon: mdi:target
automation:
- alias: Temp slider moved
trigger:
platform: state
entity_id: input_slider.target_temp
action:
service: mqtt.publish
data_template:
topic: "home/bedroom/temperature"
retain: true
payload: '{{ states.input_slider.target_temp.state | int }}' $ git checkout 0.48 |
it's possible that the upgraded client is also causing issues. From the changelog:
But in (https://github.com/beerfactory/hbmqtt/blob/master/hbmqtt/broker.py#L747), the client id does a truthy check, and a zero length client id evaluates to False, and returns None from the |
I added a I added this: client_id: 1234 |
I'm using mosquitto rather than the embedded mqtt so I am probably not the best person to test this. My setup already had |
No probs, thanks |
I can confirm that adding 👍 |
Adding the client_id line fixed it for me as well |
Hey Guys, client_id is also working for me, which is strange because according to the HA doc https://home-assistant.io/docs/mqtt/broker/#embedded-broker Cheers Rob. |
This is from the paho-mqtt client:
The client defaults to
I'd like for someone a little more clueful to take a look at this before I open a issue with hbmqtt, but it looks like hbmqtt should either reject the zero length client id or generate a unique id for the client. |
@halfluck it appears that was a behavior of paho-client 1.2.3. This is from that tag in their git repo:
|
Hey Guys, I'm still getting this error after upgrading to 0.48.1, If i manually add client_id to the config.yaml goes away and mqtt works. Thanks Rob.
|
Yes, I completely understand. I'm not sure why for me in 2 different environments it fails if only mqtt: is in the config. |
@halfluck: sorry if that came out wrong. The failure seems not to be your configuration but the fix simply doesn't seem to fix the case when a completely empty |
That's great, thanks for confirming. |
This applies what was the intended fix in home-assistant#8336. moves the fallback for setting client_id to the case when no mqtt config was provided at all. This should reflect the most common use case that fails. This commit should be reverted when hbmqtt is fixed to allow empty client_id again.
This applies what was the intended fix in #8336. moves the fallback for setting client_id to the case when no mqtt config was provided at all. This should reflect the most common use case that fails. This commit is a workaround and should be reverted when hbmqtt is fixed to allow empty client_id again.
Hi, |
home-assistant#8336) * Temporary fix for the client_id generation (fixes home-assistant#8315) * Fix comment * Move client id setting. * Lint
This applies what was the intended fix in home-assistant#8336. moves the fallback for setting client_id to the case when no mqtt config was provided at all. This should reflect the most common use case that fails. This commit is a workaround and should be reverted when hbmqtt is fixed to allow empty client_id again.
Hey Guys,
There is quite a bit of chatter here about 0.48 Breaking the Embedded MQTT Broker ==> https://community.home-assistant.io/t/mqtt-not-working-0-47-1-0-48-0-upgrade/20824
Here is my log
2017-07-02 11:04:53 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "C:\Python36\lib\asyncio\tasks.py", line 179, in _step result = coro.send(None) File "C:\Users\Halfluck\AppData\Roaming.homeassistant\deps\hbmqtt\broker.py", line 336, in stream_connected yield from self.client_connected(listener_name, StreamReaderAdapter(reader), StreamWriterAdapter(writer)) File "C:\Users\Halfluck\AppData\Roaming.homeassistant\deps\hbmqtt\broker.py", line 469, in client_connected yield from self.publish_retained_messages_for_subscription(subscription, client_session) File "C:\Users\Halfluck\AppData\Roaming.homeassistant\deps\hbmqtt\broker.py", line 719, in publish_retained_messages_for_subscription handler.mqtt_publish( AttributeError: 'NoneType' object has no attribute 'mqtt_publish'
and another users
File "/home/homeassistant/.homeassistant/deps/hbmqtt/broker.py", line 719, in publish_retained_messages_for_subscription
handler.mqtt_publish(
AttributeError: 'NoneType' object has no attribute 'mqtt_publish'
Thanks Rob.
The text was updated successfully, but these errors were encountered: