-
Notifications
You must be signed in to change notification settings - Fork 137
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
diff: KeyError in get_dict_from_list when diffing archives with a removed folder that now has .nobackup #940
Comments
The diff feature was completely rewritten for the upcoming 0.7.6 version. So the issue you are describing is probably already resolved in the current |
Thanks. I would like to test against master branch - are there any quick pointers on how to pull and install? I originally installed Vorta from binary; I also have brew installation. Thanks. |
Thank you. I managed to get it to install, and run, but still appears to be pulling 0.7.5 and was getting same error on running this version of vorta. (sorry, no logs from installation.) Attempting to debug. |
To use the latest json-based parsing it also needs Borg 1.1.16. But if list-based parsing still has an issue, we should address that too. If you mean the version number inside the app, it’s only updated before a release. |
Thanks. I'm reinstalling brew and will install Borg and Vorta from there and then test. |
Very similar error is still returned. Running Borg 1.1.16 from brew and latest Vorta installed via pip3. Log of error: However, the command is successful and returns a list of changes when run at the command line in Terminal. |
Tagging @rblenis , who is the expert on json-diff. |
I will take a look at it this weekend. |
I couldn't reproduce this in the current We did get a similar issue report #650 last year, so maybe there is something going on. |
I should provide more detail on the use case. I have tried again but fail to reproduce with current 0.7.5 binary.
I have the original archives that failed the diff and the only difference I can see between the various archives is the order of the folders, when looking through the extract window (one is the reverse order to the other). But diffs to other archives with the same opposite folder order do not force an exception. |
- 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 adict, 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).
- 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 adict, 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).
- 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).
* 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
Describe the bug
A folder was removed as a source using the source window in Vorta. The file .nobackup was touched in the removed folder and a subsequent backup was run.
When diffing the .nobackup archive run with the previous archive (which included the folder), the following error occurred (note: from Vorta logs). In this example, the folder "Music" was removed and .nobackup placed in the folder.
2021-04-06 23:25:36,589 - vorta.borg.borg_thread - INFO - Running command /Applications/Vorta.app/Contents/Resources/borg-dir/borg.exe diff --info --log-json xxxxxx@xxxxxx.repo.borgbase.com:repo::hostname-2021-04-06-185815 hostname-2021-04-06-190533
2021-04-06 23:25:42,110 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
File "views/archive_tab.py", line 520, in list_diff_result
File "views/diff_result.py", line 22, in init
File "views/diff_result.py", line 94, in parse_diff_lines
File "views/diff_result.py", line 87, in parse_line
File "utils.py", line 112, in get_dict_from_list
KeyError: 'Music'
Note: an additional backup was run and a diff on the two most recent archives (those with the .nobackup exclude) was successful. The failure occurs diffing the transition to .nobackup.
To Reproduce
Steps to reproduce the behavior:
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: