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

Uncaught exception when doing a 'Diff' between latest and 2nd latest archives #925

Closed
aromanelli opened this issue Mar 28, 2021 · 3 comments

Comments

@aromanelli
Copy link

Fedora 33
Vorta 0.7.5

  1. Started Vorta.
  2. Did a backup to an existing repo on a Seagate 5TB USB drive (that had less than 1TB space left).
  3. Added a new 'Exclude Patterns' patten (/home/adrian/.gradle/wrapper/dists). Did not do another backup after that!
  4. Switched to 'Archives' tab.
  5. Selected 'Diff' button.
  6. Selected latest (newly done same run) archive and the most previous to that archive.
  7. Diff process was running for a bit, then the crash happened and an error dialog was shown. No diff results were shown.

I've done other diffs in the past successfully, but never after doing step #3.

Log entry below ...

2021-03-27 21:10:33,745 - asyncio - DEBUG - Using selector: EpollSelector
2021-03-27 21:10:33,748 - vorta.borg.borg_thread - DEBUG - Using VortaSecretStorageKeyring keyring to store passwords.
2021-03-27 21:10:33,751 - asyncio - DEBUG - Using selector: EpollSelector
2021-03-27 21:10:33,755 - root - DEBUG - Found 1 passwords matching repo URL.
2021-03-27 21:10:33,849 - vorta.borg.borg_thread - INFO - Running command /app/bin/borg diff --info --log-json /run/media/adrian/Seagate 5TB USB/Borg Backup::593150c8 ar-laptop-fedora-default-2021-03-27T21:04:25
2021-03-27 21:11:28,772 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
  File "/app/lib/python3.8/site-packages/vorta/views/archive_tab.py", line 520, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older)
  File "/app/lib/python3.8/site-packages/vorta/views/diff_result.py", line 22, in __init__
    files_with_attributes, nested_file_list = parse_diff_lines(fs_data.split('\n'))
  File "/app/lib/python3.8/site-packages/vorta/views/diff_result.py", line 94, in parse_diff_lines
    files_with_attributes.append(parse_line(line))
  File "/app/lib/python3.8/site-packages/vorta/views/diff_result.py", line 87, in parse_line
    d = get_dict_from_list(nested_file_list, dir.split('/'))
  File "/app/lib/python3.8/site-packages/vorta/utils.py", line 112, in get_dict_from_list
    return reduce(operator.getitem, mapList, dataDict)
KeyError: 'build'
@m3nu
Copy link
Contributor

m3nu commented Mar 28, 2021

Thanks for reporting. The diff feature is currently getting a bigger update to use the new json-diff format added in 1.1.16. PR #909

@m3nu
Copy link
Contributor

m3nu commented Apr 9, 2021

Couldn't reproduce this in current master branch with #909 applied.

m3nu added a commit to m3nu/vorta that referenced this issue Apr 12, 2021
m3nu pushed a commit that referenced this issue Apr 12, 2021
* fix issue #940 - KeyError in get_dict_from_list
- cause of error : defaultdict added more defaultdict while attempting to traverse the tree, but once a 'potential leaf' node was added, it was added as a dict, not a defaultdict.
- two possible solutions:
    - 1 - change everywhere that adds a 'potential' leaf node to add a defaultdict (ie nested_dict()) - this occurs in several places, but not many.
    - 2 - change get_dict_from_list to add a default dict (not defaultdict) when traversing the tree, for the case where a multi-level node is added on top of an existing node. This requires only changing a single location, and means that the dictionaries returned by accessing the tree will behave like normal dict (ie, won't by default add missing keys).
* Add test case for issues #940 and #925
@m3nu
Copy link
Contributor

m3nu commented Apr 12, 2021

Most likely fixed via #947 by @rblenis.

The fix is already merged into the current master branch. You can test it as described here. If the issue still occurs in the current master branch, please let us know.

@m3nu m3nu closed this as completed Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants