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

Cannot add existing BorgBase repository to Vorta #1851

Closed
2 tasks done
nihil21 opened this issue Nov 26, 2023 · 3 comments
Closed
2 tasks done

Cannot add existing BorgBase repository to Vorta #1851

nihil21 opened this issue Nov 26, 2023 · 3 comments
Labels
status:stale This item will be closed soon due to inactivity type:support A question about using vorta

Comments

@nihil21
Copy link

nihil21 commented Nov 26, 2023

Description

I've reinstalled my OS and tried to reconfigure Vorta, but when I try to add the existing repository on BorgBase the program crashes with an exception (see attached logs).

I'm using the latest stable version (v0.8.12-3) from AUR: if I try to use the v0.9.1-beta2 it works.

Reproduction

  • I tried to reproduce the issue.
  • I was able to reproduce the issue.

OS

EndeavourOS

Version of Vorta

0.8.12-3

What did you install Vorta with?

Other

Version of Borg

1.2.6-1

Logs

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/peewee.py", line 7136, in get
    return clone.execute(database)[0]
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 4486, 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.11/site-packages/peewee.py", line 6730, in get_or_create
    return query.get(), False
           ^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 7139, in get
    raise self.model.DoesNotExist('%s instance matching query does '
vorta.store.models.RepoModelDoesNotExist: <Model: RepoModel> instance matching query does not exist:
SQL: SELECT "t1"."id", "t1"."url", "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 ?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/vorta/views/repo_add_dialog.py", line 246, in run
    self.thread.run()
  File "/usr/lib/python3.11/site-packages/vorta/borg/borg_job.py", line 326, in run
    self.process_result(result)
  File "/usr/lib/python3.11/site-packages/vorta/borg/info_repo.py", line 56, in process_result
    new_repo, _ = RepoModel.get_or_create(url=result['cmd'][-1])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 6732, in get_or_create
    raise exc
  File "/usr/lib/python3.11/site-packages/peewee.py", line 6727, in get_or_create
    return cls.create(**kwargs), True
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 6596, in create
    inst.save(force_insert=True)
  File "/usr/lib/python3.11/site-packages/playhouse/signals.py", line 71, in save
    ret = super(Model, self).save(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 6806, in save
    pk = self.insert(**field_dict).execute()
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 1971, in inner
    return method(self, database, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 2042, in execute
    return self._execute(database)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 2847, in _execute
    return super(Insert, self)._execute(database)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 2560, in _execute
    cursor = database.execute(self)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 3259, in execute
    return self.execute_sql(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/peewee.py", line 3249, in execute_sql
    with __exception_wrapper__:
  File "/usr/lib/python3.11/site-packages/peewee.py", line 3019, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "/usr/lib/python3.11/site-packages/peewee.py", line 192, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.11/site-packages/peewee.py", line 3251, in execute_sql
    cursor.execute(sql, params or ())
peewee.IntegrityError: NOT NULL constraint failed: repomodel.name
@m3nu
Copy link
Contributor

m3nu commented Nov 26, 2023

Hi, no need to reinstall your OS. This error is purely from Vorta's settings.

peewee.IntegrityError: NOT NULL constraint failed: repomodel.name

When you used the newer version (0.9), your settings database was upgraded and won't work with older versions. You would need to keep with the newer version or remove the settings database and start over. Just moving settings.db found in .config/Vorta (?) or whatever standard config path would be enough.

Note to self: We should consider adding a check to avoid running on disparate settings DB versions?

@m3nu m3nu added the type:support A question about using vorta label Nov 26, 2023
@nihil21
Copy link
Author

nihil21 commented Nov 26, 2023

Hi, no need to reinstall your OS. This error is purely from Vorta's settings.

Sorry, I wasn't clear: what I meant is that I had to reinstall my OS for other reasons, and that I encountered the issue while I was trying to re-configure Vorta on the fresh install, using the same old repository on BorgBase.

When you used the newer version (0.9), your settings database was upgraded and won't work with older versions. You would need to keep with the newer version or remove the settings database and start over. Just moving settings.db found in .config/Vorta (?) or whatever standard config path would be enough.

I've found it in ~/.local/share/Vorta, and I confirm that by moving it the 0.8 version works again. Thanks!

Note to self: We should consider adding a check to avoid running on disparate settings DB versions?

Should I close this then?

Copy link

github-actions bot commented Apr 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the status:stale This item will be closed soon due to inactivity label Apr 8, 2024
@nihil21 nihil21 closed this as completed Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:stale This item will be closed soon due to inactivity type:support A question about using vorta
Projects
None yet
Development

No branches or pull requests

2 participants