And it is 100% related to iOS device leaving wifi/ losing network connectivity.
2017-12-20 13:09:26.400 [ERROR] [lfe.hap.impl.http.impl.BinaryHandler] - Exception in binary handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) [?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) [?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) [?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) [?:?]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447) [213:org.openhab.io.homekit:2.2.0]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:880) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [213:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) [213:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [213:org.openhab.io.homekit:2.2.0]
at java.lang.Thread.run(Thread.java:748) [?:?]
2017-12-20 13:09:26.409 [ERROR] [.hap.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) [?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) [?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) [?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) [?:?]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447) [213:org.openhab.io.homekit:2.2.0]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:880) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [213:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [213:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) [213:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [213:org.openhab.io.homekit:2.2.0]
at java.lang.Thread.run(Thread.java:748) [?:?]
Just started getting these errors as well, do we know if its fixable/avoidable?
2018-01-04 11:25:51.755 [ERROR] [lfe.hap.impl.http.impl.BinaryHandler] - Exception in binary handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) [?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) [?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) [?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) [?:?]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447) [224:org.openhab.io.homekit:2.2.0]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:880) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [224:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) [224:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [224:org.openhab.io.homekit:2.2.0]
at java.lang.Thread.run(Thread.java:748) [?:?]
2018-01-04 11:25:51.762 [ERROR] [.hap.impl.http.impl.AccessoryHandler] - Exception caught in web handler
java.io.IOException: Connection timed out
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[?:?]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) [?:?]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) [?:?]
at sun.nio.ch.IOUtil.read(IOUtil.java:192) [?:?]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) [?:?]
at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:447) [224:org.openhab.io.homekit:2.2.0]
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:880) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:242) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [224:org.openhab.io.homekit:2.2.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [224:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) [224:org.openhab.io.homekit:2.2.0]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [224:org.openhab.io.homekit:2.2.0]
at java.lang.Thread.run(Thread.java:748) [?:?]
As I reported earlier in this thread, these exceptions are harmless and theyāre just the result of an iOS device timing out or leaving the wifi network or losing connection some other way. They just clutter the log.
The exceptions have been fixed in the HAP-Java repository since August 2016, but OH has not gotten an updateā¦ probably because of the indecision on semantic tagging?
Is anyone actually seeing any negative effects on functionality because of these exceptions? Everything works fine for me. The fix in holgerebertās comment here to make the HomeKit JSON DB non-writable stopped any problems with reboots as well (so far):
nope. same here.
just a simple timeout error (could be changed to Warn level maybe?) being logged when the iPhone goes offline.
Functionality is not affected when iPhone is back online. Homekit works properly (on openHAB 2.3.0 Build #1178)
After this exception the HomeKit is not connected anymore to my OH 2.2.
In iOS Home App I get all devices listed as not reachable.
The only way I found to solve this problem is to clear the pairings and connect again.
I also had issues with Homekit connectivity. I could not connect to devices returning home especially when I tried to connect to them when I was away from home with the āHomeā app.
I got a Philips Hue set a while back (3 lamps and a bridge) and since the homekit has been rock solid. Not a single issue in over a month in connectivity. When I added the Hue set i was also able to add my girlfriends phone (different icloud account). Previously the invitations gave an error. When I added the Hue suddenly the queued invitations were all send out.
Maybe someone with a Hue set can confirm this.
Could not be happier with the OpenHab setup as my domotica does not support Siri natively.
These exceptions show up in my logs too. Everything seems to work just fine. But really donāt like all this log cluttering .
If i understand @anthonygillet this was fixed 1,5 years ago but itās not yet in openHAB. Maybe @beowulfe could look into this?
The semantic tagging topic for openHAB is getting nasty slow (2 years!) and long, so maybe these fixes can be implemented before that discussion is solved, if it ever gets solved?! Iām happy to test or support in anyway i can. I just lack the knowledge to make a PR.
I think thereās already an issue on github to get this library updated from 1.1.3 to 1.1.4 (or even 1.1.5) in the homekit add-on, which would solve this and a few other issues like the startupTimeout fix! Looks like there is a beta version linked there:
@beowulfe do you need more feedback about the beta version before pushing it to master? Perhaps a few of us here can test if you need. Otherwise, whatās the next step for getting this updated?
Correct - the beta version of the HomeKit add-on used the newer version of the HAP-Java library. Please do try it out and let me know. I havenāt heard much feedback, and the changes to startup in that beta are significant.