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

Downloader not initializing #114829

Closed
DarthSonic opened this issue Apr 4, 2024 · 20 comments
Closed

Downloader not initializing #114829

DarthSonic opened this issue Apr 4, 2024 · 20 comments

Comments

@DarthSonic
Copy link

The problem

Downloader does not start/initialize.

What version of Home Assistant Core has the issue?

core-2024.4.0

What was the last working version of Home Assistant Core?

core-2023.3.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Downloader

Link to integration documentation on our website

https://www.home-assistant.io/integrations/downloader/

Diagnostics information

Logger: homeassistant.bootstrap
Quelle: setup.py:181
Erstmals aufgetreten: 10:29:47 (1 Vorkommnisse)
Zuletzt protokolliert: 10:29:47

Error setting up integration downloader - received exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 166, in async_setup_component
setup_future.set_result(result)
asyncio.exceptions.InvalidStateError: invalid state

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 181, in async_setup_component
future.set_exception(err)
asyncio.exceptions.InvalidStateError: invalid state

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Apr 4, 2024

Hey there @erwindouna, mind taking a look at this issue as it has been labeled with an integration (downloader) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of downloader can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign downloader Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


downloader documentation
downloader source
(message by IssueLinks)

@CrouchingWorm
Copy link

+1 Pls.
I'm in the same boat.

@billmaterial
Copy link

Me too!!!

@Jazza159
Copy link

Jazza159 commented Apr 4, 2024

+1 please. Same issue after updating to 2024.4.
The downloader.download_file service doesn't seem to exist.

@ydellis
Copy link

ydellis commented Apr 4, 2024

The same for me.

@andrewcliffoutlook
Copy link

If you restart HA is does load and imports the yaml configuration entry as well as warn about the deprecation of the yaml version and to remove the enries from configuration.yaml

@dannytsang
Copy link

If you restart HA is does load and imports the yaml configuration entry as well as warn about the deprecation of the yaml version and to remove the enries from configuration.yaml

This worked for me. Thank you

@AngeloAna
Copy link

If you remove the configuration.yaml entries, where do you specify the network share to output the files?

@dierochade
Copy link

Can it be that it’s just the setup procedure that changed? In release notes is stated: ‚now available to set up from the UI’

I can’t verify on my own right now…

https://www.home-assistant.io/integrations/downloader

@dannytsang
Copy link

dannytsang commented Apr 4, 2024

If you remove the configuration.yaml entries, where do you specify the network share to output the files?

It should go in the subdir parameter. Here's an example of what I have now:

      - service: downloader.download_file
        data:
          url: 'https://myimage.com/image.jpg'
          subdir: /config/camera
          filename: camera.jpg

I haven't tried it with a network share but it works when the file is stored on locally.

@AngeloAna
Copy link

I figured it out. I removed the configuration.yaml downlaoder: entry. I then deleted the integration. I rebooted HA. I then added the integration from the UI. It asked for the output location. I specified my share location. Everything seems to be working now.

@DarthSonic
Copy link
Author

If you remove the "old" configuration form configuration.yaml, remove integration of "Downloader", then restart, you can add the integration "Downloader" and specify the download directory. Then you can run your automation script and everything should work.

@jprates
Copy link

jprates commented Apr 4, 2024

As I mentioned here, it would be a great improvement if we could see what dir was set in that new downloader UI.

As it stands now on 2024.4 after we set the dir there is no way AFAIK to check/read the dir set in place.

I'd like to ask the developer(s) (@erwindouna ?) to please include it in the UI so that it gets visibility.

Cheers,
-jprates

@erwindouna
Copy link
Contributor

I am currently still investigating what could cause this - it's not very straight forward at the moment.

@daernsinstantfortress
Copy link

Thanks all - looks like a bug relating to the migration from YAML to UI configuration. As others have said, removing the YAML config and rebooting allows it to load. No need to remove the integration - it loaded just fine after the reboot.

@bdraco
Copy link
Member

bdraco commented Apr 4, 2024

Please post the full log there is likely an exception that happened before asyncio.exceptions.InvalidStateError: invalid state that gets the setup into an invalid state that will need to be discovered to find the source of the issue

@bdraco
Copy link
Member

bdraco commented Apr 4, 2024

We do usually do import flows in a task

import_result = await hass.config_entries.flow.async_init(

It looks like the import flow does not abort on invalid dir

errors["base"] = "cannot_connect"
and instead will present a form

@bkbartk
Copy link

bkbartk commented Apr 4, 2024

Thanks all - looks like a bug relating to the migration from YAML to UI configuration. As others have said, removing the YAML config and rebooting allows it to load. No need to remove the integration - it loaded just fine after the reboot.

I tried without removing the integration, but that didn't work for me, so it might depend on a setting if this is needed or not.

but it's working now and that's the most important.

@bdraco bdraco mentioned this issue Apr 4, 2024
20 tasks
@Jazza159
Copy link

Jazza159 commented Apr 5, 2024

Thanks, everyone! Removing the YAML config and rebooting has it working again!

@erwindouna
Copy link
Contributor

Fixed provided in 2024.4.1.

@home-assistant home-assistant bot closed this as completed Apr 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests