Open YokaiRick opened 3 years ago
Just wanted to say, that its my first time reporting here, so if i missed sth relavent please reach out to me. And thanks for working on openhab i rly love it!
Hello all, I have a similar issue here. After rebooting my Ubuntu server, the xmpp binding sometimes has problems in DNS resolving. Instead of retrying after some time, it shuts down itself. In this case, the xmpp binding is not useable until restarting it. It would be nice, if the binding tries to reconnect after some time.
2021-08-30 01:12:35.255 [INFO ] [org.openhab.ui.internal.UIService ] - Started UI on port 8080
2021-08-30 01:12:41.191 [INFO ] [e.automation.internal.RuleEngineImpl] - Rule engine started.
2021-08-30 01:12:45.819 [INFO ] [internal.ModuleHandlerFactoryStarter] - WebPushNotificationModuleHandlerFactory started by ModuleHandlerFactoryStarter
2021-08-30 01:12:46.154 [INFO ] [hab.ui.habot.tile.internal.HABotTile] - Started HABot at /habot
2021-08-30 01:12:46.282 [INFO ] [ab.ui.habpanel.internal.HABPanelTile] - Started HABPanel at /habpanel
2021-08-30 01:12:46.452 [WARN ] [software.smack.tcp.XMPPTCPConnection] - shutdown
java.lang.NullPointerException: null
at org.jivesoftware.smack.tcp.XMPPTCPConnection.shutdown(XMPPTCPConnection.java:538) [bundleFile:4.3.3]
at org.jivesoftware.smack.tcp.XMPPTCPConnection.instantShutdown(XMPPTCPConnection.java:507) [bundleFile:4.3.3]
at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:426) [bundleFile:4.3.3]
at org.openhab.binding.xmppclient.internal.XMPPClient.connect(XMPPClient.java:87) [bundleFile:?]
at org.openhab.binding.xmppclient.internal.handler.XMPPClientHandler.doConnect(XMPPClientHandler.java:90) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
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:834) [?:?]
2021-08-30 01:12:46.471 [INFO ] [t.internal.handler.XMPPClientHandler] - XMPP connection error org.jivesoftware.smack.SmackException$ConnectionException: The following addresses failed: 'gruenbaer.net:5222' failed because: java.net.UnknownHostException: gruenbaer.net: Temporary failure in name res olution
at org.jivesoftware.smack.SmackException$ConnectionException.from(SmackException.java:292) ~[bundleFile:4.3.3]
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectUsingConfiguratio n(XMPPTCPConnection.java:658) ~[bundleFile:4.3.3]
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:938) ~[bundleFile:4.3.3]
at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:417) ~[bundleFile:4.3.3]
at org.openhab.binding.xmppclient.internal.XMPPClient.connect(XMPPClient.java:87) ~[bundleFile:?]
at org.openhab.binding.xmppclient.internal.handler.XMPPClientHandler.doConnect(XMPPClientHandler.java:90) [bundleFile:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
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:834) [?:?]
2021-08-30 01:42:45.017 [WARN ] [jivesoftware.smackx.ping.PingManager] - XMPPConnection was not authenticated
I just made a new draft for XMPPclient binding. If possible could you test and let me know if the problem you have still exists? openHAB 3.4.2: https://1drv.ms/u/s!AnMcxmvEeupwjqVFDy9C1Eh--QOA5g?e=P1pKSa openHAB 4.0.0: https://1drv.ms/u/s!AnMcxmvEeupwjqVFDy9C1Eh--QOA5g?e=7j3aZM
source is here: https://github.com/lsiepel/openhab-addons/tree/xmpp-reconnect
If the problem remains or you encounter some regression, providing a debug log would help me fix it.
It has two changes:
uhh nice, i actually thought if i should tackle the problem in my next bigger free time slot. gonna check it out, but it could take some time, dunno if i can test sth before weekend. just for your info
I can't test it 100% cause the xmpp server is does not restart every day anymore, but a 180 sec reconnect interval sounds reasonable. why not give it a try and make pull request :)
I’d like to have it tested (atleast for regression) before I file it as PR.
you could simate the test by dropping the connection (temporary firewall block or disable internet for a minute )
Finally had time to spin up a test instance. mhh i'm currently getting this dependency error while using your build for 3.4.2
- Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.xmppclient-3.4.2-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.xmppclient [285]
Unresolved requirement: Import-Package: org.jivesoftware.smack; version="[4.3.0,5.0.0)"
mhh it did mention version 4.3.0-5.0.0.. but there is only an very old version at mavenrepository.. shouldn't it point to igniterealtime's smack?
I think i have seen this somewhere before, guess this is a bug in oh core, that won't load the dependencies when a jar is dropped in. Let me check for a solution. Maybe @jlaur has some suggestions.
I think i have seen this somewhere before, guess this is a bug in oh core, that won't load the dependencies when a jar is dropped in. Let me check for a solution. Maybe @jlaur has some suggestions.
I believe it can be fixed by dropping the required packages in the addons directory also. At least this is how I managed to get the JDBC persistence service working with the MySQL driver.
I believe it can be fixed by dropping the required packages in the addons directory also. At least this is how I managed to get the JDBC persistence service working with the MySQL driver.
See also: https://community.openhab.org/t/oh4-dependency-bundles-not-included-anymore/144288
@YokaiRick did you have the oppertunity to test it?
Hi,
I'm sure not on the right place but i also encounter some xmpp issues with openhab 3.4.2. Have asked several times in the openhab community but no help. So please have you some time to help me out?
This is my problem. When starting openhab a connection with the Xmpp server was succesful but after 30 minutes the connection is aborted and reestablished again... but i have a feeling that only the first x seconds of the rebuilt connection there is some communication possible?
Please start a new issue on github with debug logs, versions and all details about the issue. Not sure if i can help you out, but that is the best starting point.
@lsiepel its merged, but not relased yet ^^v i did try to build your version, i also downloaded your version, but then i ended in a dependency hell. Sadly I'm not a java dev and never build a java application before, so... i'm stuck ^^v
how about we close this issue, and if i see that it reapers, i'll repoen the issue?
I’ll try to get you a working jar/kar for 4.0m1 It is not merged so it will not become available unless it is tested. Thanks for your first efforts. I hope to get you the files tomorrow.
Expected Behavior
If an XMPP Server gets unreachable due to an error or server restart, the binding should connect again after the xmpp server is up again.
Current Behavior
I use a friends xmpp server and it seems it gets rebootet every night. Due to the reboot, the bridge losses its connection and try to connect only one time with a timeout after 5 secs. My only workaround right now is to restart the binding every morning. I know that its not common to restart an xmpp server every night, but this behavoiur should also apear for other people if the connection gets lost for more than 5 secs. In the WebUI the Binding shows itself as online even it is not connected after that connection lost.
Here are some logs during that time:
Possible Solution
One Solution could be that the connection timeout or some kind of retry limit is configurable Another one would be to try to reconnect every 5 - 15 Minutes
Steps to Reproduce (for Bugs)
Context
My current workaround is to restart the binding every morning via an cronjob. This works pretty well, but yeah daily restarts are not the best solution. Also for other ppl such an timeout/unreachable scenario could happen any time.
Your Environment