Skip to content

CrashΒ #2564

Open
Open

Description

@NikNikovsky

Description

Random crash when trying to make a repository

I was/ able to reproduce the issue.

Steps to reproduce the behavior:

  1. Attempt to make a new repository
  2. Fill out data and passphrase
  3. Press ok and wait
  4. See error

Environment

OS: Linux
Release: 7.2.4-300.fc45.x86_64
Version: #1 SMP PREEMPT_DYNAMIC Mon Sep 7 19:09:46 UTC 2026
Date and Time: 2026-09-19 09:51:05
Borg Version: 1.4.5
Vorta Version: 0.11.4

Logs

Traceback (most recent call last):
File "/usr/lib64/python3.15/site-packages/peewee.py", line 8372, in get
return clone.execute(database)[0]
~~~~~~~~~~~~~~~~~~~~~~~^^^
File "/usr/lib64/python3.15/site-packages/peewee.py", line 5342, 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 "/usr/lib/python3.15/site-packages/vorta/views/repo_tab.py", line 294, in process_new_repo
new_repo = RepoModel.get(url=result['params']['repo_url'])
File "/usr/lib64/python3.15/site-packages/peewee.py", line 7880, in get
return sq.get()
~~~~~~^^
File "/usr/lib64/python3.15/site-packages/peewee.py", line 8375, in get
raise self.model.DoesNotExist('%s instance matching query does '
'not exist:\nSQL: %s\nParams: %s' %
(clone.model, sql, params))
vorta.store.models.RepoModelDoesNotExist: <Model: RepoModel> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."url", "t1"."name", "t1"."added_at", "t1"."encryption", "t1"."unique_size", "t1"."unique_csize", "t1"."total_size", "t1"."total_unique_chunks", "t1"."create_backup_cmd", "t1"."extra_borg_arguments" FROM "repomodel" AS "t1" WHERE ("t1"."url" = ?) LIMIT ? OFFSET ?
Params: ['/run/media/user/KINGSOTNE/backup', 1, 0]

Activity

  1. NikNikovsky commented on Sep 19, 2026

    @NikNikovsky
    Author

    I rebooted the computer and this did not come back so idk

  2. ahmershahdev commented on Sep 24, 2026

    @ahmershahdev
  3. NikNikovsky commented on Sep 24, 2026

    @NikNikovsky
    Author

    Iirc no one took this but I don't see the issue anymore

  4. ahmershahdev commented on Sep 24, 2026

    @ahmershahdev
  5. added
    type:bugSomething doesn't work as intended
    on Oct 15, 2026
  6. ansh0014 commented on Nov 13, 2026

    @ansh0014

    hi, @m3nu ,
    i looked into this issue in the codebase and would like to work on it if it's open for contribution.

    in RepoTab.process_new_repo() (src/vorta/views/repo_tab.py), it currently does an unguarded RepoModel.get(url=result['params']['repo_url']), which throws RepoModelDoesNotExist and crashes the app if the row isn't found. BorgInitJob.process_result() (src/vorta/borg/init.py) and BorgInfoRepoJob.process_result() (src/vorta/borg/info_repo.py) both run RepoModel.get_or_create(...) before finished_event() is emitted, so it's not 100% clear what caused the missing record in that session (i couldn't reproduce it locally with peewee + sqlite wal across threads). still, BorgInfoRepoJob uses result['cmd'][-1] instead of result['params']['repo_url'], and any missing or mismatched lookup crashes instead of failing safely.

    for the fix, i'd like to pass result['repo_id'] = new_repo.id directly from BorgInitJob.process_result() and BorgInfoRepoJob.process_result() (and switch BorgInfoRepoJob to use result['params']['repo_url'] for consistency). then in RepoTab.process_new_repo(), look up the repo by repo_id using get_or_none() with a fallback to repo_url, and if it's still None, log it and show an error message instead of crashing, plus add unit tests in tests/unit/test_repo.py.

    if this approach sounds good, could you please assign this issue to me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething doesn't work as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions