I had problems between the end of April until last weekend. Since my openHAB installation was not updated during this period, I strongly believe that the problem was caused by an OS update. The problems started after I received an OS update and disappeared after another one. So my understanding is that the problems should be independent of openHAB and a router. It’s just a guess, but updating the OS as soon as possible can’t be wrong. I appreciate feedback if anyone has had the same experience.
yfre
(eugen)
May 26, 2021, 2:57pm
104
openHAB 3.0 and binding have upgraded the mDNS library. new version library has fixed some issue, but maybe added new once.
one of the most prominent is that one, which got fixed 9 days ago (but not released yet)
opened 04:17PM - 10 Jan 21 UTC
bug
## Current Behavior
I am using the Homekit binding to make approx. 50 openHAB i… tems available for control via Siri. After a seemingly random amount of time - mostly a couple of days - the binding stops working. The symptoms are that the Home app flags all items with "no response".
We have two HomePods and an Apple TV. All three are listed as Homekit hubs in the Home app settings. We tried to reboot the device shown as "connected" (as opposed to "standby") in the Home app settings when the problem occurred. But that didn't help.
If I check Karaf console, I can see that a ConcurrentModificationException has been logged. The following is an abbreviated copy & paste of my Karaf console output spanning approx two weeks and showing two consecutive incidents. Although I am not 100% sure that the Exception is directly related to the issue it was there every time I checked the server after Homekit stopped working. As can be seen I can correct the issue if I just restart the binding. Seconds later all Homekit items become responsive again.
```
_ _ _ ____
___ ___ ___ ___ | | | | / \ | __ )
/ _ \ / _ \ / _ \ / _ \ | |_| | / _ \ | _ \
| (_) | (_) | __/| | | || _ | / ___ \ | |_) )
\___/| __/ \___/|_| |_||_| |_|/_/ \_\|____/
|_| 3.1.0-SNAPSHOT - Build #2101
...
openhab> Exception in thread "SocketListener(macmini-2012-fritz-box.local.)" java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:997)
at javax.jmdns.impl.DNSCache.getDNSEntry(DNSCache.java:142)
at javax.jmdns.impl.JmDNSImpl.handleRecord(JmDNSImpl.java:1362)
at javax.jmdns.impl.JmDNSImpl.handleResponse(JmDNSImpl.java:1476)
at javax.jmdns.impl.SocketListener.run(SocketListener.java:77)
bundle:list
START LEVEL 100 , List Threshold: 50
ID │ State │ Lvl │ Version │ Name
────┼────────┼─────┼─────────────────────────┼──────────────────────────────────────────────────────────────
...
227 │ Active │ 80 │ 3.1.0.202012260419 │ openHAB Add-ons :: Bundles :: IO :: Homekit
...
openhab> bundle:restart 227
... a couple of days later, no additional output logged ...
openhab> Exception in thread "SocketListener(2a02-908-d81-9640-b0b2-4528-a5a5-dd04-en0.local.)" java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:997)
at javax.jmdns.impl.DNSCache.getDNSEntry(DNSCache.java:142)
at javax.jmdns.impl.JmDNSImpl.handleRecord(JmDNSImpl.java:1362)
at javax.jmdns.impl.JmDNSImpl.handleResponse(JmDNSImpl.java:1476)
at javax.jmdns.impl.SocketListener.run(SocketListener.java:77)
Exception in thread "SocketListener(macmini-2012-fritz-box.local.)" java.lang.NullPointerException
at javax.jmdns.impl.JmDNSImpl.handleRecord(JmDNSImpl.java:1373)
at javax.jmdns.impl.JmDNSImpl.handleResponse(JmDNSImpl.java:1476)
at javax.jmdns.impl.SocketListener.run(SocketListener.java:77)
bundle:restart 227
openhab>
```
## Steps to Reproduce (for Bugs)
Unfortunately this issue seems to happen at random. I do not know of a way to reproduce it at will.
## Your Environment
Here is the output of the Karaf "info" command:
```
Karaf
Karaf version 4.2.7
Karaf home /Users/administrator/openhab/runtime
Karaf base /Users/administrator/openhab/userdata
OSGi Framework org.eclipse.osgi-3.12.100.v20180210-1608
JVM
Java Virtual Machine OpenJDK 64-Bit Server VM version 11.0.9+11
Version 11.0.9
Vendor AdoptOpenJDK
Pid 29796
Uptime 14 days 23 hours
Process CPU time 11 hours 23 minutes
Process CPU load 0.00
System CPU load 0.00
Open file descriptors 323
Max file descriptors 10,240
Total compile time 13 minutes
Threads
Live threads 312
Daemon threads 126
Peak 356
Total started 485947
Memory
Current heap size 371,764 kbytes
Maximum heap size 4,194,304 kbytes
Committed heap size 576,512 kbytes
Pending objects 0
Garbage collector Name = 'G1 Young Generation', Collections = 9834, Time = 58.410 seconds
Garbage collector Name = 'G1 Old Generation', Collections = 0, Time = 0.000 seconds
Classes
Current classes loaded 21,664
Total classes loaded 32,984
Total classes unloaded 11,320
Operating system
Name Mac OS X version 10.15.7
Architecture x86_64
Processors 4
```
I am currently running the 3.1.0-SNAPSHOT of openHAB, but I had this issue with the milestones (and I believe the 3.0 release) as well. It is hard to tell as the milestones sometimes got released faster than the issue usually appears.
As can be seen on the Karaf output the system I am running openHAB on is a mac Mini 2012 running macOS Catalina. The system is used exclusively for openHAB.
opened 06:35PM - 31 Oct 20 UTC
closed 05:47PM - 18 May 21 UTC
It seems the rewrite now triggers java.util.ConcurrentModificationException:
…
Unfortunately my stack trace does not embed line numbers due to R8 :(
One of the getDNSEntry method is missing synchronization it seems.
```
java.util.ConcurrentModificationException:
at java.util.ArrayList$Itr.next (ArrayList.java:860)
at javax.jmdns.impl.DNSCache.getDNSEntry (DNSCache.java)
at javax.jmdns.impl.JmDNSImpl.handleRecord (JmDNSImpl.java)
getName (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
DNSEntry.isUnique (DNSEntry.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
getCache (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
getName (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
getCache (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
DNSRecord.getCreated (DNSRecord.java)
JmDNSImpl.isOlderThanOneSecond (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
DNSRecord.setWillExpireSoon (DNSRecord.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
DNSRecord.getTTL (DNSRecord.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
DNSRecord.setWillExpireSoon (DNSRecord.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
getCache (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
DNSEntry.sameSubtype (DNSEntry.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
DNSRecord.resetTTL (DNSRecord.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
getCache (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
DNSCache.replaceDNSEntry (DNSCache.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
DNSCache.replaceDNSEntry (DNSCache.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
DNSCache.replaceDNSEntry (DNSCache.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
DNSCache.replaceDNSEntry (DNSCache.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
getCache (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
getCache (JmDNSImpl.java)
handleRecord (JmDNSImpl.java)
DNSRecord$Pointer.getAlias (DNSRecord.java)
JmDNSImpl.handleRecord (JmDNSImpl.java)
at javax.jmdns.impl.JmDNSImpl.handleResponse (JmDNSImpl.java)
aRecordsLast (JmDNSImpl.java)
handleResponse (JmDNSImpl.java)
aRecordsLast (JmDNSImpl.java)
handleResponse (JmDNSImpl.java)
aRecordsLast (JmDNSImpl.java)
handleResponse (JmDNSImpl.java)
aRecordsLast (JmDNSImpl.java)
handleResponse (JmDNSImpl.java)
aRecordsLast (JmDNSImpl.java)
handleResponse (JmDNSImpl.java)
at javax.jmdns.impl.SocketListener.run (SocketListener.java)
sleepThread (SocketListener.java)
run (SocketListener.java)
sleepThread (SocketListener.java)
run (SocketListener.java)
sleepThread (SocketListener.java)
run (SocketListener.java)
JmDNSImpl.getSocket (JmDNSImpl.java)
SocketListener.run (SocketListener.java)
JmDNSImpl.getLocalHost (JmDNSImpl.java)
SocketListener.run (SocketListener.java)
HostInfo.getInetAddress (HostInfo.java)
shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.getInetAddress (HostInfo.java)
shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.getInetAddress (HostInfo.java)
shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.getInetAddress (HostInfo.java)
shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
HostInfo.shouldIgnorePacket (HostInfo.java)
SocketListener.run (SocketListener.java)
DNSMessage.isValidResponseCode (DNSMessage.java)
SocketListener.run (SocketListener.java)
JmDNSImpl.getGroup (JmDNSImpl.java)
SocketListener.run (SocketListener.java)
```
but it could something else. in general, homekit binding has not changed that much from 2.x to 3.x
tailor09
(Jochen T)
June 21, 2021, 8:07pm
105
I used a old iPad Air as HomeKit hub - was pretty slow. If my iPhone was connected to the network the phone pulled states directly from openHAB so this was faster. I don’t have any problems since my HomePod mini arrived: its always on and fast.
I don’t have experience with MacBook or AppleTV.
1 Like
alaub81
(Andreas)
June 28, 2021, 5:39pm
106
I just updated today to the last stable 3.1.0 docker Version of openHAB, but still having the issue, that after a clean startup of openHAB HomeKit is not working. So I have to enable / disable “Use openHAB mDNS service”, then everything is running fine. I have no errors in the log file. Am I the only one with that problem?
2 Likes
yfre
(eugen)
June 28, 2021, 8:25pm
107
multiple users have reported similar issue in combination docker with ipv6. disabling ipv6 support at docker level solve this issue for many.
alaub81
(Andreas)
June 29, 2021, 8:37am
108
So there won’t be a fix for that problem? Does someone has it working with ipv6 disabled in Docker only? And how did you configure that?
I did it that way:
Creating that file /etc/sysctl.d/10-disable_ipv6.conf
with:
net.ipv6.conf.all.disable_ipv6=1
to enable without rebooting the system use this command on the Linux Shell:
sysctl net.ipv6.conf.all.disable_ipv6=1
Then I created the /etc/docker/daemon.json
with that configuration:
{
"ipv6": false
}
After systemctl restart docker
It seems that HomeKit is working without switching mDNS Option on and off.
1 Like
I don’t use Docker but I had issues that past two months. Sometimes it worked for a longer time, then it I had issues every two three days. In any case that is not reliable as I use HomeKit for some automation task like presence detection.
I have now successfully disabled ipv6 following How to disable IPv6 in Raspbian [WORKING] – CWESystems and will keep you posted.
tbnobody
(Thomas Basler)
July 3, 2021, 1:36am
110
I am having the same issue. Don’t use docker as well. I also have a hue bridge in the same network which is always visible in the discovery app (_hap._tcp dmain). The OpenHab entry disapears some time after the restart of openhab or just the bundle (bundle:restart ).
Due to the fact that the hue bridge is working, I would eliminate problems with a wrong configured access point. If OpenHAB is visible in the discovery app, it shows the IPv4 address.
stefan13
(Stefan)
July 23, 2021, 2:08pm
111
I‘m facing a similar issue since I updated to OH 3.1 stable.
With the previous 3.1.0Mx releases I didn’t see the behavior. Maybe it’s by coincidence only.
Every time my internet connection is down, the HomeKit doesn‘t work anymore.
Bundle restart does not solve the problem anymore.
Something has changed, but not sure what.
Update: I get it work again by toggling the option
„Use openHAB mDNS service“
alaub81
(Andreas)
July 23, 2021, 3:30pm
112
I saw the same issue yesterday after I had also an offline internet connection. Before that offline issue everything worked well for weeks. Also on openHAB 3.1 and I had switched the mDNS Switch on and off again, too. After that it worked again.
stefan13
(Stefan)
July 28, 2021, 3:11pm
113
I have the issue again, but neither toggling nor bundle restart does help this time.
Seems I have to remove the OH from Homekit and re-add it again.
This always worked the last time…
Any other idea?
Many thanks.
Stefan
yfre
(eugen)
July 28, 2021, 9:49pm
114
hmm. strange. any error in OH logs?
try to restart OH completely or even docker container if you use one.
as long as the mac address of the device (iphone) does not change there should be no need to re-pair/re-add it.
wzbfyb
(Bernhard)
July 29, 2021, 4:15am
115
Same here.
After the move from 3.1M5 to 3.1 all HomeKit devices where offline, also those directly working with HomeKit.
Removing OH from HomeKit and re adding the devices worked.
stefan13
(Stefan)
July 29, 2021, 5:41am
116
I did this already. I deleted the old docker container and installed it again.
I cannot see any errors in the logfile.
Does it make sense to trace something?
yfre
(eugen)
July 30, 2021, 7:30pm
117
if you have access to openhab karaf console, you can try to increase log level with
log;set TRACE org.openhab.io.homekit
log:set TRACE io.github.hapjava
piejanssens
(Pieter Janssens)
August 3, 2021, 12:12pm
118
All my items were “No response” too.
Solution for me was removing my ‘home’ from the Home app and then readding OpenHAB bridge.
1 Like
joedirt
(Rick)
August 18, 2021, 10:56pm
119
How’s your setup since removing and re adding everything? Mines been dropping out still
wzbfyb
(Bernhard)
August 19, 2021, 7:24am
120
What seems to work for me is an iPhone reboot, then all items respond again.
erikvdv1
(Erik)
August 23, 2021, 11:14am
121
I have also had the problem that every few days all HomeKit devices show ‘no response’.
In my OH logs I found the following exception:
22:48:50.966 [WARN ] [javax.jmdns.impl.tasks.Responder ] - Responder(*snip*)run() exception
java.io.IOException: Operation not permitted
at java.net.PlainDatagramSocketImpl.send(Native Method) ~[?:?]
at java.net.DatagramSocket.send(DatagramSocket.java:695) ~[?:?]
at javax.jmdns.impl.JmDNSImpl.send(JmDNSImpl.java:1665) ~[bundleFile:3.5.7]
at javax.jmdns.impl.tasks.Responder.run(Responder.java:154) [bundleFile:3.5.7]
at java.util.TimerThread.mainLoop(Timer.java:556) [?:?]
at java.util.TimerThread.run(Timer.java:506) [?:?]
After looking into the code of jmDNS I changed the following line and I have no issues since then.
committed 08:24PM - 29 Jul 21 UTC
A pre-built JAR file with the fix can be downloaded here: Dropbox - jmdns-3.5.7.jar - Simplify your life
Replace it with the original jmdns-3.5.7.jar. If you’re using docker, mount the JAR under /openhab/runtime/system/org/jmdns/jmdns/3.5.7/jmdns-3.5.7.jar
I suspect the exception is triggered by a mDNS message sent by one of my other devices on the network. After the exception occurs the OH jmdns client is stopped.
If other people can confirm this solves their ‘no reponse’ problem as well, I will create a pull request to jmdns.
1 Like
bodomenke
(Bodo Menke)
September 14, 2021, 11:14am
122
I am experiencing the same problem (openHab devices with „no response“ in Apple Home app). In my case
toggling the mDNS-switch in HomeKit-Integration of openHab or
even a restart of openHab
does not heal the issue.
Is anybody able to confirm that replacing jmDNS with the updated version of @erikvdv1 does fix the problem?
Thanks