-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iCloud 3 hangs indefinitely on Apple account sign in #426
Comments
I did find one problem where an unknown Mobile App device in the config would create an error. See here for a patch that should fix that. If that does not work, see if there are any errors related to iCloud3 at Settings > System > Logs. You can turn on Debug logs on Configure > Tools. Restart and email icloud3.log to geekstergary@gmail.com Tools also has some maintenance items so you do not have to fiddle with the .storage config files. |
When I try to add an apple account after setting up from scratch, I get these logs:
and so on, until it times out. The thing is, home assistant isn't offline. Every other internet-requiring integration works. |
I downgraded to version 3.4.1 actually and see the same thing but without the back and forth internet connection response:
I'm thinking maybe something changed with apple's servers? I am easily able to sign in on iCloud web on the same machine running home assistant, so I don't think my IP address is getting rate limited or blocked or anything... |
It probably was Apple went down and that generated a connection error message. iCloud3 will flag the internet down and pause tracking. It then tries to connect with Google at 8.8.8.8 and says the internet is back up when it gets a good response. |
V3.1.4.1 handled connection issues differently without trying to see when it came back up. It would also hang on connection issues if the error occurred adding a new Apple account. That was a major change between 3.1.4 and 3.1.5. It also identified a connection error by the word ‘connection’ in the error message which missed about 10 other errors that are also related to the Internet being down. |
I'm still not sure how to get it back up. I tried the patch for 3.1.5.1 that you linked in the other thread and still no luck and still the same error and same logs. Somehow seems it can't connect to apple's servers. |
Set Debug logging on Configure > Tools Also see if there are errors related to iCloud3 in the HA logs at Settings > Systym > Logs G |
I just wanted to mention that I’ve been experiencing the same issue since yesterday. When I request a verification code, my Apple device displays one, but iCloud3 v3 remains stuck in the loading screen. If I close the iCloud3 v3 window and reopen it to enter the code, the issue persists—it stays in the loading screen again. How can I send you the log-file? To your email adress? |
@TimMeisberger |
@TimMeisberger In any case, when icloud3 starts it validates the username/password with a simple call to the apple authenticate url. I can see the message being sent but nothing is ever received back. Either Apple is not responding, there was an internet issue at the time when HA was being set up that cleared up later on. Also, I can see some responses from Apple indicating the Browser is not trusted and the request to ask for a verification code is False
Are using a hardware security key like a YubiKey? I have just released v3.1.5.2b2 to handle some Apple Account issues. I do not think it will help but would like to download and install it to see if it does. It is on the iCloud3 Development Repo here. Either download the icloud3.zip file or from HACS if you are subscribed to the iCloud3 Development site. |
I enabled debug mode on 3.1.5.2b2, tried to sign in, had it hang and then fail, and this is my entire icloud3.log file contents:
Looks like the auth pages have moved maybe? 303 errors are strange here. |
Not to send anyone on a wild goose chase, but I experienced issues with login in the same time period and was able to resolve it myself. The problem ultimately turned out to be related to how I had configured IPv6 in my network. The iCloud v3 add-in (or possibly Home Assistant itself) is doing Internet connectivity checks against Google (it seemed to be dns.google), and those were failing on my network due to blocking DoH. Once I resolved that, and disabled IPv6 on my HA system, I was able to authenticate to iCloud again. I was able to re-enable IPv6 on HA after fixing a routing/addressing issue on my Firewall. This may be completely specific to my set-up, but I'm hoping it provides some inspiration for troubleshooting! |
Hmm, so my ISP has misconfigured IPv6 so I can't access the IPv6 internet at all from within my network, despite using the correct prefix. But this has been the case for a year + while iCloudv3 worked the whole time until just recently. I do have seemingly working IPv6 within my network though, as matter/thread all work correctly. |
@andrew-kennedy my assumption is that this wouldn't be a problem unless the Home Assistant system is receiving IPv6 addresses in responses from DNS. At the very least, that could create delay until a failback to IPv4; however, my experience was that the add-in never failed back to IPv4 while my IPv6 network was experiencing routing issues (which I caused). |
@andrew-kennedy @eking0421 However, when checking to see if it back up after receiving on of the errors, it tries to get a response from Google at 8.8.8.8. Should that be changed to www.google.com instead? |
I am able to ping 8.8.8.8 from my home assistant host (raspberry pi) so that's not the issue for me at least... I really don't know but perhaps the 303 is due to some regional change with Apple's auth in the US vs the UK? I never actually changed anything with iCloud3 besides updating to 3.1.5 and after that even a rollback wouldn't fix it, so I'm thinking this might be due to Apple not iCloud v3 |
Are you getting the 303 from this line in the log file ?
If so, the 303 is actually the line in the code that requested the data from Apple in the VALIDATE_WITH_VERIFY_VIA_URL function. |
Oh, gotcha. Figured it might be an HTTP error code. My bad! |
Is there any way to enable even more debug logging @gcobb321 ? I'm really missing having iCloud3 working but don't know how to gather any more information about why it's not working. All I have is the tiny log output I already posted here. |
I just noticed that after deleting iCloud 3 and all its .storage folders and settings again and installing 3.1.6 beta, it still errors on sign in but then 5 minutes later my iPhone gets the verification code pop up. Can't use it as iCloud 3 has already timed out or errored but it does come through |
You can set the log level on Configure > Tools. There are 3 levels of debugging - Info, Debug, RawData. They are described here. The sample I images are outdated b but their description is still valid. |
I added an additional log_exception message to the routine that catches the Internet Connection error to get a detailed message in the logs on the cause. You should already see an error message with the reason in the Event Log. Unzip this into the icloud3/support directory and restart HA |
Wow, so on a whim I decided to disable IPv6 within home assistant, and everything magically worked with icloud3. What I don't understand is why, as I've had IPv6 enabled within home assistant, with it working locally on my router, for the past year with no real issues. I can even ping6 any ipv6 domain within the terminal from my home assistant device. I would ideally like to keep ipv6 enabled. |
Update: I fully disabled IPv6 on my router, rebooted it, and reenabled it (I'm using a Unifi Dream Machine), which seems to have fixed IPv6 routing on all my devices and now IPv6 works everywhere including on the home assistant machine, and iCloud3 starts without problems. There was some kind of obscure networking issue with DHCP or something where my router itself could reach the ipv6 internet, but devices in my network couldn't. Not sure why I didn't notice the impact of this outside of iCloud3 though. |
It sounds like you are making progress |
Thank you very much for checking the log-file and sorry for redacting all these information. I think it has something to do with my settings in my Router. I installed AdGuard when the this problem occured and did some changes in my Router-Settings. So far I was not able to find the root cause... but I will continue testing :-) |
I was having issues where iCloud 3 hangs indefinitely upon sign in, and I tried to fully uninstall and delete its .storage directory and such and it still will not sign in upon reinstall and HA restart.
This is on version 3.1.5.1 released a few days ago. I don't see any errors in the logs, but I haven't turned in debug logs yet. Is there any additional "deletion" step I can take besides deleting the .storage directories for icloud3?
The text was updated successfully, but these errors were encountered: