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

iCloud3 v3, Release Candidate 2 - fails to load, bootstrap.py:531 #178

Closed
d-d opened this issue Aug 9, 2023 · 15 comments
Closed

iCloud3 v3, Release Candidate 2 - fails to load, bootstrap.py:531 #178

d-d opened this issue Aug 9, 2023 · 15 comments

Comments

@d-d
Copy link

d-d commented Aug 9, 2023

Upgraded to iCloud3 v3, Release Candidate 2
It fails to load

Logger: homeassistant.bootstrap
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:531
First occurred: 10:52:18 (1 occurrences)
Last logged: 10:52:18

Error setting up integration icloud3 - received exception
asyncio.exceptions.CancelledError

Home Assistant 2023.8.1
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230802.0 - latest

@gcobb321
Copy link
Owner

gcobb321 commented Aug 9, 2023

Are you using the iOS app and the mobile_app integration?
If not, edit the icloud3/manifest.json file. Remove mobile_app from the after_dependicies line. Save and restart HA.

Right now, that line looks like this.
"after_dependencies": ["recorder", "ios", "mobile_app", "device_tracker", "sensor"],

I’m running the same side version of HA.

@d-d
Copy link
Author

d-d commented Aug 11, 2023

Yes, I am using the iOS app and the mobile_app integration.

I changed the line to
"after_dependencies": ["recorder", "ios", "device_tracker", "sensor"],
and restarted HA

Still fails to start with error

2023-08-10 17:14:56.987 ERROR (MainThread) [homeassistant.setup] Setup of device_tracker is taking longer than 300 seconds. Startup will proceed without waiting any longer
2023-08-10 17:14:57.033 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration icloud3 - received exception
asyncio.exceptions.CancelledError

Maybe this is obvious to you, but if I go into the Integrations menu and choose to Configure, I get an error too:

Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble

I will try to disable some of the other integrations and see if I can resolve it this way. The setup worked fine before upgrading to the RC2.

@gcobb321
Copy link
Owner

I’d like to see your home_assistant.log and the icloud3_0.log files. Can’t you email them to geekstergary@gmail.com.

Try reinstalling iCloud3 again. Either from HACS or unzipping the icloud3 zip file and restarting HA.

@d-d
Copy link
Author

d-d commented Aug 11, 2023

Removing the dependency for "device_tracker" seems to have done the trick. By removing it from RC2 starts again and is working as before.
The icloud3/manifest.json now looks as:
"after_dependencies": ["recorder", "ios", "sensor"],
and now RC2 is starting up.

I will email you the logs.

@gcobb321
Copy link
Owner

Did you mean removing "mobile_app"? or "device_tracker"?

I added "mobile_app" because HA runs the code through some type of verifier when creating a release. It kept coming up with "mobile_app" needed to be added as a dependency (which it is not) or an after_dependency (which is not needed by mee).

thanks for the logs. That may tell something.

@d-d
Copy link
Author

d-d commented Aug 11, 2023

I had to remove both mobile_app and device_tracker
The working line is when both are gone,
"after_dependencies": ["recorder", "ios", "sensor"],
When I add device_tracker OR mobile_app OR both back, i get the error that Setup of device_tracker takes longer than 300 seconds and that icloud3 has received an exception.

I hope you can figure out something from the logs. My config might just need cleaning up, it is getting old now with lots of upgrades over the years. At the same time, this will be the case for many others too, so I suppose it is good to gracefull handle such problems.

@gcobb321
Copy link
Owner

And I'm running with both of them in the list. There must be some conflict somewhere and I hope the logs will help figure it out.

Do you have a known_devices.yaml file? I'm reworking the code to remove any iCloud3 devices from it to preserve anything else that is in it. I think it's just a text file but I'm getting an HA error and want to verify the format.

@d-d
Copy link
Author

d-d commented Aug 11, 2023

I do have a known_devices.yaml file
The format is basic

joes_ipad:
  hide_if_away: true
  icon:
  mac: BT_8C:FA:FF:31:1E:2A
  name: Joe's iPad
  picture:
  track: true

Each such device entry seems to be separated by one or more empty lines.

@ABredhauer
Copy link

ABredhauer commented Aug 11, 2023

I'm also seeing the same error. Happy to provide logs or other files if you need another set

Home Assistant 2023.7.3
Supervisor 2023.08.1
Operating System 10.4
Frontend 20230705.1 - latest

@FrancoLoco
Copy link

Also have problems with this version I'm reverting to the previous one

@gcobb321
Copy link
Owner

@d-d
I finally had a chance to review your log files and found this:

  1. There was an error setting up the Samsung TV. This was followed by the following 5-secs later:
2023-08-10 17:14:56.987 ERROR (MainThread) [homeassistant.setup] Setup of device_tracker is taking 
longer than 300 seconds. Startup will proceed without waiting any longer
2023-08-10 17:14:57.033 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration
 icloud3 - received exception asyncio.exceptions.CancelledError

iCloud3 had an 'device_tracker' after_dependency in the manifest.json file which tells HA that iCloud3 has to be set up after the device_tracker. When the device_tracker failed, HA aborted iCloud3. I have removed those dependencies from the manifest.json.

That HA failure to load iCloud3 caused another error later on when you opened the Devices & Services > iCloud3 Configure Settings since the configuration file had not been opened and loaded.

  1. You are getting a message indicating there is still a platform: icloud3 in your configuration.yaml file. It is being ignored but you can remove it and config_ic3.yaml if you are using it.

  2. There was a network/internet error and iCloud3 could not get location data from your iCloud account. That dumped error messages to the log file, along with a 'communication/network response error'. I have changed to error reporting so the internal error messages are not displayed. Only the 'friendly' error message will be displayed in the logs and the Event Log.

The real problem was #1 when HA failed to start the device_tracker and iCloud3. The manifest.json file is changed ot what it was in rc3

@gcobb321
Copy link
Owner

gcobb321 commented Aug 14, 2023

@d-d @ABredhauer @FrancoLoco

Here is a prelease of iCloud3 v3 rc3 with the fixes to your issues noted above.

icloud3_v3-rc3.zip

Download the zip file and unzip it into the iCloud3 directory. Let me know if you see anything else and I'll address it before the release. Thanks for testing it on your system.

Change Log:

  1. Reverted the 'manifest.json' file to prevent iCloud3 from hanging on an HA startup if there is a problem starting some of the HA components.
  2. Added a 'Restart HA, Reload iCloud3' to the Configure Settings > Actions list. You can now restart HA or reload only the iCloud3 component if the is a problem.
  3. Fixed some v2 to v3 configuration migration issues.

@ABredhauer
Copy link

@gcobb321 sorry for the delay, I've only just been able to install the prerelease version. So far I can confirm it starts up fine with no errors but will let you know if anything else pops up

@d-d
Copy link
Author

d-d commented Aug 16, 2023

@gcobb321 I can also confirm the prerelease starts up without issues on my system and tracking is working. I will let you know if there are issues later.

@gcobb321
Copy link
Owner

gcobb321 commented Aug 18, 2023

I just posted an updated rc3.
Find it on issue 177 here. Scroll to the bottom.

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

4 participants