netinvent / npbackup

A secure and efficient file backup solution that fits both system administrators (CLI) and end users (GUI)
GNU General Public License v3.0
141 stars 5 forks source link

Error in opening rest-server repository #34

Closed KamikazeePL closed 8 months ago

KamikazeePL commented 8 months ago

When I try to open repository from rest-server npbackup process gets killed both x32 and x64 version

2023-10-12 20:43:20,405 :: INFO :: npbackup v2.2.0-P10-x64 2023060301 - GUI enabled - Copyright (C) 2022-2023 NetInvent
2023-10-12 20:43:21,017 :: INFO :: Backend: restic 0.15.2 compiled with go1.20.3 on windows/amd64
2023-10-12 20:43:21,033 :: INFO :: Running GUI
2023-10-12 20:43:21,277 :: INFO :: Listing snapshots
2023-10-12 20:43:21,378 :: INFO :: Repo already initialized.
2023-10-12 20:43:21,866 :: INFO :: Runner took 0.589341 seconds
2023-10-12 20:43:21,866 :: INFO :: Searching for a backup newer than 1 day, 0:00:00 ago.
2023-10-12 20:43:22,323 :: INFO :: No recent backup found.
2023-10-12 20:43:22,325 :: INFO :: Runner took 0.459628 seconds
2023-10-12 20:43:22,325 :: ERROR :: Program interrupted by error. 'username'
2023-10-12 20:43:22,325 :: INFO :: Trace:
Traceback (most recent call last):
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\npbackup\__main__.py", line 529, in main
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\npbackup\__main__.py", line 507, in interface
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\npbackup\gui\main.py", line 551, in main_gui
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\npbackup\gui\main.py", line 171, in get_gui_data
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\concurrent\futures\_base.py", line 451, in result
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\concurrent\futures\_base.py", line 403, in __get_result
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\ofunctions\threading\__init__.py", line 81, in call_with_future
  File "C:\Users\asd\AppData\Local\Temp\ONEFIL~1\npbackup\gui\main.py", line 120, in _get_gui_data
KeyError: 'username'
2023-10-12 20:49:41,693 :: INFO :: npbackup v2.2.1-P11-x64 2023082801 - GUI enabled - Copyright (C) 2022-2023 NetInvent
2023-10-12 20:49:42,301 :: INFO :: Backend: restic 0.16.0 compiled with go1.20.6 on windows/amd64
2023-10-12 20:49:42,324 :: INFO :: Running GUI
2023-10-12 20:49:42,553 :: INFO :: Listing snapshots
2023-10-12 20:49:42,790 :: INFO :: Repo already initialized.
2023-10-12 20:49:43,229 :: INFO :: Runner took 0.676515 seconds
2023-10-12 20:49:43,229 :: INFO :: Searching for a backup newer than 1 day, 0:00:00 ago.
2023-10-12 20:49:43,675 :: INFO :: No recent backup found.
2023-10-12 20:49:43,676 :: INFO :: Runner took 0.446841 seconds
2023-10-12 20:49:43,681 :: ERROR :: Program interrupted by error. 'username'
2023-10-12 20:49:43,682 :: INFO :: Trace:
Traceback (most recent call last):
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\npbackup\__main__.py", line 529, in main
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\npbackup\__main__.py", line 507, in interface
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\npbackup\gui\main.py", line 589, in main_gui
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\npbackup\gui\main.py", line 171, in get_gui_data
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\concurrent\futures\_base.py", line 449, in result
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\concurrent\futures\_base.py", line 401, in __get_result
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\ofunctions\threading\__init__.py", line 81, in call_with_future
  File "C:\Users\asd\AppData\Local\Temp\ON5969~1\npbackup\gui\main.py", line 120, in _get_gui_data
KeyError: 'username'
deajan commented 8 months ago

I'd need a couple of information in order to debug: What version of restic did you create the repo with ? Also, mind using latest npbackup release v2.2.1, run with --debug parameter and give me the log output ?

I suspect that some of your backups simply don't have the username set in the snapshots. No idea why, but at least I can make this error non fatal.

KamikazeePL commented 8 months ago

I'd need a couple of information in order to debug: What version of restic did you create the repo with ? Also, mind using latest npbackup release v2.2.1, run with --debug parameter and give me the log output ?

I suspect that some of your backups simply don't have the username set in the snapshots. No idea why, but at least I can make this error non fatal.

One snapshot was made with rustic and it broke your program. When I removed snapshot made by rustic everything is working good.

deajan commented 8 months ago

Well, rustic support for npbackup is in developpment. I'm interested in the project, had opened a couple of issues, but it's not prime time ready for me, so support is going to happen when a version with prime time windows support is comming.

Indeed rustic does not write username key into repository, so it's not 100% restic compatible. This should be an issue at rustic. Thanks for reporting back.