Skip to content

Issue with single addon causes entire decryption to fail #5

@nathang21

Description

@nathang21

I'm getting this error when trying to extract/decrypt, however I confirmed that the cebe7a76_hassio_google_drive_backup.tar.gz file is present in the .tar archive, as well as in the backup.json (see attached).
backup.json

I only want to recover part of the files from this backup, but I haven't found a workaround.

I looked at #1 and confirmed I am able to open the root .tar file without issue, and can see all the .tar.gz files, but can not decrypt any of them. Is it possible to decrypt only one of these subfolders/archives? The utility as designed currently only appears to work on the root archive.

python3 -m decrypt-ha-backup Partial\ Backup\ 2024-03-01\ 03:00:00.tar --password='<redacted>'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/nathang21/Downloads/ha-restore/lib/python3.12/site-packages/decrypt-ha-backup/__main__.py", line 266, in <module>
    main()
  File "/Users/nathang21/Downloads/ha-restore/lib/python3.12/site-packages/decrypt-ha-backup/__main__.py", line 233, in main
    backup = Backup(backup_file)
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/nathang21/Downloads/ha-restore/lib/python3.12/site-packages/decrypt-ha-backup/__main__.py", line 66, in __init__
    self._items = [BackupItem(entry['slug'], entry['name'], self) for entry in self._config.get("addons")]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nathang21/Downloads/ha-restore/lib/python3.12/site-packages/decrypt-ha-backup/__main__.py", line 124, in __init__
    self._info = self._backup._tarfile.getmember(self.fileName)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.12/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/tarfile.py", line 1985, in getmember
    raise KeyError("filename %r not found" % name)
KeyError: "filename './cebe7a76_hassio_google_drive_backup.tar.gz' not found"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions