MQTT not working 0.47.1 > 0.48.0 UPGRADE

Hey Guys,

Even after a fresh/clean install of python & ha I get this:

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'

Roll back to 0.47.1 and works as usual

Any suggestions

Thanks Rob.

I have the same issue; using the embedded MQTT broker:

    2017-07-01 20:40:22 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
    result = next(coro)
  File "/home/homeassistant/.homeassistant/deps/hbmqtt/broker.py", line 336, in stream_connected
    yield from self.client_connected(listener_name, StreamReaderAdapter(reader), StreamWriterAdapter(writer))
  File "/home/homeassistant/.homeassistant/deps/hbmqtt/broker.py", line 469, in client_connected
    yield from self.publish_retained_messages_for_subscription(subscription, client_session)
  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'

Yes same built in Broker

I can’t add anything useful except to say mqtt is broken for me as well.

Just upgraded. I use a separate MQTT broker. All OK.

1 Like

From another post to get MQTT working again comment out tls_insecure: True in the config file and MQTT should work again.

1 Like

I am using the embedded broker as well and did NOT have tls_insecure: True line in my configuration. Getting the same error messages as @buzzeddesign:

2017-07-02 23:49:52 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
    result = next(coro)
  File "/home/homeassistant/.homeassistant/deps/hbmqtt/broker.py", line 336, in stream_connected
    yield from self.client_connected(listener_name, StreamReaderAdapter(reader), StreamWriterAdapter(writer))
  File "/home/homeassistant/.homeassistant/deps/hbmqtt/broker.py", line 469, in client_connected
    yield from self.publish_retained_messages_for_subscription(subscription, client_session)
  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'

configuration.yaml has no additional attributes or settings:

mqtt:

Same - my configuration.yaml is
mqtt:
With no additional settings

Yes i have got the same problem.

mqtt:

Thanks

This solved it

Sometimes mqtt is disabled after upgrading hassbian. Do the following and restart home assistant

sudo systemctl enable mosquitto.service
sudo systemctl start mosquitto.service

Just added tls_insecure: true And still not working.

Using embedded MQTT

Same problem here :frowning: using default MQTT and after update it stoped working.
I also dont have tls_insecure: True in my config file.

Same problem for me. Tried adding tls_insecure: False to see what would happen

I also tried that… and didn’t work :frowning:

My embedded MQTT service seems to be broken too, nothing relevant seems to be listed in my logs though.

I’m also having no luck with MQTT.

from my configuration.yaml file all I have for mqtt is:

# Enable MQTT server mqtt:

However, my situation is more severe in that the UI is also not starting. There’s also nothing in the log file. So it seems like HA isn’t starting at all.

If I look at the processes running I see some unusual activity:
homeass+ 1352 1 0 21:24 ? 00:00:06 /srv/homeassistant/homeassistant_venv/bin/python3 /srv/homeassistant/homeassistant_venv/bin/hass -c /home/homeassistant/.homeassistant homeass+ 1369 1352 0 21:24 ? 00:00:02 /srv/homeassistant/homeassistant_venv/bin/python3 -m pip install --quiet paho-mqtt==1.3.0 --upgrade --target /home/homeassistant/.homeassistant/deps --constraint /srv/homeassistant/homeassistant_venv/lib/python3.4/site-pac postgres 1371 619 0 21:24 ? 00:00:00 postgres: homeassistant homeassistant [local] idle homeass+ 1377 1369 0 21:24 ? 00:00:04 /srv/homeassistant/homeassistant_venv/bin/python3 -c import setuptools, tokenize;__file__='/tmp/pip-build-tz5j4v8k/paho-mqtt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close

I don’t think I should be seeing the paho-mqtt install sitting there. I wonder if that is blocking HA from starting.

I also don’t recognize the python3 import setuptools process. I’ve not seen that before. Should that be there?

Anyway, I’ll keep poking around to see what’s going on. I hope this provides a clue.

OK. I rebooted HA a few times and waited. Now the UI starts, but I still don’t have MQTT working. Like the others stated, there’s nothing in the logs about MQTT either.

They found the issue over at the GitHub issue tracker. If you add

client_id: some_random_value

to the mqtt: configuration it will fix the issue, i.e.

mqtt:
  client_id: 1234

It has something to do with a change in the new paho-mqtt client.

4 Likes