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

Error while creating backup #103778

Closed
Krandelbord opened this issue Nov 2, 2023 · 18 comments
Closed

Error while creating backup #103778

Krandelbord opened this issue Nov 2, 2023 · 18 comments

Comments

@Krandelbord
Copy link

Krandelbord commented Nov 2, 2023

Feedback

I have home assistant installed on docker in x86 machine.
When I press cerate backup button. I can see in docker logs the following stacktrace

2023-11-02 22:41:00.397 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140355756237888] Error handling message: Unknown error (unknown_error) Emilian from 127.0.0.1 (Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/backup/websocket.py", line 70, in handle_create
    backup = await manager.generate_backup()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 176, in generate_backup
    raise result
  File "/usr/src/homeassistant/homeassistant/components/zha/backup.py", line 15, in async_pre_backup
    zha_gateway = get_zha_gateway(hass)
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/helpers.py", line 446, in get_zha_gateway
    raise ValueError("No gateway object exists")
ValueError: No gateway object exists
2023-11-02 22:42:10.482 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140355756237888] Error handling message: Unknown error (unknown_error) Emilian from 127.0.0.1 (Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/backup/websocket.py", line 70, in handle_create
    backup = await manager.generate_backup()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 176, in generate_backup
    raise result
  File "/usr/src/homeassistant/homeassistant/components/zha/backup.py", line 15, in async_pre_backup
    zha_gateway = get_zha_gateway(hass)
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/helpers.py", line 446, in get_zha_gateway
    raise ValueError("No gateway object exists")
ValueError: No gateway object exists

URL

https://www.home-assistant.io/integrations/zha/
https://www.home-assistant.io/integrations/backup/

Version

2023.10.5

Additional information

No response

@marc-gist
Copy link

marc-gist commented Nov 4, 2023

upgraded to 2023.11.1 and its working again for me.

@Hedda
Copy link
Contributor

Hedda commented Nov 7, 2023

@Krandelbord @marc-gist This is a GitHub repo for documention and not the right place to ask for support or report bugs. This repo is only for reporting incorrect or missing information on the websites, and not get help with problems or bugs. See:

https://www.home-assistant.io/help/

You should instead ask for help in the in the community forum or Discord Chat Server and report any bugs as issues to the Home Assistant core repository (and if possible add the correct integration there if the issue is just with a specific integration):

https://community.home-assistant.io/ -> select matching section and subsection -> New Topic

https://github.com/home-assistant/core/issues (New issue -> Report an issue with Home Assistant Core

@rytilahti rytilahti transferred this issue from home-assistant/home-assistant.io Nov 11, 2023
@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (backup) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of backup 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 backup Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


backup documentation
backup source
(message by IssueLinks)

@home-assistant
Copy link

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

Code owner commands

Code owners of zha 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 zha Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zha documentation
zha source
(message by IssueLinks)

@rytilahti
Copy link
Member

Confirmed on 2023.11.2.

@rytilahti
Copy link
Member

In my case, the reason for this error was that I had a zha block lying around in the configuration.yaml file from some previous testing. The integration was not configured as I wasn't using it, so removing the entry from the configuration file fixed this for me. Maybe the backup platform should catch the raised exception on non-existing gateways?

@mekaneck
Copy link

mekaneck commented Dec 1, 2023

In my case, the reason for this error was that I had a zha block lying around in the configuration.yaml file from some previous testing. The integration was not configured as I wasn't using it, so removing the entry from the configuration file fixed this for me.

I had this exact same issue and same root cause. I was able to immediately identify the issue after reading your post.

In my case I was running HAOS and switched from the ZHA add-on to Z2M on an external Docker. Everything seemed to work fine, and some time later I switched from HAOS to HA-docker. Once on HA-Docker the backups couldn't be created. Removing the ZHA block fixed the issue.

I had automatic backups being created in HAOS and I believe they were working with the rogue ZHA block present, but unfortunately I can't 100% confirm that.

@sebPomme
Copy link

sebPomme commented Feb 8, 2024

I just have the same problem, try backup for the first time, got the bug, look at this issue, delete my old zha configuration (since I moved to z2mqtt). And it's works fine now.

@przemyslaw-latoch
Copy link

I have the same error in version 2024.4, and I do not have zha block in my configuration.yaml. What else can I do?

@klutchell
Copy link

I have the same error in version 2024.4, and I do not have zha block in my configuration.yaml. What else can I do?

@przemyslaw-latoch by any chance do you have any zha integrations marked as "ignored" on your integrations page?

I found that I had some discovered zha integrations, not installed, but marked as ignored so I didn't have to see them.

It wasn't until I marked them as un-ignored and restarted hass that backups would work. Tested twice with the same results.

So for me it seems that having discovered zha devices marked as ignored will result in this error on backups.

@przemyslaw-latoch
Copy link

I have the same error in version 2024.4, and I do not have zha block in my configuration.yaml. What else can I do?

@przemyslaw-latoch by any chance do you have any zha integrations marked as "ignored" on your integrations page?

I found that I had some discovered zha integrations, not installed, but marked as ignored so I didn't have to see them.

It wasn't until I marked them as un-ignored and restarted hass that backups would work. Tested twice with the same results.

So for me it seems that having discovered zha devices marked as ignored will result in this error on backups.

Unfortunately, it doesn't work for me. I didn't have any ignored ZHA integrations, but to be sure, I unignored all. The backup still doesn't work after a reboot.

@mochaslave
Copy link

I have the same error in version 2024.4, and I do not have zha block in my configuration.yaml. What else can I do?

Same here.

Since my latest backup is 2024.2.5, this issue should be related to some config change.

@iapYang
Copy link

iapYang commented Apr 10, 2024

@przemyslaw-latoch the same here,have u got any luck to solve it?

@przemyslaw-latoch
Copy link

@przemyslaw-latoch the same here,have u got any luck to solve it?

Nope, now I have version 2024.4.2 installed and still can't create a backup.

@przemyslaw-latoch
Copy link

I discovered that the custom integration XiaomiGateway3 might be the cause for me, and it will be fixed soon.
AlexxIT/XiaomiGateway3#1323

@mochaslave
Copy link

I discovered that the custom integration XiaomiGateway3 might be the cause for me, and it will be fixed soon. AlexxIT/XiaomiGateway3#1323

I have the same integration installed. I created a ZHA integration with XiaomiGateway3 to work around before the next release since I don't have Zigbee devices.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@puddly
Copy link
Contributor

puddly commented Jul 17, 2024

This issue was resolved I believe either in 2024.7.0 or 2024.6.0.

@puddly puddly closed this as completed Jul 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 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