vorta
vorta copied to clipboard
Missing UI element may trigger crash when recalculating folder sizes
Describe the bug Vorta may crash in rare situations, while calculating source folder sizes. First reported here
To Reproduce Steps to reproduce the behavior: (not verified)
- Go to source tab
- Add folder
- Do "Recalculate"
- Remove folder right away
- Maybe see error
Environment (please complete the following information):
- OS: macOS
- Vorta version: master branch, 0.8, Oct 2021
- Installed from: Git
Vorta and Borg versions can be found in Main Window > Misc Tab.
Additional context Updated on my system and got this when trying to add a new folder and recalculating. I think it might be related to this
021-10-18 14:35:37,480 - vorta.borg.borg_job - INFO - Running command /usr/bin/borg --version
2021-10-18 14:36:15,675 - root - CRITICAL - Uncaught exception, file a report at https://github.com/borgbase/vorta/issues/new
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/vorta/views/source_tab.py", line 156, in sources_update
self.update_path_info(row) # Update data for each entry
File "/usr/lib/python3.9/site-packages/vorta/views/source_tab.py", line 100, in update_path_info
self.sourceFilesWidget.item(index_row, SourceColumn.Type).setText(self.tr("Calculating..."))
AttributeError: 'NoneType' object has no attribute 'setText'
It shouldn't be possible that the error given relates to a source being deleted since the method is called immediately after clicking the button and as far as I know before any other window events are processed. https://github.com/borgbase/vorta/blob/461ea0521092091bfb03b8293c6bb7e13a2c9ebd/src/vorta/views/source_tab.py#L95
Deleting a source while calculating shouldn't be a problem as well. The result are handled by set_path_info
which searches for the source path in the source table. In case the source isn't found any more the for loop changing the entries won't process any lines.
https://github.com/borgbase/vorta/blob/461ea0521092091bfb03b8293c6bb7e13a2c9ebd/src/vorta/views/source_tab.py#L66-L72
Can't reproduce it on Vorta 0.8.3. It works for me on Vorta 0.8.3 from Github,
Steps
-
Got to "Sources" tab.
-
Add folder.
-
Recalculate sizes - size is displayed correctly
-
Remove the folder at the OS level
-
Recalculate sizes again - size is 0 Bytes and no error displayed.