Vorta: Crash in 'diff' operation

Created on 20 Aug 2019  路  16Comments  路  Source: borgbase/vorta

Describe the bug
Displaying the results of a 'Diff' operation causes a crash.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Archives'
  2. Click on 'Diff'
  3. Select two random archives
  4. Wait and observe crash

Desktop (please complete the following information):

  • OS: Fedora 30

Additional context
Traceback:

  File "/app/lib/python3.7/site-packages/vorta/views/archive_tab.py", line 456, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older)
  File "/app/lib/python3.7/site-packages/vorta/views/diff_result.py", line 80, in __init__
    files_with_attributes.append(parse_line(l))
  File "/app/lib/python3.7/site-packages/vorta/views/diff_result.py", line 60, in parse_line
    full_path = line[line.find(line_splitted[3]):]
IndexError: list index out of range

Flatpak info:

Vorta - Backup client

          ID: com.borgbase.Vorta
         Ref: app/com.borgbase.Vorta/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: v0.6.22
     License: GPL-3.0
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 69.5 MB
     Runtime: org.kde.Platform/x86_64/5.12
         Sdk: org.kde.Sdk/x86_64/5.12

      Commit: 747ccd36bac199696e666db72e9fb6cf9333e5eb89fd530bfba478e31ce1309b
      Parent: ab65debe01a91182501c5eb265859c1a3a6dc0f2437edcb50d7942c3f248dc78
     Subject: Update to v0.6.22 (7d9c4382)
        Date: 2019-08-04 22:24:11 +0000

All 16 comments

Happens to me too exactly the way described above, but only for my 'real' backup. For a small test-repository it does not seem to happen.
My system:
debian stretch with Python 3.7.0 compiled from source (so no flatpak is involved). Vorta installed via pip:
vorta --version
Vorta 0.6.22

$ vorta 
$ Traceback (most recent call last):
  File "/home/tycho/.local/lib/python3.7/site-packages/vorta/views/archive_tab.py", line 456, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older)
  File "/home/tycho/.local/lib/python3.7/site-packages/vorta/views/diff_result.py", line 80, in __init__
    files_with_attributes.append(parse_line(l))
  File "/home/tycho/.local/lib/python3.7/site-packages/vorta/views/diff_result.py", line 60, in parse_line
    full_path = line[line.find(line_splitted[3]):]
IndexError: list index out of range

Crashed for me too. Not using it, but maybe we should disable it, if it's not ready?

I personally like the feature, especially to see files I actually want to get rid off (;
Of course one could still use the cli, but maybe it's not so difficult to fix?

I wanted to wait to respond until I have access to my PC again, but okay.

It is possible that I oversaw an edge case. @m3nu could you please send me the output of borg diff which failed with Vorta per mail (only if it doesn't contain sensible data). I assume that the bug is quite simple to fix.

This looks promising: (posted before)

  File "/app/lib/python3.7/site-packages/vorta/views/archive_tab.py", line 456, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older)
  File "/app/lib/python3.7/site-packages/vorta/views/diff_result.py", line 80, in __init__
    files_with_attributes.append(parse_line(l))
  File "/app/lib/python3.7/site-packages/vorta/views/diff_result.py", line 60, in parse_line
    full_path = line[line.find(line_splitted[3]):]
IndexError: list index out of range

Are there any tests for this feature?

No, not yet

@m3nu I don't think that the error is enough, when I don't have the output of the borg diff command which causes it.

In my case the cli-output is:

$ /usr/bin/borg diff  /media/tycho/SAMSUNG/Backup/tycho/vorta::debian-dell-default-2019-08-21T13:27:10 debian-dell-default-2019-08-21T13:57:52    
  +1.7 MB   -1.7 MB home/tycho/.xsession-errors
 +23.4 MB  -23.4 MB home/tycho/.local/share/zeitgeist/fts.index/position.glass
  +4.1 MB   -4.1 MB home/tycho/.local/share/zeitgeist/fts.index/termlist.glass
 +13.8 MB  -13.8 MB home/tycho/.local/share/zeitgeist/fts.index/postlist.glass
   +133 B    -133 B home/tycho/.local/share/zeitgeist/fts.index/iamglass
+769.2 kB -769.2 kB home/tycho/.local/share/zeitgeist/activity.sqlite-wal
 +32.8 kB  -32.8 kB home/tycho/.local/share/zeitgeist/activity.sqlite-shm
+335.4 kB -334.8 kB home/tycho/.local/share/recently-used.xbel
+114.9 MB -114.9 MB home/tycho/.local/share/shournal/database.db
 +77.8 kB  -77.8 kB home/tycho/.local/share/Vorta/settings.db
+155.7 kB -154.3 kB home/tycho/.xfce4-session.verbose-log
+100.0 kB  -99.6 kB home/tycho/.bash_history
   +223 B    -219 B home/tycho/.config/gtk-2.0/gtkfilechooser.ini
  +1.8 kB   -1.8 kB home/tycho/.config/QtProject.conf
  +3.6 kB   -3.6 kB home/tycho/.config/shournal/config.ini
    +26 B     -26 B home/tycho/.config/borg/security/9e08807d171a66f3bc0532da37f1c75ab6ea5980714f58b967306745cb550886/manifest-timestamp
 +10.0 kB  -10.0 kB home/tycho/.gconf/apps/dockbarx/%gconf.xml
  +8.0 kB   -8.1 kB home/tycho/.gmrun_history
 +22.2 kB  -18.1 kB home/tycho/.netbeans/8.2/var/log/uigestures
    +75 B     -75 B home/tycho/.netbeans/8.2/config/Preferences/org/netbeans/modules/uihandler.properties
 +15.9 kB  -15.9 kB home/tycho/Notizen.txt
   +204 B     -53 B home/tycho/.thunderbird/9qrvt0c0.default/sessionCheckpoints.json
+252.0 kB -251.8 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/imap.mail.de/Trash.msf
+566.5 kB -565.8 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/imap.mail.de/INBOX.msf
 +57.4 kB  -55.7 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/imap.mail.de/INBOX.sbd/shop-Fehler.msf
+995.4 kB -979.8 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/imap.mail.de/INBOX.sbd/shop-Fehler
  +1.6 kB   -1.6 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/mail.your-server-1.de/INBOX-79.msf
+385.7 kB -384.0 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/mail.your-server.de/INBOX.msf
  +1.6 kB   -1.6 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/webmail.fh-erfurt.de/INBOX-3.msf
  +1.6 kB   -1.6 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/secureimap.t-online.de/INBOX-3.msf
+674.9 kB -674.8 kB home/tycho/.thunderbird/9qrvt0c0.default/ImapMail/imap.gmail.com/INBOX.msf
+524.3 kB -524.3 kB home/tycho/.thunderbird/9qrvt0c0.default/cookies.sqlite
+719.0 kB -743.0 kB home/tycho/.thunderbird/9qrvt0c0.default/panacea.dat
  +1.2 MB   -1.2 MB home/tycho/.thunderbird/9qrvt0c0.default/calendar-data/cache.sqlite
  +1.1 MB   -1.1 MB home/tycho/.thunderbird/9qrvt0c0.default/calendar-data/local.sqlite
removed    10.61 kB home/tycho/.local/share/shournal/readFiles/209
removed     4.87 kB home/tycho/.local/share/shournal/readFiles/210
removed     2.81 kB home/tycho/.local/share/shournal/readFiles/211
removed       494 B home/tycho/.config/session/konsole_2499b611e-e5fe-45e7-86f6-5c7c11634207_1566378459_16986
removed         0 B home/tycho/.thunderbird/9qrvt0c0.default/places.sqlite-wal
removed link        home/tycho/.thunderbird/9qrvt0c0.default/lock
removed    32.82 kB home/tycho/.thunderbird/9qrvt0c0.default/cookies.sqlite-wal
removed    32.77 kB home/tycho/.thunderbird/9qrvt0c0.default/cookies.sqlite-shm
removed         0 B home/tycho/.thunderbird/9qrvt0c0.default/webappsstore.sqlite-wal
removed    32.77 kB home/tycho/.thunderbird/9qrvt0c0.default/places.sqlite-shm
removed         0 B home/tycho/.thunderbird/9qrvt0c0.default/favicons.sqlite-wal
removed    32.77 kB home/tycho/.thunderbird/9qrvt0c0.default/favicons.sqlite-shm
removed    32.77 kB home/tycho/.thunderbird/9qrvt0c0.default/webappsstore.sqlite-shm
removed     3.41 MB home/tycho/.thunderbird/9qrvt0c0.default/calendar-data/cache.sqlite-wal
removed    32.77 kB home/tycho/.thunderbird/9qrvt0c0.default/calendar-data/cache.sqlite-shm
removed    16.49 kB home/tycho/.thunderbird/9qrvt0c0.default/datareporting/aborted-session-ping

@tycho-kirchner thanks. I will test the output at the next opportunity.

@Hofer-Julian : thanks. My shoot in the dark is the link line, which contains no size-column:
removed link home/tycho/.thunderbird/9qrvt0c0.default/lock

@tycho-kirchner yep, I think you found the problem!

If that's the case, it can be fixed within minutes.

https://github.com/borgbase/vorta/pull/351 should fix it.
Please check if it solves your problem (and if it doesn't introduce new ones).

Every command should have a test and related sample data in tests/borg_json_output/. I don't see that for borg diff yet. If this was overlooked before, now is a good time to add that.

True, I planned to add one last week but haven't found the time.
I'll try to add one during the next month. If you start to work on it on your own, please tell me so we don't do the same work twice.

@Hofer-Julian I tried your patch (to be true, I simply changed that one line ^^ ) and it now works perfectly well. Thanks.

Just as an idea in case there are more not respected keywords [ link, directory,...] ( I don't know how deep you were digging into borg-internals): You might also try to convert the size column(s) to float first, in case that fails, check if in ['directory', 'link'] and if that is not the case handle the bug. The whole application should not crash because of such a thing (;

@tycho-kirchner I just checked the source code and there is no additional keyword :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cerebrux picture cerebrux  路  7Comments

rwaldspur picture rwaldspur  路  5Comments

x80486 picture x80486  路  10Comments

strmd picture strmd  路  5Comments

thecursedfly picture thecursedfly  路  6Comments