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

Can't restore addons from a backup in Supervisor 2022.03.2 #3497

Closed
sermayoral opened this issue Mar 9, 2022 · 17 comments · Fixed by #3507
Closed

Can't restore addons from a backup in Supervisor 2022.03.2 #3497

sermayoral opened this issue Mar 9, 2022 · 17 comments · Fixed by #3507
Labels

Comments

@sermayoral
Copy link

sermayoral commented Mar 9, 2022

Describe the issue you are experiencing

Cannot restore any addon from a backup when the addon is not installed on the system

What is the used version of the Supervisor?

2022.03.2

What type of installation are you running?

Home Assistant Supervised

Which operating system are you running on?

Debian

What is the version of your installed operating system?

Debian Bullseye (aarch64)

What version of Home Assistant Core is installed?

2022.3.3

Steps to reproduce the issue

...

Anything in the Supervisor logs that might be useful for us?

22-03-09 21:42:59 INFO (MainThread) [supervisor.addons.addon] Restore config for addon a0d7b954_vscode
22-03-09 21:43:00 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'a0d7b954_vscode'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 367, in restore
    await addon.restore(tar_file)
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 832, in restore
    restore_image = self._image(data[ATTR_SYSTEM])
  File "/usr/src/supervisor/supervisor/addons/model.py", line 629, in _image
    return config[ATTR_IMAGE].format(arch=self.arch)
  File "/usr/src/supervisor/supervisor/addons/model.py", line 509, in arch
    if ATTR_IMAGE in self.data:
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 157, in data
    return self.sys_addons.data.system[self.slug]
KeyError: 'a0d7b954_vscode'
22-03-09 21:43:00 WARNING (MainThread) [supervisor.backups.backup] Can't restore Add-on a0d7b954_vscode: 
22-03-09 21:44:54 INFO (MainThread) [supervisor.addons.addon] Restore config for addon a0d7b954_unifi
22-03-09 21:44:54 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'a0d7b954_unifi'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 367, in restore
    await addon.restore(tar_file)
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 832, in restore
    restore_image = self._image(data[ATTR_SYSTEM])
  File "/usr/src/supervisor/supervisor/addons/model.py", line 629, in _image
    return config[ATTR_IMAGE].format(arch=self.arch)
  File "/usr/src/supervisor/supervisor/addons/model.py", line 509, in arch
    if ATTR_IMAGE in self.data:
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 157, in data
    return self.sys_addons.data.system[self.slug]
KeyError: 'a0d7b954_unifi'
22-03-09 21:44:54 WARNING (MainThread) [supervisor.backups.backup] Can't restore Add-on a0d7b954_unifi: 
22-03-09 21:44:56 INFO (MainThread) [supervisor.addons.addon] Restore config for addon a0d7b954_nginxproxymanager
22-03-09 21:44:56 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'a0d7b954_nginxproxymanager'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 367, in restore
    await addon.restore(tar_file)
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 832, in restore
    restore_image = self._image(data[ATTR_SYSTEM])
  File "/usr/src/supervisor/supervisor/addons/model.py", line 629, in _image
    return config[ATTR_IMAGE].format(arch=self.arch)
  File "/usr/src/supervisor/supervisor/addons/model.py", line 509, in arch
    if ATTR_IMAGE in self.data:
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 157, in data
    return self.sys_addons.data.system[self.slug]
KeyError: 'a0d7b954_nginxproxymanager'
22-03-09 21:44:56 WARNING (MainThread) [supervisor.backups.backup] Can't restore Add-on a0d7b954_nginxproxymanager: 
22-03-09 21:44:56 INFO (MainThread) [supervisor.addons.addon] Restore config for addon 5c53de3b_esphome
22-03-09 21:44:56 ERROR (MainThread) [supervisor.jobs] Unhandled exception: '5c53de3b_esphome'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 367, in restore
    await addon.restore(tar_file)
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 832, in restore
    restore_image = self._image(data[ATTR_SYSTEM])
  File "/usr/src/supervisor/supervisor/addons/model.py", line 629, in _image
    return config[ATTR_IMAGE].format(arch=self.arch)
  File "/usr/src/supervisor/supervisor/addons/model.py", line 509, in arch
    if ATTR_IMAGE in self.data:
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 157, in data
    return self.sys_addons.data.system[self.slug]
KeyError: '5c53de3b_esphome'
22-03-09 21:44:56 WARNING (MainThread) [supervisor.backups.backup] Can't restore Add-on 5c53de3b_esphome: 
22-03-09 21:44:56 INFO (MainThread) [supervisor.addons.addon] Restore config for addon core_mosquitto
22-03-09 21:44:56 ERROR (MainThread) [supervisor.jobs] Unhandled exception: 'core_mosquitto'
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 106, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 367, in restore
    await addon.restore(tar_file)
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 832, in restore
    restore_image = self._image(data[ATTR_SYSTEM])
  File "/usr/src/supervisor/supervisor/addons/model.py", line 629, in _image
    return config[ATTR_IMAGE].format(arch=self.arch)
  File "/usr/src/supervisor/supervisor/addons/model.py", line 509, in arch
    if ATTR_IMAGE in self.data:
  File "/usr/src/supervisor/supervisor/addons/addon.py", line 157, in data
    return self.sys_addons.data.system[self.slug]
KeyError: 'core_mosquitto'
22-03-09 21:44:56 WARNING (MainThread) [supervisor.backups.backup] Can't restore Add-on core_mosquitto:

Additional information

No response

@sermayoral sermayoral added the bug label Mar 9, 2022
@sermayoral sermayoral changed the title Cant restore addons from a backup Can't restore addons from a backup in Supervisor 2022.03.2 Mar 9, 2022
@crhass
Copy link

crhass commented Mar 9, 2022

I am getting this too, after installing supervisor 2022.03.2 and losing access to my supervisor page, I prepared a new rpi3 with 64bit image. I restored my full snapshot and everything restored except all the add-ons.

I thought this was because I moved from 32 to 64bit but maybe not?

@sermayoral
Copy link
Author

I am getting this too, after installing supervisor 2022.03.2 and losing access to my supervisor page, I prepared a new rpi3 with 64bit image. I restored my full snapshot and everything restored except all the add-ons.

I thought this was because I moved from 32 to 64bit but maybe not?

No. I have the same problem from 64 to 64. It's a supervisor problem

@nodomain
Copy link

Same here. Can I somehow install an older supervisor version?

Bad timing, I wanted to re-install due to issues with my storage :(

@sermayoral
Copy link
Author

sermayoral commented Mar 10, 2022

I found that, if you install the addon on the new system, without starting and configuring anything on the addon, you can restore the addon from a backup to import your previous configuration and it works. The problem is restoring an addon when it doesn't exist on your system (that is a normal behaviour when you try to restore a full backup)

@crhass
Copy link

crhass commented Mar 10, 2022

I found that, if you install the addon on the new system, without starting and configuring anything on the addon, you can restore the addon from a backup to import your previous configuration and it works. The problem is restoring an addon when it doesn't exist on your system (that is a normal behaviour when you try to restore a full backup)

Does this work around restore the folders?

@sermayoral
Copy link
Author

sermayoral commented Mar 10, 2022

I found that, if you install the addon on the new system, without starting and configuring anything on the addon, you can restore the addon from a backup to import your previous configuration and it works. The problem is restoring an addon when it doesn't exist on your system (that is a normal behaviour when you try to restore a full backup)

Does this work around restore the folders?

No. For the folders you have to unzip the backup file and copy the folders manually to your home assistant instance :-(

@johncoles
Copy link

I am having this issue with a 2022.03.3 to a 2022.03.3 transfer.

https://discord.com/channels/330944238910963714/944337294389805056/951492809033138247

@johncoles
Copy link

Can confirm that for me atleast installing the add-ons then rerunning the restore works.

@sermayoral
Copy link
Author

sermayoral commented Mar 10, 2022

The error seems clear. Try to find some data of the installed addons (I think the slug). Since the addon is not installed, it throws an unhandled exception.

The question is: Is not there a beta program for the supervisor releases? Was not this error detected before releasing the new supervisor version? (Especially when we talk about a component that you have no choice to install, not install, doing a rollback...). Many people have suffered this problem without being able to restore backups, in some cases with serious consequences

@johncoles
Copy link

The error seems clear. Try to find some data of the installed addons (I think the slug). Since the addon is not installed, it throws an unhandled exception.

Indeed, though it might be nice to point the user in the direction of "Have you installed the add-on?"

@sermayoral
Copy link
Author

sermayoral commented Mar 10, 2022

The error seems clear. Try to find some data of the installed addons (I think the slug). Since the addon is not installed, it throws an unhandled exception.

Indeed, though it might be nice to point the user in the direction of "Have you installed the add-on?"

I don't think this is the right direction. The addon should install itself automatically, as it has always worked. Just they have had a coding error, something very common in programming. The problem is not having detected it in the testing phase, especially when it is a component that autoupdates itself without user permission

@johncoles
Copy link

Looks like @ludeeus is on it :D

@Varming73
Copy link

After upgrading the supervisor and restoring all my Zigbee devices are gone in the Zigbee2mqtt add in. I guess that is related to this somehow. Got no lights in the house now :(

@janick
Copy link

janick commented Mar 11, 2022

After upgrading the supervisor and restoring all my Zigbee devices are gone in the Zigbee2mqtt add in. I guess that is related to this somehow.

It may be related to this one: home-assistant/core#67780

I hope not because I'm planning to install Zigbee2mqtt to see if it works around the ZHA problem.

@sermayoral
Copy link
Author

@mdegat01 please, don't forget to do a release as soon as possible. Backup and restore is not still possible for us with the actual release...

@ocalvo
Copy link

ocalvo commented Mar 13, 2022

I am seeing the same

@HarvsG

This comment was marked as off-topic.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants