Skip to content
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

'NoneType' object has no attribute 'loop' on latest update 3.1.4.4 #398

Closed
bobvmierlo opened this issue Jan 20, 2025 · 6 comments
Closed

Comments

@bobvmierlo
Copy link

bobvmierlo commented Jan 20, 2025

After updating to the latest version 3.1.4.4, iCloud3 won't properly startup and will show this error in the frozen eventlog. Also restarting the integration won't do anything for the eventlog card. I managed to get this error from the logs.
Reverting back to my previously installed version (3.1.4.2) fixed this issue for me.

The error:

01-20 21:14:06 iCloud3 v3.1.4.4
Traceback (most recent call last):
  File "/config/custom_components/icloud3/icloud3_main.py", line 159, in start_icloud3
    start_ic3_control.stage_7_initial_locate()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/support/start_ic3_control.py", line 584, in stage_7_initial_locate
    Device.write_ha_device_tracker_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/device.py", line 1612, in write_ha_device_tracker_state
    self.DeviceTracker.write_ha_device_tracker_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/device_tracker.py", line 647, in write_ha_device_tracker_state
    self.schedule_update_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1260, in schedule_update_ha_state
    self.hass.loop.call_soon_threadsafe(
    ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'loop'

01-20 21:14:06 1stLOC  iCloud3 v3.1.4.4 Initialization Failed
01-20 21:14:18 1stLOC  Mobile App Notify Service has not been set up yet. iCloud3 will retry later.

My Home Assistant info:
Core 2025.1.3
Supervisor 2025.01.0
Operating System 14.0
Frontend 20250109.0

@gcobb321
Copy link
Owner

After installing v3.1.4.4, did you restart HA or Reload iCloud3?
After you got this error, did you try restarting HA?

The _2s are caused by HA creating iCloud3 sensors when it already has some defined in its internal tables and is usually caused by reloading iCloud3. v3.1.4.4 c checks for this and fixes them.

@bobvmierlo
Copy link
Author

I installed the new version via HACS and restarted HA to effectuate the new version. After that the error occured.
I tried to restart iCloud3, which probably created the _2 entities but didnt fix the error. So a HA restart again, but to no avail.
Then I decided to rollback to 3.1.4.2, which is still running fine.

@gcobb321
Copy link
Owner

Did not occur iCloud3 v3.1.5. Reopen if problem continues.

@bobvmierlo
Copy link
Author

Issue is still there, but it does seem to disapear after one (or sometimes a few) restarts of HA.

02-11 19:44:01 iCloud3 v3.1.5b3
Traceback (most recent call last):
  File "/config/custom_components/icloud3/icloud3_main.py", line 947, in process_updated_location_data
    Device.write_ha_device_tracker_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/device.py", line 1617, in write_ha_device_tracker_state
    self.DeviceTracker.write_ha_device_tracker_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/device_tracker.py", line 649, in write_ha_device_tracker_state
    self.schedule_update_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1260, in schedule_update_ha_state
    self.hass.loop.call_soon_threadsafe(
    ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'loop'

02-11 19:44:01 1stLOC  Traceback (most recent call last):
  File "/config/custom_components/icloud3/icloud3_main.py", line 947, in process_updated_location_data
    Device.write_ha_device_tracker_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  File "/config/custom_components/icloud3/device.py", line 1617, in write_ha_device_tracker_state
    self.DeviceTracker.write_ha_device_tracker_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/device_tracker.py", line 649, in write_ha_device_tracker_state
    self.schedule_update_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1260, in schedule_update_ha_state
    self.hass.loop.call_soon_threadsafe(
    ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'loop'

@bobvmierlo
Copy link
Author

bobvmierlo commented Feb 11, 2025

Would also like to add, that after this error the eventlog card become non-functional. All the buttons and dropdown menu are responsive but clicking anything does not show anything in the eventlog.

I did manage to get the integration and card working without the error by removing my apple account and readding it and after that reconfiguring the devices. The eventlog will however still show that I'm not running the latest version, while I updated from HAS a few minutes ago. I tried installing manually by downloading the zip file from Github, but the message stays.

Image

@gcobb321
Copy link
Owner

gcobb321 commented Feb 11, 2025

I have just uploaded v3.1.5.1 to correct the version number problem.

If you have a lockup problem again, I would like to get a copy of the icloud3.log file to see what is creating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants