vorta icon indicating copy to clipboard operation
vorta copied to clipboard

Missing UI element may trigger crash when recalculating folder sizes

Open m3nu opened this issue 2 years ago • 2 comments

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)

  1. Go to source tab
  2. Add folder
  3. Do "Recalculate"
  4. Remove folder right away
  5. 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'

m3nu avatar Oct 18 '21 13:10 m3nu

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

real-yfprojects avatar Jan 06 '22 16:01 real-yfprojects

Can't reproduce it on Vorta 0.8.3. It works for me on Vorta 0.8.3 from Github,

Steps

  1. Got to "Sources" tab.

  2. Add folder.

  3. Recalculate sizes - size is displayed correctly image

  4. Remove the folder at the OS level

  5. Recalculate sizes again - size is 0 Bytes and no error displayed. image

delfino-nunez avatar Mar 19 '22 08:03 delfino-nunez