iCloud Binding Crashing - 2.5

Thanks!
Hope it doesn’t break anything!
I’m using the same version, but my local build…

No, I am running on Windows and have the same issue.

I’ve got a similar issue, my iCloud binding works fine when I reboot my OH pi bit then stops reporting a location after x, (still need to investigate if it’s immediate or after a certain time / number of refreshes). It also seems to work when you manually refresh it but the clock is 5 mins behind the actual time.

I’m running openhabian 2.4 with iCloud binding 2.5…

What testing would anyone like me to do or is this all rolled up into a bigger issue?

This is the issue here, there’s a fix up above

This is also discussed in this thread

Thanks, it was late last night so I only scanned the thread and messaged as a reminder to myself to investigate further :+1:

I’ll do some more reading / fixing and report back.

@rkrisi the binding did not stop working so far. That’s good.

I now run into a lot more “Unable to refresh device data” since this morning (starting maybe around 5 or 6 am), but I don’t think this is related to your changes.
Looks like the known SLHandshakeException/General SSLEngine problem. I have to try on this later on. I already renewed the certificates, but no change so far.

Yes I also have these… Sometimes almost every 2nd refresh says “unable to refresh device data” and all device will go to an OFFLINE state…
I will try to catch an error when this happens and why the binding assumes this. If you still have this, you can also do this, by putting the binding into TRACE logging (this will cause a lot of lines of log when updating the device state, so be prepared) and send me the json output or the detailed error if it shows anything…
But I think this is also related to Apple servers and the API. They might be doing some changes/improvements to this API, maybe that’s why these error happens now quite often (I can remember that there were a few days when it completely stopped working, and all of a sudden it started working again after a few days).

Looking at the code, that error might happen when the server didn’t respond at all. There is already a 10 second timeout, but if it doesn’t respond it will throw this error. I don’t know if it would make any change if I increase this timeout…

I need to see if I find some time this evening to get some traces, since I am not at home atm.

Same here unfortunately…

For me it seems that it stopped completely. A new cert has to be used to get it working again.
I have managed to fix this, I will provide a new jar soon…

1 Like

Yes, I noticed that also now…

Thank you for your effort!

2 Likes

Thank you very much for the quick solution! Works like a charm :wink:

Great to hear!

Just to let you know, the iCloud Account Offline issue has finally hit me. I installed your updated binding and all is back working. Thank you for your effort and support of the community.

1 Like

Thanks a lot for your quick help. It’s running on my side for 6,5h now without any major issues.

Hi,
Without any changes from my side the iCloud things stopped working a few days ago. My setup:

  • Raspberry Pi 2b
  • Openhab 2.5.1-2
  • iCloud things active: account and 2 iPhones

I read this post and assumed that version 2.5.1-2 should have solved my issue, but it didn’t. Shoud I do something else than installing 2.5.1-2?

This is what the log says:

2020-01-25 15:20:02.743 [WARN ] [l.handler.ICloudAccountBridgeHandler] - Unable to refresh device data
java.io.IOException: java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@8eba21::DecryptedEndPoint@1d440f8{fmipmobile.icloud.com/17.248.148.106:443<->/192.168.178.16:42432,CLOSED,fill=-,flush=C,to=2/0}
        at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:259) ~[?:?]
        at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:156) ~[?:?]
        at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:131) ~[?:?]
        at org.eclipse.smarthome.io.net.http.HttpRequestBuilder.getContentAsString(HttpRequestBuilder.java:135) ~[?:?]
        at org.openhab.binding.icloud.internal.ICloudConnection.callApi(ICloudConnection.java:88) ~[?:?]
        at org.openhab.binding.icloud.internal.ICloudConnection.requestDeviceStatusJSON(ICloudConnection.java:69) ~[?:?]
        at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$0(ICloudAccountBridgeHandler.java:88) ~[?:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) [bundleFile:?]
        at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) [bundleFile:?]
        at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:145) [bundleFile:?]
        at org.openhab.binding.icloud.internal.handler.ICloudDeviceHandler.refreshData(ICloudDeviceHandler.java:112) [bundleFile:?]
        at org.openhab.binding.icloud.internal.handler.ICloudDeviceHandler.initialize(ICloudDeviceHandler.java:103) [bundleFile:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_222]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_222]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_222]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_222]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
Caused by: java.util.concurrent.ExecutionException: java.io.EOFException: HttpConnectionOverHTTP@8eba21::DecryptedEndPoint@1d440f8{fmipmobile.icloud.com/17.248.148.106:443<->/192.168.178.16:42432,CLOSED,fill=-,flush=C,to=2/0}
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:685) ~[?:?]
        at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:250) ~[?:?]
        ... 21 more
Caused by: java.io.EOFException: HttpConnectionOverHTTP@8eba21::DecryptedEndPoint@1d440f8{fmipmobile.icloud.com/17.248.148.106:443<->/192.168.178.16:42432,CLOSED,fill=-,flush=C,to=2/0}
        at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:335) ~[?:?]
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1526) ~[?:?]
        at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:209) ~[?:?]
        at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:147) ~[?:?]
        at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73) ~[?:?]
        at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133) ~[?:?]
        at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:154) ~[?:?]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) ~[?:?]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) ~[?:?]
        at org.eclipse.jetty.io.ssl.SslConnection$1.run(SslConnection.java:143) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:782) ~[?:?]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:918) ~[?:?]
        ... 1 more

Any advice would be welcome.

It will be solved in the next update (my changes are merged now).
If you want to use the binding, use my version linked above.

Thanks! I’ll try the new binding.

Edit: works fine! iCloud things and related rules are up and running. Thanks a lot!

Hi all. I’m running 2.5.3 Release build, and have this issue. FindMyIphone and battery percentage work fine, but Location, Last update and charging status do not report anything. Used to work fine.

Presumably, the fix that is in this 2.5.2 SNAPSHOT .jar are already incorporated so I’m baffled as to what could be causing the issue. IS there a way to renew the certificates as someone mentioned above?

UPDATE: I did post to say the update to 2.5.4 fixed it but it, in fact, did not. Battery level, FindMy and LocationLastUpdate are the only thing working. I’m stumped.