bstrebel / pimatic-phone

A generic pimatic plugin for mobile devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pimatic Phone throughs error after few hours.

edautz opened this issue · comments

Using plugin version 0.9.6.

Working for a few hours, after that no location updates anymore.
Following error in the log on each update interval :

error [pimatic-phone]: Update of device "xxxxxxxx" failed, Cannot read property 'reason' of undefined.

Configured 4 iPhones, all 4 same errors. Icloud interval 580 seconds.

I've got these errors from time to time after restarting pimatic. Recreating the device (open the edit view and click save) should help. For further analysis, I need your configuration details and logfiles at debug level ...

I also noticed that view and save of the device or a restart of pimatic helps. But only for a few hours. I will provide you with the requested information. Due a business trip this will take a few days.

Caught an error situation;

12:57:30.623 [pimatic-phone] info: Google Maps reverseGeocode API returned [xxxxx]
13:17:30.674 [pimatic-phone] info: Google Maps reverseGeocode API returned [xxxxx]
13:22:39.413 [pimatic-phone] error: Update of device "iPhone xxxxx" failed, Error: getaddrinfo ENOTFOUND p44-fmipweb.icloud.com p44-fmipweb.icloud.com:443
13:22:39.425 [pimatic-phone] error: Update of device "iPhone xxxxx" failed, Error: getaddrinfo ENOTFOUND p16-fmipweb.icloud.com p16-fmipweb.icloud.com:443

13:27:30.673 [pimatic-phone] info: Google Maps reverseGeocode API returned [xxxxx]
13:32:20.048 [pimatic-phone] error: Update of device "iPhone xxxxx" failed, Cannot read property 'reason' of undefined
13:32:20.229 [pimatic-phone] error: Update of device "iPhone xxxxx" failed, Cannot read property 'reason' of undefined

After this the problem persists.

I got two pimatic installations running. Saw the same problem:

06:00:05.245 [pimatic-phone] error: Update of device "iPhone xxxxx" failed, Error: getaddrinfo ENOTFOUND p16-fmipweb.icloud.com p16-fmipweb.icloud.com:443
06:09:45.374 [pimatic-phone] error: Update of device "iPhone xxxxxx" failed, Cannot read property 'reason' of undefined

@bstrebel Does this make sense for you?

Thanks for the log! Unfortunately the error message indicates some problem with the undocumented location service API. Most probably I cannot really avoid the error. I'll try to make the routine more robust under this error condition and maybe it's possible to implement some kind of reconnect. I will have a closer look on this when back from vacations by the end of next week.
In my environment (1 iOS device with 2FA, 300 seconds iCloud interval) I experience this error often when restarting pimatic (probably a timing problem I should work on ;-) and seldom (every few weeks) during normal operation.

@edautz Maybe their are some more limitations beyond the 10 minute session limit for 2FA sessions. I would try to use different update intervals significantly below the 600 second limit. Maybe prime numbers will help to avoid problems related with concurrent or repeated API calls. And cross your fingers that Apple doesn't change this +/- undocumented API ...

@bstrebel.

Thnx for the update. I have set the update for my ICloud devices also to 300 seconds. And will see what happens. Keep you informed.

@bstrebel.

After changing the Icloud update to 300 second, every stays stable. Four days now for both systems, while with a timeout of 580 seconds only hours.

The error: Error: getaddrinfo ENOTFOUND p16-fmipweb.icloud.com p16-fmipweb.icloud.com:443 seems to be an DNS resolving error. Could this problem be related tot DNS resolving of the Icloud service?