vorta
vorta copied to clipboard
JSONDecode error when retrieving borg version
Description
During testing of PRs I noticed the following error occur - even on the master branch:
2023-08-05 16:12:02,298 - vorta.i18n - DEBUG - Loading translation succeeded for ['de-Latn-DE', 'de-DE', 'de'].
2023-08-05 16:12:02,389 - vorta.views.source_tab - DEBUG - Added item number 0 from 1
2023-08-05 16:12:02,527 - root - INFO - Using NetworkManagerMonitor NetworkStatusMonitor implementation.
2023-08-05 16:12:02,575 - vorta.views.misc_tab - WARNING - Unknown setting enable_fixed_units
2023-08-05 16:12:02,606 - vorta.borg.jobs_manager - DEBUG - Add job for site default
2023-08-05 16:12:02,607 - vorta.borg.jobs_manager - DEBUG - Start job on site: default
2023-08-05 16:12:02,609 - vorta.borg.borg_job - INFO - Running command /usr/bin/borg --version
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/user/vorta/src/vorta/borg/borg_job.py", line 267, in run
parsed = json.loads(line)
File "/home/user/.pyenv/versions/3.7.16/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/user/.pyenv/versions/3.7.16/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/user/.pyenv/versions/3.7.16/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.16/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home/user/vorta/src/vorta/borg/jobs_manager.py", line 58, in run
job.run()
File "/home/user/vorta/src/vorta/borg/borg_job.py", line 303, in run
self.app.backup_log_event.emit(f'[{self.params["profile_name"]}] {msg}', {})
KeyError: 'profile_name'
I think this is linked to the following output borg --version produces:
/usr/bin/borg:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
borg 1.1.15
Reproduction
- [X] I tried to reproduce the issue.
- [X] I was able to reproduce the issue.
OS
Ubuntu 20, KDE Plasma
Version of Vorta
master
What did you install Vorta with?
Pip
Version of Borg
1.1.15
Logs
See above.
I just updated setuptools btw.
FWIW I stumbled on this under very different circumstances.
Doing a bit-by-bit upgrade to Debian Trixie, though at the time of writing this it's only closing in on a freeze, Vorta and Borg issued errors.
Upgrading python3-trio solved it for me, so maybe some version constraints are a bit lax in the projects or Debian packaging.
Unless Debian's shipping an older version and the constraints are tighter and the exceptions caught and reported somehow ;)