configuration GUI error when entering non existent path
npbackup 3.0.2-dev-linux-gui-x64-legacy-public-3.10-i 2025040401 Ubuntu 22.04.2 LTS
My goal is to create a configuration file for a headless server. I try to enter as much as possible on my workstation. Entering a backup server path that does not exist on the workstation generates an GUI error.
steps to reproduce
- start npbackup-gui and open the configuration
- tab Backup, press Add folder, enter a non-existing path
- Accept and save the config
- open the configuration again (, change Repo to the one that has the invalid backup path if needed) and watch the error
2025-04-16 18:53:22,813 :: INFO :: Launching configuration GUI
2025-04-16 18:55:35,050 :: CRITICAL :: GUI Execution error [Errno 13] Permission denied: '/home/ubuntu/containers/syncthing'
2025-04-16 18:55:35,050 :: INFO :: Trace:
Traceback (most recent call last):
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/__main__.py", line 1274, in main_gui
_main_gui(viewer_mode=viewer_mode)
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/__main__.py", line 1168, in _main_gui
full_config = config_gui(full_config, config_file)
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 2453, in config_gui
full_config = update_object_gui(
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 648, in update_object_gui
iter_over_config(
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 567, in iter_over_config
_iter_over_config(object_config, root_key)
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 553, in _iter_over_config
_iter_over_config(object_config[key], root_key=f"{key}")
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 549, in _iter_over_config
_iter_over_config(
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 559, in _iter_over_config
update_gui_values(
File "/home/linux/npbackup.latest.github/npbackup/npbackup/gui/config.py", line 392, in update_gui_values
if pathlib.Path(val).is_dir():
File "/usr/lib/python3.10/pathlib.py", line 1305, in is_dir
return S_ISDIR(self.stat().st_mode)
File "/usr/lib/python3.10/pathlib.py", line 1097, in stat
return self._accessor.stat(self, follow_symlinks=follow_symlinks)
PermissionError: [Errno 13] Permission denied: '/home/ubuntu/containers/syncthing'
2025-04-16 18:55:35,063 :: INFO :: ExecTime = 0:11:14.612707, finished, state is: critical.
expected behaviour:
npbackup should not crash but rather give a warning or error about invalid paths.
Source paths are checked in order to fetch the right icon (file or directory). In case of non existing path, GUI will now just use the file icon. Special case like yours: OS Errors will show a "irregular" file icon.
Thanks for the report.
Could you confirm this works for you, ie shows an irregular icon (file icon with i) on your setup ?
@deajan, I have updated to the latest version npbackup 3.0.2-dev1-linux-gui-x64-legacy-public-3.10-i 2025041801, here is how the icon looks like:
then I added a fresh non-existent path to the same repo:
adding it to another repo gives the same normal icon:
The added folders seem to get normal folder icons, the existing path got a normal file icon, no "i" included. When I remove all and add the original non-existing path it gets a folder icon:
At the moment I cannot add a non-existing file via Add Files:
The 'i' icons should only appear when you add files that have errors (ie the permission error you had in the first place), not for non existing files since NPBackup cannot even try to check whether file could be "irregular". Of course I could add another icon, like the file with a cross on it when path does not exist, if you think that would make sense.
As for adding files via "Add Files", it opens a browser window which is not controlled by NPBackup, but by your system, and of course trying to add non existing files from there will create an error. That's why I added the "Add manually" button, which IMO should work well.
What do you think about another icon for "non existing paths" ?
@deajan , i get confused since this ticket was/is about adding a non-existing path, not a file that has permission error. so then it seems to make sense that my previous screenshots do not show the "i" since it was about adding a path.
Nevertheless, running today latest version
npbackup 3.0.2-linux-gui-x64-legacy-public-3.10-i 2025050201
i now get the cross symbol on the non-existing path:
I tried to create an entry with the "i" icon by adding a file with permission error for the user linux that started npbackup-gui, but it does not change anything:
the red cross works for me, a clear indication!
Python is very tricky in getting to know whether we can read a file (especially on windows). Nevertheless, while re-reading my code, I found that the icons used weren't updated right. Fixed in master. Thank you.