iCloud binding refresh device data failed (again)

Hi everyone!

Since yesterday, I have problems with the iCloud binding (not the earlier PKIK path building, or it just has similar symptoms).
I haven’t changed any config in openHab, it just stopped updating during the night…

When I try to reload or restart openhab, when it wants to load the binding, I get this error:

2019-03-05 09:58:57.515 [TRACE] [l.handler.ICloudAccountBridgeHandler] - json: 

2019-03-05 09:58:57.520 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 

java.lang.NullPointerException: null

	at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:150) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

What I have tried:

  • Restarting the RPi
  • Restarting several times openHab
  • Uninstalling the binding/install, tried with compiled jar as well
  • Cleaned cache
  • Also tried creating a new bridge, but that got the same results… (for me it looks like something has changed on Apple side…)

No one of these solved the issue, got the same results…

Does anyone know how I could solve this?

Thanks!

2019-03-05 10:11:15.496 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while calling thing handler factory 'org.openhab.binding.icloud.internal.ICloudHandlerFactory@558c5d': null

java.lang.NullPointerException: null

	at org.openhab.binding.icloud.internal.ICloudHandlerFactory.registerDeviceDiscoveryService(ICloudHandlerFactory.java:76) ~[?:?]

	at org.openhab.binding.icloud.internal.ICloudHandlerFactory.createHandler(ICloudHandlerFactory.java:58) ~[?:?]

	at org.eclipse.smarthome.core.thing.binding.BaseThingHandlerFactory.registerHandler(BaseThingHandlerFactory.java:128) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.doRegisterHandler(ThingManagerImpl.java:600) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.registerHandler(ThingManagerImpl.java:577) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.registerAndInitializeHandler(ThingManagerImpl.java:1073) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.lambda$10(ThingManagerImpl.java:1056) ~[?:?]

	at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[?:?]

	at java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:404) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.lambda$9(ThingManagerImpl.java:1053) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:?]

	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:?]

	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:?]

	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:?]

	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]

	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]

	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.handleThingHandlerFactoryAddition(ThingManagerImpl.java:1052) ~[?:?]

	at org.eclipse.smarthome.core.thing.internal.ThingManagerImpl.onReadyMarkerAdded(ThingManagerImpl.java:1040) ~[?:?]

	at org.eclipse.smarthome.core.internal.service.ReadyServiceImpl.lambda$0(ReadyServiceImpl.java:53) ~[?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) [?:?]

	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:?]

	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) [?:?]

	at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1696) [?:?]

	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) [?:?]

	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [?:?]

	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) [?:?]

	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) [?:?]

	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:?]

	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) [?:?]

	at org.eclipse.smarthome.core.internal.service.ReadyServiceImpl.notifyTrackers(ReadyServiceImpl.java:80) [106:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.core.internal.service.ReadyServiceImpl.markReady(ReadyServiceImpl.java:53) [106:org.eclipse.smarthome.core:0.10.0.oh240]

	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.registerReadyMarker(XmlDocumentBundleTracker.java:428) [105:org.eclipse.smarthome.config.xml:0.10.0.oh240]

	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.finishBundle(XmlDocumentBundleTracker.java:374) [105:org.eclipse.smarthome.config.xml:0.10.0.oh240]

	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.processBundle(XmlDocumentBundleTracker.java:397) [105:org.eclipse.smarthome.config.xml:0.10.0.oh240]

	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker.access$6(XmlDocumentBundleTracker.java:389) [105:org.eclipse.smarthome.config.xml:0.10.0.oh240]

	at org.eclipse.smarthome.config.xml.osgi.XmlDocumentBundleTracker$2.run(XmlDocumentBundleTracker.java:359) [105:org.eclipse.smarthome.config.xml:0.10.0.oh240]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Investigating the issue more, I have found that I can’t ping https://fmipmobile.icloud.com/, and if I open it up in a browser, it says that the service is unavailable.

Hi, Kristof,

I found same problem with iCloud connection from yesterday night.
No any changes in OH configuration. Last changes was made more two weeks ago. No any restarts of RPI with OH, disconnection from internet more two weeks.

OH version 2.4, Java version “1.8.0_201” (Last)

I have tried to restart system - no results, problem with connection to iCloud present.

Thanks for your reply!

Yes, after I have tried pinging the Apple’s service and I saw that it is unavailable I thought that this is might be not an issue in our system.

I thought that Apple use the same service to fetch device data, but Find My iPhone works normally on my phone…
My setup heavily relies on that binding, so it would be great if we can solve this…

Let’s wait for someone who knows more about this (maybe @digitaldan or @martinvw can you help us?)

Did you already enable debug logging for the binding? They most likely changed something in their api but I don’t know what?

Yes my original Post includes the TRACE log (not much though). Looking into the source, it stops where it should start fetching device data (I think…)

Okay, so nothing is returned at all.

Maybe @patrik_gfeller can find some information from the sources which he used for the original implementation? Just a guess, It seems they might have shutdown this api?

Yes, it really seems like that the only problem is that there is no response from the server.
I’m afraid that they did it (shutdown). I’m fairly a new user (using OH a year ago), does this happened before? (Shutting down a service and need to reverse-engineer/use a new one)

Hello Martin et all,

unfortunately I can confirm that the iCloud binding does not work anymore. It looks like the API is still available, but that the authentication somehow changed. Got this from the logs:

HTTP protocol violation: Authentication challenge without WWW-Authenticate header

I am not familiar with the HTTP authentication schemes; maybe someone else can give some hints how communication needs to be changed to make this work again. I do not have a openHAB dev environment set up atm (new laptop); but once we’ve an idea what needs to be changed I’ll setup an environment and do the required adjustments.

with kind regards,
Patrik

Thanks for your help!
I’m also not familiar in deeps with HTTP auth methods, but it is a good sign that they didn’t changed the whole API (I think…). I will try to give some help as I can, because I heavily rely on this binding…

1 Like

hi,
I have the same issue.
Also had the fault http protocol… on my account but not on my wife’s so i created an new bridge for my account and now it is INITIALIZING. The problem started with the following faults:
2019-03-04 01:39:47.980 [WARN ] [l.handler.ICloudAccountBridgeHandler] - Unable to refresh device data
java.io.IOException: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
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:84) ~[?:?]
at org.openhab.binding.icloud.internal.ICloudConnection.requestDeviceStatusJSON(ICloudConnection.java:65) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$0(ICloudAccountBridgeHandler.java:84) ~[?:?]
at org.eclipse.smarthome.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:97) ~[?:?]
at org.eclipse.smarthome.core.cache.ExpiringCache.getValue(ExpiringCache.java:68) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:141) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.util.concurrent.TimeoutException: Total timeout 10000 ms elapsed
at org.eclipse.jetty.client.TimeoutCompleteListener.onTimeoutExpired(TimeoutCompleteListener.java:52) ~[?:?]
at org.eclipse.jetty.io.CyclicTimeout$Wakeup.run(CyclicTimeout.java:271) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[?:?]
… 3 more
and then ;
2019-03-05 02:41:10.936 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.NullPointerException: null
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:150) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

hope this will help

kind regards

So your wife’s account is still working? Or it just doesn’t produce error, but doesn’t work?

… update; somehow my account was locked - after resetting the password I do now get an empty json response - I’ll try to have a look into this …

with kind regards,
Patrik

Yes, this is what I also get…

Chrome gives a “NET::ERR_CERT_AUTHORITY_INVALID” on https://fmip.icloud.com, maybe that has something to do with it?

And does everyone here have 2FA enabled?

Yes, i do

This will be why I was unable to get the binding working today. I have 2FA enabled and there were no messages to my iphone when I setup the account on the binding.

I am not using 2FA.
Same problem still present.

1 Like