vorta icon indicating copy to clipboard operation
vorta copied to clipboard

Doesn't recognise `added` diff change type properly.

Open pietrodicarbo opened this issue 3 years ago • 12 comments
trafficstars

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

Environment (please complete the following information):

  • OS:
  • Vorta version:
  • Installed from:

Vorta and Borg versions can be found in Main Window > Misc Tab.

Additional context If appropriate include logs. Can be found in Main Window > Misc Tab > Log.

Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/vorta/views/archive_tab.py", line 865, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older,
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 32, in __init__
    files_with_attributes, nested_file_list = parse_diff_json_lines(lines) \
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 123, in parse_diff_json_lines
    assert change_type  # either no changes, or unrecognized change(s)
AssertionError

pietrodicarbo avatar Jun 03 '22 06:06 pietrodicarbo

Can you fill in the complete bug template I inserted into you post?

real-yfprojects avatar Jun 03 '22 12:06 real-yfprojects

Describe the bug: When i try to compare two archives that this error occures sometimes. The possibilty of this happening is lower when the time difference of two archives is low.

To Reproduce Compare two archives. It doesn't matter if the repository is remote or on my machine.

Environment: OS: current manjaro-Stable Vorta version: v0.8.6 Installed from: flathub

Additional context: when vorta is started from console I see the following:

2022-06-06 09:03:12,895 - vorta.keyring.abc - DEBUG - Only available on macOS
2022-06-06 09:03:12,899 - asyncio - DEBUG - Using selector: EpollSelector
2022-06-06 09:03:12,901 - vorta.keyring.abc - DEBUG - Using VortaSecretStorageKeyring
2022-06-06 09:03:12,901 - vorta.borg.borg_job - DEBUG - Using VortaSecretStorageKeyring keyring to store passwords.
2022-06-06 09:03:12,902 - asyncio - DEBUG - Using selector: EpollSelector
2022-06-06 09:03:12,904 - vorta.keyring.secretstorage - DEBUG - Found 1 passwords matching repo URL.
2022-06-06 09:03:12,905 - vorta.keyring.secretstorage - DEBUG - Retrieved password for repo /home/backup
2022-06-06 09:03:12,937 - vorta.borg.jobs_manager - DEBUG - Add job for site 4
2022-06-06 09:03:12,938 - vorta.borg.jobs_manager - DEBUG - Start job on site: 4
2022-06-06 09:03:12,949 - vorta.borg.borg_job - INFO - Running command /app/bin/borg diff --info --log-json --json-lines /home/backup::myhostname-lokal-2020-04-03T19:10:50 myhostname-lokal-2020-12-31T12:21:25
2022-06-06 09:03:15,721 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 4
2022-06-06 09:03:15,722 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 4
2022-06-06 09:03:15,727 - vorta.scheduler - DEBUG - Scheduler for profile 2 is disabled.
2022-06-06 09:03:16,075 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/vorta/views/archive_tab.py", line 865, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older,
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 32, in __init__
    files_with_attributes, nested_file_list = parse_diff_json_lines(lines) \
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 123, in parse_diff_json_lines
    assert change_type  # either no changes, or unrecognized change(s)
AssertionError

Greetings Peter

pietrodicarbo avatar Jun 06 '22 07:06 pietrodicarbo

Can you diff exactly the same two archives again with version 0.8.7?

According to the logs these were /home/backup::myhostname-local-2020-04-03T19:10:50 and myhostname-local-2020-12-31T12:21:25.

real-yfprojects avatar Jun 30 '22 15:06 real-yfprojects

This is the output when running Vorta from console:

2022-06-30 18:43:53,933 - vorta.borg.borg_job - INFO - Running command /app/bin/borg diff --info --log-json --json-lines /home/backup::myhostname-lokal-2020-04-03T19:10:50 myhostname-lokal-2020-12-31T12:21:25
2022-06-30 18:43:57,207 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 4
2022-06-30 18:43:57,208 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 4
2022-06-30 18:43:57,219 - vorta.scheduler - DEBUG - Scheduler for profile 2 is disabled.
2022-06-30 18:43:57,546 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/vorta/views/archive_tab.py", line 865, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older,
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 32, in __init__
    files_with_attributes, nested_file_list = parse_diff_json_lines(lines) \
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 126, in parse_diff_json_lines
    raise ValueError(f"Unknown change type {change['type']}")
ValueError: Unknown change type added

pietrodicarbo avatar Jun 30 '22 16:06 pietrodicarbo

This is a weird bug because the change type added is actually known and implemented. :shrug:

real-yfprojects avatar Jun 30 '22 19:06 real-yfprojects

@osumray What vorta version are you using? ~~Can you post the logs, please?~~

Edit: Can you try with the current master branch and post the logs?

real-yfprojects avatar Jul 05 '22 15:07 real-yfprojects

@osumray What vorta version are you using? ~Can you post the logs, please?~

Edit: Can you try with the current master branch and post the logs?

Thanks, now works perfectly when using the master branch.

For reference, the old issue details were:

I was using version vorta v0.8.7 from flatpak on Fedora 36.

2022-07-05 17:05:49,488 - vorta.i18n - DEBUG - Loading translation failed for ['en-GB', 'en-Latn-GB'].
2022-07-05 17:05:49,691 - vorta.views.source_tab - DEBUG - Added item number 0 from 1
2022-07-05 17:05:49,777 - root - INFO - Using NetworkManagerMonitor NetworkStatusMonitor implementation.
2022-07-05 17:05:49,816 - vorta.borg.jobs_manager - DEBUG - Add job for site default
2022-07-05 17:05:49,817 - vorta.borg.jobs_manager - DEBUG - Start job on site: default
2022-07-05 17:05:49,819 - vorta.borg.borg_job - INFO - Running command /app/bin/borg --version
2022-07-05 17:05:50,477 - vorta.borg.jobs_manager - DEBUG - Finish job for site: default
2022-07-05 17:05:50,477 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: default
2022-07-05 17:05:50,477 - vorta.scheduler - DEBUG - Refreshing all scheduler timers
2022-07-05 17:05:50,480 - vorta.scheduler - INFO - Setting timer for profile 1
2022-07-05 17:05:50,481 - vorta.scheduler - DEBUG - Scheduling next run for 2022-07-06 03:42:25.115055
2022-07-05 17:06:21,520 - vorta.keyring.abc - DEBUG - Only available on macOS
2022-07-05 17:06:21,568 - asyncio - DEBUG - Using selector: EpollSelector
2022-07-05 17:06:21,569 - vorta.keyring.abc - DEBUG - Using VortaSecretStorageKeyring
2022-07-05 17:06:21,569 - vorta.borg.borg_job - DEBUG - Using VortaSecretStorageKeyring keyring to store passwords.
2022-07-05 17:06:21,570 - asyncio - DEBUG - Using selector: EpollSelector
2022-07-05 17:06:21,571 - vorta.keyring.secretstorage - DEBUG - Found 1 passwords matching repo URL.
2022-07-05 17:06:21,571 - vorta.keyring.secretstorage - DEBUG - Retrieved password for repo [repo]
2022-07-05 17:06:21,600 - vorta.borg.jobs_manager - DEBUG - Add job for site 1
2022-07-05 17:06:21,600 - vorta.borg.jobs_manager - DEBUG - Start job on site: 1
2022-07-05 17:06:21,603 - vorta.borg.borg_job - INFO - Running command /app/bin/borg diff --info --log-json --json-lines [repo]::gauss-2022-07-04-034240 gauss-2022-07-05-034246
2022-07-05 17:06:25,715 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 1
2022-07-05 17:06:25,715 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 1
2022-07-05 17:06:25,720 - vorta.scheduler - INFO - Setting timer for profile 1
2022-07-05 17:06:25,722 - vorta.scheduler - DEBUG - Scheduling next run for 2022-07-06 03:42:25.115055
2022-07-05 17:06:25,806 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/vorta/views/archive_tab.py", line 865, in list_diff_result
    window = DiffResult(result['data'], archive_newer, archive_older,
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 32, in __init__
    files_with_attributes, nested_file_list = parse_diff_json_lines(lines) \
  File "/app/lib/python3.9/site-packages/vorta/views/diff_result.py", line 126, in parse_diff_json_lines
    raise ValueError(f"Unknown change type {change['type']}")
ValueError: Unknown change type added

osumray avatar Jul 05 '22 16:07 osumray

Thanks, now works perfectly when using the master branch.

Did you diff exactly the same two archives?

real-yfprojects avatar Jul 05 '22 19:07 real-yfprojects

Yes, I did.

Greetings

Peter

pietrodicarbo avatar Jul 06 '22 07:07 pietrodicarbo

Yes, I did.

Greetings

Peter

I addressed osumray, I know that you did @pietrodicarbo.

real-yfprojects avatar Jul 06 '22 10:07 real-yfprojects

Thanks, now works perfectly when using the master branch.

Did you diff exactly the same two archives?

Yes, the same archives.

osumray avatar Jul 06 '22 12:07 osumray

Since the latest release no change to the diff logic was introduced into the master branch. So the error shouldn't be gone.

real-yfprojects avatar Jul 06 '22 16:07 real-yfprojects

@pietrodicarbo Just wanted to ask whether this is still an issue with vorta v0.8.9?

real-yfprojects avatar Nov 10 '22 19:11 real-yfprojects

the diffs work perfectly now!! Thank You very much. Greetings Peter

pietrodicarbo avatar Nov 11 '22 15:11 pietrodicarbo