openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.9k stars 3.59k forks source link

[mqtt] Erroneous Shutdown Warnings for EspMilight, HomeAssistant, Homie Discovery Services #10562

Closed andrewfg closed 3 years ago

andrewfg commented 3 years ago

The MQTT AbstractBrokerHandler produces erroneous logger warnings when OH is being shutdown for the EspMilight, HomeAssistant, and Homie, discovery services. The messages are either "Tried to unsubscribe .. but topic not registered at all." or "Tried to unsubscribe .. but topic not registered for listener". See logs below.

One hypothesis may be that the over-riding EspMilight, HomeAssistant, and Homie classes are implementing discovery services which are (un)subscribing their respective topics (or not), and that the overidden AbstractBrokerHandler base class is not being made aware of the success or failure of this. Or something like that :)


Homie

2021-04-23 15:02:00.011 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@98ea9b from  discovery topic homeassistant/# on broker mqtt:broker:g24 but topic not registered for listener. Check discovery logic!

2021-04-23 15:02:00.023 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homie.internal.discovery.Homie300Discovery@98ea9b from  discovery topic milight/states/# on broker mqtt:broker:g24 but topic not registered for listener. Check discovery logic!

HomeAssistant

2021-04-23 15:02:00.043 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1d7aa46 from  discovery topic +/+/$homie on broker mqtt:broker:g24 but topic not registered at all. Check discovery logic!

2021-04-23 15:02:00.044 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1d7aa46 from  discovery topic milight/states/# on broker mqtt:broker:g24 but topic not registered for listener. Check discovery logic!

2021-04-23 15:02:00.047 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1d7aa46 from  discovery topic homeassistant/# on broker mqtt:broker:g24 but topic not registered at all. Check discovery logic!

2021-04-23 15:02:00.048 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1d7aa46 from  discovery topic +/+/$homie on broker mqtt:broker:g24 but topic not registered at all. Check discovery logic!

2021-04-23 15:02:00.050 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.homeassistant.internal.discovery.HomeAssistantDiscovery@1d7aa46 from  discovery topic milight/states/# on broker mqtt:broker:g24 but topic not registered for listener. Check discovery logic!

EspMilight

2021-04-23 15:02:00.119 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.espmilighthub.internal.discovery.EspMilightHubDiscoveryService@1e70fcb from  discovery topic homeassistant/# on broker mqtt:broker:g24 but topic not registered at all. Check discovery logic!

2021-04-23 15:02:00.121 [WARN ] [g.mqtt.handler.AbstractBrokerHandler] - Tried to unsubscribe org.openhab.binding.mqtt.espmilighthub.internal.discovery.EspMilightHubDiscoveryService@1e70fcb from  discovery topic +/+/$homie on broker mqtt:broker:g24 but topic not registered at all. Check discovery logic!
openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/mqtt-strange-logger-warnings-on-oh-shutdown/121228/16

andrewfg commented 3 years ago

I think I may already have found a solution. I will test it for a while, and then open a Pull Request.

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/oh3-mqtt-somtimes-issues-after-starting/113104/10

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/oh3-mqtt-somtimes-issues-after-starting/113104/12

openhab-bot commented 3 years ago

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/broken-homeassistant-mqtt-discovery/125102/8