Skip to content
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

[mqtt] Exception occurred while initializing handler of thing mqtt broker #13356

Closed
EnziinSystem opened this issue Sep 5, 2022 · 5 comments
Closed

Comments

@EnziinSystem
Copy link

EnziinSystem commented Sep 5, 2022

My environment:

  • Debian 10 run on BeagleBoard-X15
  • Java: Runtime Environment Zulu11.56+19-CA (build 11.0.15+10-LTS)
  • OpenHAB 3.4.0 Build 2986
  • mosquitto version 2.0.12

I install and configure and it works well for some weeks.

Today, the MQTT broker thing stop working with the error message:

2022-09-05 04:11:59.128 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'mqtt:broker:cd4df6f8f9': protocol
java.lang.NoSuchFieldError: protocol
	at org.openhab.binding.mqtt.handler.BrokerHandler.createBrokerConnection(BrokerHandler.java:203) ~[?:?]
	at org.openhab.binding.mqtt.handler.BrokerHandler.initialize(BrokerHandler.java:238) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
	at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

P1
P2

Check healthy mosquitto service, it works.

sudo systemctl status mosquitto.service
* mosquitto.service - Mosquitto MQTT Broker
   Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-09-05 03:55:52 UTC; 42min ago
     Docs: man:mosquitto.conf(5)
           man:mosquitto(8)
  Process: 606 ExecStartPre=/bin/mkdir -m 740 -p /var/log/mosquitto (code=exited, status=0/SUCCESS)
  Process: 621 ExecStartPre=/bin/chown mosquitto /var/log/mosquitto (code=exited, status=0/SUCCESS)
  Process: 625 ExecStartPre=/bin/mkdir -m 740 -p /run/mosquitto (code=exited, status=0/SUCCESS)
  Process: 627 ExecStartPre=/bin/chown mosquitto /run/mosquitto (code=exited, status=0/SUCCESS)
 Main PID: 628 (mosquitto)
    Tasks: 1 (limit: 3370)
   Memory: 1.9M
   CGroup: /system.slice/mosquitto.service
           `-628 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

I re-install the MQTT broker but the error still while I can control devices via zigbee2mqtt and view topics by MQTT Exprorer

@J-N-K J-N-K transferred this issue from openhab/openhab-core Sep 5, 2022
@wborn
Copy link
Member

wborn commented Sep 6, 2022

Does it work if you recreate the broker thing?

@wborn wborn changed the title [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing mqtt broker [mqtt] Exception occurred while initializing handler of thing mqtt broker Sep 6, 2022
@EnziinSystem
Copy link
Author

I re-install the MQTT broker but the error still.
After I downgrade to 3.3.0 and install everything then it works.

@wborn
Copy link
Member

wborn commented Sep 6, 2022

No I mean the Thing in openHAB, not the actual broker. 😉

@wborn wborn added the awaiting feedback Awaiting feedback from the pull request author label Sep 18, 2022
@jimtng
Copy link
Contributor

jimtng commented Sep 20, 2022

I encountered this problem just now whilst running a pre-M1 3.4 snapshot. I think it was triggered by an addon install, i.e. I added an addon to my addons.cfg.

It was resolved by updating to the latest snapshot #3088 and restarting my docker with docker-compose up -d.

@wborn
Copy link
Member

wborn commented Sep 20, 2022

You probably run into this issue if you run an old openHAB snaphot that has a core without the changes of openhab/openhab-core#3068. If you use the online repo for installing add-ons, you'll always install the latest add-on snapshot version. So if you then install the MQTT add-on that has #13303 you'll get the exception. So upgrading openHAB to a more recent snapshot version should fix it.

@wborn wborn closed this as completed Sep 20, 2022
@wborn wborn removed the awaiting feedback Awaiting feedback from the pull request author label Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants