Vorta Borg Schedule Overflow Error

I use Vorta, a GUI for Borg, as a backup solution on a Kubuntu 22.04 workstation, and recently I encountered a small bug with it.

I tried to change the schedule time for a particular profile from hours to weeks while the number itself was still at 12, which caused this fatal error:

Uncaught exception, please file a report with this text at 
https://github.com/borgbase/vorta/issuesinew Traceback 
(most recent call last): File Vusr/lib/python3/dist-packages/vortaNiews/
schedule_tab.py", line 92, in on_scheduler_change 
self.app.schedulerset_timer_for_profile(profile.id) File 
Vusr/lib/python3/dist-packages/vorta/scheduler.py", line 111, in 
set_timer_for_profile timersetIntervakint(timer_ms)) OverflowError: 
argument 1 overflowed: value must be in the range -2147483648 
to 2147483647 

Troubleshooting

Every time I load this profile the application hangs and needs to be terminated, I could not go back in the GUI to reconfigure the schedule settings.

It looks like the week schedule is out of range and after a bit of research I found out that this is already a known bug and fixed in newer versions. I just used the default version that comes with the Ubuntu 22.04 repository: Vorta 0.8.3

Fix app freeze

  • Ensure Vorta is closed:
    ps -ef | grep vorta
  • Backup database files (default path: $HOME/.local/share/Vorta/): for file in $HOME/.local/share/Vorta/*; do cp -v "$file" "${file}.bak"; done
  • After Vorta has crashed, there will probably be two files left in the directory which will also be used to restore or repair a sqlite3 database. Delete them to make sure that your upcoming changes are not replaced by them: settings.db-shm and settings.db-wal.
    rm -vi $HOME/.local/share/Vorta/*.db-shm $HOME/.local/share/Vorta/*.db-wal
  • Then I opened the settings.db with VSCode and the sqlite3-editor extension.
    • In the backupprofilemodel table I saw my two Vorta profiles.
    • In the schedule_mode column, I changed the internal value to 1.
    • Alternatively, change the value in the schedule_interval_unit column from weeks to hours.
    • Example SQL query:
      SELECT `name`, `schedule_mode`, `schedule_interval_unit` FROM backupprofilemodel;
      
  • Alternatively, use a sqlite3 cli command, for example:
    sqlite3 $HOME/.local/share/Vorta/settings.db \
    "UPDATE backupprofilemodel SET schedule_mode='off' WHERE name='backup-profile-name' AND schedule_mode='intervall';"
    

If you have exported your Vorta profile settings as json via the GUI, you could also just delete or rename the current database settings file so that Vorta starts like a fresh install. And then simply import your profile settings.

In my case, my profile would not have the latest edits. Not much has changed since my last profile export, but I wanted to see if I could just change the setting directly in the database file, which worked fine.
It would be nice to be able to automate the backup of the profile through the CLI, but it looks like this is only possible within the GUI. So the normal backup of the database file will have to do.

Moving to Flatpak

I decided to use the flatpak version of Vorta because it is maintained by the developers and I get the latest release.

Notice: Flatpak applications run in a sandboxed environment and can’t access certain folders, like /root/etc and /var. See here for the full list. If you need access to those directories, consider a different installation option.

Replace Vorta apt package installation with flatpak
  • Export profiles as json files via Vorta GUI
  • Remove the Vorta installation from the system package manager:
    sudo apt purge vorta && sudo apt autoremove
  • Install Vorta with flatpak:
    flatpak install flathub com.borgbase.Vorta
  • Open Vorta GUI and re-import profiles
  • Alternatively, copy the database settings file from the repository package install path to the Vorta flatpak settings directory: cp ~/.local/share/Vorta/settings.db ~/.var/app/com.borgbase.Vorta/data/Vorta/
  • Test the backup restore and run the backup jobs