icloud3 icon indicating copy to clipboard operation
icloud3 copied to clipboard

Re-Authentication Issue and Error Logs

Open JoshBurg17 opened this issue 5 months ago • 20 comments

I woke up to an iPhone request to re-authenticate, as well as a notice I needed to in iCloud. When I tried it doesn't seem like it worked, and now checking logs I have several errors. I'm on Home Assistant OS - 2025.7.3 and these were my errors:

This error originated from a custom integration.

Logger: custom_components.icloud3 Source: custom_components/icloud3/config_flow.py:2679 integration: iCloud3 v3: iDevice Tracker (documentation, issues) First occurred: 5:59:17 AM (2 occurrences) Last logged: 6:00:28 AM

'NoneType' object has no attribute 'account_owner' Traceback (most recent call last): File "/config/custom_components/icloud3/config_flow.py", line 2679, in async_step_reauth post_event( f"{EVLOG_NOTICE}Configure Apple Acct > {self.PyiCloud.account_owner}, " ^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'account_owner'

Logger: aiohttp.server Source: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:481 First occurred: 5:59:17 AM (2 occurrences) Last logged: 6:00:28 AM

Error handling request from 192.168.1.172 Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 510, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 83, in with_admin return await func(self, request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 284, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 336, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 383, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ flow, cur_step["step_id"], user_input ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 505, in _async_handle_step if result.get("preview") is not None: ^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'

JoshBurg17 avatar Jul 26 '25 12:07 JoshBurg17

Looking at the error message, the Internet may have gone down. That generates various connection errors and the current session would have been lost, leading to the messages youareseeing.

What version of iCloud3 are you running?

gcobb321 avatar Jul 27 '25 14:07 gcobb321

Okay that makes sense I think. I’m using the current version I believe: 3.2.3.

I have a UniFi network system and I believe it updated overnight and there was a network disruption from that. I just had a heck of a time re-authenticating after this. The codes kept getting rejected and I had to try 3-4 times for each account using the tracker. Eventually it seems to have gone through and I think I’m up and running again.

JoshBurg17 avatar Jul 27 '25 15:07 JoshBurg17

Since a few days I had a message that I’m not logged in. Image

I requested a verification code and entered, but still the same error.

Then I had an entry on the devices page to reconfigure icloud3, which I did, but was still not logged in. But the sensors seemed to still work.

Then I tried to do a complete login with username and password with the UI, but I got the following error message:

Internet Connection Error > iCloud3 cannot connect to the Internet. Actions requiring access to the Apple account are not available.

Now I somehow managed to make the errors go away, restarted iCloud3 an then got this: Image

So I started the configuration, had to request a new verification code, sent it and now I’m logged out again.

I tried many times now, but I can’t get out of the loop of logging in and being logged out. There is something really weird going on.

The log only shows:

 'NoneType' object has no attribute 'account_owner' 
 21:42:14 – (FEHLER) iCloud3 v3 (Benutzerdefinierte Integration)

 ********@ > Apple Acct Authentication Needed 
 21:41:20 – (WARNUNG) iCloud3 v3 (Benutzerdefinierte Integration) - Meldung ist erstmals am 00:41:48 aufgetreten und erscheint 568-mal

 Internet Connection Error > Tracking Paused, (0) 
 21:41:15 – (FEHLER) iCloud3 v3 (Benutzerdefinierte Integration) - Meldung ist erstmals am 18:54:05 aufgetreten und erscheint 10-mal

gimmel avatar Jul 30 '25 19:07 gimmel

Check to see if IPv6 is enabled or set to automatic on _HA Devices & settings > System > Network _. Set it to disabled if it Is. Then restart and see if that fixes this issue.

The Python requests module used for requesting info from icloud.com does not support IPv6. The next version has a 1-minute timeout error that detects when icloud.com may be down or not responding to location or authentication requests.

gcobb321 avatar Jul 30 '25 21:07 gcobb321

Yep, that worked instantly. Thanks for the fast reply, Gary.

gimmel avatar Jul 30 '25 22:07 gimmel

@gimmel I will send you a beta of the next release in a few days That attempts to detect this and display a meaningful message. I’ll need you to turn ipv6 back on, restart and see what happens. Then you can turn it off and proceed as normal.

Will you be able to do this or are you running a config with lots of complications or in a docker or VMware environment?

Gary

gcobb321 avatar Jul 30 '25 23:07 gcobb321

Had the same issues, and going back to v.3.2.2.3 solved the problem.

El-Daron avatar Jul 31 '25 09:07 El-Daron

Yes, if you like, I can test the beta.

gimmel avatar Jul 31 '25 13:07 gimmel

I think this is due to IPv6 being enabled in HA. The beta code below is trying to detect this and generate an Internet Connection Error with a message that IPv6 is not supported with instructions on disabling it.

I would appreciate it if you would install this and restart HA. The following should be displayed:

Image

.

Then follow the instructions to disable IPv6 in HA in the 'IPv6 DETECTED' message.

Let me know if you see this message or do not see it, if disabling IPv6 works or if something else happens. Thanks. Gary

Unzip the following zip file into the config/custom_components/icloud3 directory. Then restart HA

icloud3 v3.2.3.1b5.zip

gcobb321 avatar Aug 03 '25 18:08 gcobb321

I use a docker version of HA, and obviously, I can't disable ipv6 directly into the HA settings. How can we figure this issue out?

El-Daron avatar Aug 03 '25 18:08 El-Daron

Do you mean you need ipv6 enabled for docker or you can not go to ha devices & settings > System > Network and disable IPv6?

I think others usinga docker container have disabled it in HA without problems.

gcobb321 avatar Aug 03 '25 18:08 gcobb321

The stack is setup to use the host mode, so I think i need to disable ipv6 at the system level

Image

El-Daron avatar Aug 03 '25 18:08 El-Daron

You are way above my knowledge. I do not use a docker container and do not know how it is set up or how HA interacts with it.

gcobb321 avatar Aug 03 '25 18:08 gcobb321

FYI, i had the issue with the v3.2.3 and after disabling ipv6 at the system level, i'm now ok :)

El-Daron avatar Aug 03 '25 18:08 El-Daron

I have ipv6 enabled and haven't run into this issue. I use the ipv6 address for a few things, so disabling it isn't appropriate.

If the beta refuses to load if it is enabled, that isn't cool.

doctorkb avatar Aug 03 '25 19:08 doctorkb

@doctorkb I also have it enabled all is fine. The problem is iCloud3 sends a data request to Apple and Apple never responds. It seems that ipv6 is being used as the primary IP method because disabling it in HA solves the problem.

I added a 1-minute timeout to catch this no response (it was hanging the HA startup process). iCloud3 now will flag the internet as not available. It then checks the HA ipv6 enabled status and displays a message in the Event Log to try disabling ipv6 in HA to see what happens.

gcobb321 avatar Aug 03 '25 20:08 gcobb321

Although I've disabled IPv6 since months already, I see those errors as well. So disabling it seems not to work for everyone. It started with 3.2.3, since then the logs constantly show warnings and errors like:

2025-07-31 16:01:00.307 ERROR (SyncWorker_12) [custom_components.icloud3] Internet Connection Error > Tracking Paused,  (0)
2025-07-31 16:01:23.047 ERROR (MainThread) [custom_components.icloud3] Internet Connection Restored > Tracking Resumed

2025-08-04 07:50:30.278 WARNING (SyncWorker_13) [custom_components.icloud3] tob**1**bb@ > Apple Acct Authentication Needed

Tracking still works as expected...

N3rdix avatar Aug 04 '25 05:08 N3rdix

@N3rdix The Connection Error messages show the Internet went offline and then came back 23-secs later. The authentication notice took place several days later so I do not think they are related. I have also seen short dropouts from time-to-time and it probably did occur by your Internet Service Provider.

V3.2.3 introduced this feature to better detect and report when an Internet connection error occurred. I will see if a delay timer can be added to ignore short dropouts. If you get them all the time, I’ll send you a beta to see if it solves your problem since it is something I cannot t test.

Disabling IPv6 has solved an issue where a request is sent to Apple and it never responds. An error is generated by the Python module that handles the Internet communication that is unrelated to iCloud3.

gcobb321 avatar Aug 04 '25 07:08 gcobb321

@N3rdix The Connection Error messages show the Internet went offline and then came back 23-secs later. The authentication notice took place several days later so I do not think they are related. I have also seen short dropouts from time-to-time and it probably did occur by your Internet Service Provider.

V3.2.3 introduced this feature to better detect and report when an Internet connection error occurred. I will see if a delay timer can be added to ignore short dropouts. If you get them all the time, I’ll send you a beta to see if it solves your problem since it is something I cannot t test.

Disabling IPv6 has solved an issue where a request is sent to Apple and it never responds. An error is generated by the Python module that handles the Internet communication that is unrelated to iCloud3.

Thanks Gary, I appreciate all you hard work and the immediate feedback. I am happy to test a beta in regards to a delay timer anytime, this is not super urgent as tracking still works 😄

I am receiving those warnings constantly, see the example with 28 occurences from the last hour below. My internet connection is stable, that's the reason why I am confused about those messages.

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.icloud3
Quelle: custom_components/icloud3/utils/messaging.py:585
Integration: iCloud3 v3 (Dokumentation, Probleme)
Erstmals aufgetreten: 08:05:30 (28 Vorkommnisse)
Zuletzt protokolliert: 09:37:50

tob**1**bb@ > Apple Acct Authentication Needed

N3rdix avatar Aug 04 '25 07:08 N3rdix

The Apple Account Authentication warning is real and you should authenticate it before Apple lock your account. Go to Configure > Enter/Request Verification Code screen. Request a code, get it from your Apple device and then enter it.

gcobb321 avatar Aug 04 '25 08:08 gcobb321