vorta icon indicating copy to clipboard operation
vorta copied to clipboard

Error when adding locked repo

Open ddorian opened this issue 4 years ago • 3 comments
trafficstars

To Reproduce Steps to reproduce the behavior:

  1. Init a repository to a remote ssh using borg commandline 1.1.15
borg init user@host:/home/user/borg_backup --encryption=keyfile --remote-path="/usr/bin/borg-1.1.14/borg-1.1.14"
  1. Create a backup from command line but cancel it in the middle
borg create --stats user@host:/home/user/borg_backup::First ~/ --remote-path="/usr/bin/borg-1.1.14/borg-1.1.14"
  1. Try to add this repo to Vorta (using extra args --remote-path="/usr/bin/borg-1.1.14/borg-1.1.14"
  2. Get error below

Environment (please complete the following information):

  • OS: Ubuntu 18.04
  • Vorta version: Vorta 0.7.7, Borg 1.1.15
  • Installed from: pipx

Vorta and Borg versions can be found in Main Window > Misc Tab.

Additional context

2021-08-19 17:01:49,558 - root - DEBUG - Found 0 passwords matching repo URL.
2021-08-19 17:01:49,558 - vorta.borg.borg_thread - DEBUG - Password not found in primary keyring. Falling back to VortaDBKeyring.
2021-08-19 17:01:49,568 - vorta.borg.borg_thread - INFO - Running command /usr/bin/borg info --remote-path=/usr/bin/borg-1.1.14/borg-1.1.14 --info --json --log-json user@host:/home/user/borg_backup
2021-08-19 17:04:06,167 - vorta.borg.borg_thread - ERROR - Failed to create/acquire the lock /home/user/borg_backup/lock.exclusive (timeout).
2021-08-19 17:04:06,171 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 6884, in get
    return clone.execute(database)[0]
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 4275, in __getitem__
    return self.row_cache[item]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/vorta/application.py", line 221, in react_to_log
    profile = BackupProfileModel.get(name=context['profile_name'])
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 6438, in get
    return sq.get()
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 6887, in get
    raise self.model.DoesNotExist('%s instance matching query does '
vorta.models.BackupProfileModelDoesNotExist: <Model: BackupProfileModel> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."name", "t1"."added_at", "t1"."repo_id", "t1"."ssh_key", "t1"."compression", "t1"."exclude_patterns", "t1"."exclude_if_present", "t1"."schedule_mode", "t1"."schedule_interval_hours", "t1"."schedule_interval_minutes", "t1"."schedule_fixed_hour", "t1"."schedule_fixed_minute", "t1"."validation_on", "t1"."validation_weeks", "t1"."prune_on", "t1"."prune_hour", "t1"."prune_day", "t1"."prune_week", "t1"."prune_month", "t1"."prune_year", "t1"."prune_keep_within", "t1"."new_archive_name", "t1"."prune_prefix", "t1"."pre_backup_cmd", "t1"."post_backup_cmd", "t1"."dont_run_on_metered_networks" FROM "backupprofilemodel" AS "t1" WHERE ("t1"."name" = ?) LIMIT ? OFFSET ?
Params: ['New Repo', 1, 0]
2021-08-19 17:07:22,981 - vorta.keyring.abc - DEBUG - Only available on macOS
Uncaught exception, please file a report with this text at
https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 6884, in get
    return clone.execute(database)[0]
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 4275, in __getitem__
    return self.row_cache[item]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/vorta/application.py", line 221, in react_to_log
    profile = BackupProfileModel.get(name=context['profile_name'])
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 6438, in get
    return sq.get()
  File "/home/guru/.local/pipx/venvs/vorta/lib/python3.8/site-packages/peewee.py", line 6887, in get
    raise self.model.DoesNotExist('%s instance matching query does '
vorta.models.BackupProfileModelDoesNotExist: <Model: BackupProfileModel> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."name", "t1"."added_at", "t1"."repo_id", "t1"."ssh_key", "t1"."compression", "t1"."exclude_patterns", "t1"."exclude_if_present", "t1"."schedule_mode", "t1"."schedule_interval_hours", "t1"."schedule_interval_minutes", "t1"."schedule_fixed_hour", "t1"."schedule_fixed_minute", "t1"."validation_on", "t1"."validation_weeks", "t1"."prune_on", "t1"."prune_hour", "t1"."prune_day", "t1"."prune_week", "t1"."prune_month", "t1"."prune_year", "t1"."prune_keep_within", "t1"."new_archive_name", "t1"."prune_prefix", "t1"."pre_backup_cmd", "t1"."post_backup_cmd", "t1"."dont_run_on_metered_networks" FROM "backupprofilemodel" AS "t1" WHERE ("t1"."name" = ?) LIMIT ? OFFSET ?
Params: ['New Repo', 1, 0]

ddorian avatar Aug 19 '21 15:08 ddorian

Thanks for reporting this! I would still ask you to fill the full bug template, so we can reproduce it properly.

m3nu avatar Aug 20 '21 04:08 m3nu

@m3nu see above updated message. I was able to delete the original repo, create the repo from Vortex and am taking a backup.

ddorian avatar Aug 20 '21 04:08 ddorian

The root cause seems to be the locked repo, which makes Borg fail while adding the repo. We already deal with locked repos, but maybe not while adding them.

The other issue is that the profile you use doesn't exist. This could point to an issue with saving profile changes to the DB. This would be more interesting to fix than the failure of adding locked repos.

m3nu avatar Aug 20 '21 07:08 m3nu

I faced this issue too (on macOS, installed by brew). Luckily I found this issue, but a bit more informative error message would be desirable. :) Screenshot 2022-10-08 at 10 16 02

aapris avatar Oct 08 '22 07:10 aapris

Can you fill in this template @aapris and post it here?

real-yfprojects avatar Oct 08 '22 07:10 real-yfprojects

Closing as my issue was fixed. @aapris should open a new issue probably.

ddorian avatar Oct 08 '22 07:10 ddorian