Borg 1.7.15 breaks borg key export command #719

Closed
opened 2023-06-26 16:12:54 +00:00 by Unostot · 4 comments

What I'm trying to do and why

Extract the repo key by issuing a borgmatic -c borgmatic_configs/system.conf borg key export

Steps to reproduce (if a bug)

run command on borgmatic 1.7.14:

ssh://some_server_with_repository: Running arbitrary Borg command
BORG_KEY <very long and complex repo key>

summary:
borgmatic_configs/system.conf: Successfully ran configuration file

return code: 0

run the command with borgmatic 1.7.15:

ssh://some_server_with_repository: Running arbitrary Borg command
BORG_KEY <very long and complex repo key>

summary:
/root/borg/key: Error parsing configuration file
[Errno 2] No such file or directory: '/root/borg/key'
/root/borg/export: Error parsing configuration file
[Errno 2] No such file or directory: '/root/borg/export'
/root/borg/borgmatic_configs/system.conf: Successfully ran configuration file

Need some help? https://torsion.org/borgmatic/#issues

return code: 1

Actual behavior (if a bug)

as you can see, the 1.7.15 borgmatic somehow interprets the key and export as "config file arguments", not just the part after -c

Expected behavior (if a bug)

should work as in 1.7.14. So return code = 0 and not interpret key and export as config files.

Other notes / implementation ideas

Since the whole borg key export did need some extra work (i think 1.6), there might be something related to this extra steps, before 1.6 this command did not work, too.

Environment

borgmatic version: 1.7.15

borgmatic installation method: pip / python venv

Borg version: 1.2.0

Python version: 3.10.6

operating system and version: Ubuntu 22.04.2 LTS

Greetings,
Uno

#### What I'm trying to do and why Extract the repo key by issuing a `borgmatic -c borgmatic_configs/system.conf borg key export` #### Steps to reproduce (if a bug) run command on borgmatic 1.7.14: ``` ssh://some_server_with_repository: Running arbitrary Borg command BORG_KEY <very long and complex repo key> summary: borgmatic_configs/system.conf: Successfully ran configuration file ``` return code: 0 run the command with borgmatic 1.7.15: ``` ssh://some_server_with_repository: Running arbitrary Borg command BORG_KEY <very long and complex repo key> summary: /root/borg/key: Error parsing configuration file [Errno 2] No such file or directory: '/root/borg/key' /root/borg/export: Error parsing configuration file [Errno 2] No such file or directory: '/root/borg/export' /root/borg/borgmatic_configs/system.conf: Successfully ran configuration file Need some help? https://torsion.org/borgmatic/#issues ``` return code: 1 #### Actual behavior (if a bug) as you can see, the 1.7.15 borgmatic somehow interprets the `key` and `export` as "config file arguments", not just the part after `-c` #### Expected behavior (if a bug) should work as in 1.7.14. So return code = 0 and not interpret key and export as config files. #### Other notes / implementation ideas Since the whole `borg key export` did need some extra work (i think 1.6), there might be something related to this extra steps, before 1.6 this command did not work, too. #### Environment **borgmatic version:** 1.7.15 **borgmatic installation method:** pip / python venv **Borg version:** 1.2.0 **Python version:** 3.10.6 **operating system and version:** Ubuntu 22.04.2 LTS Greetings, Uno
Owner

That's for taking the time to file this! There's actually code in borgmatic 1.7.15 (and tests) that are supposed to protect from exactly this sort of case. But it sounds like there might be an edge case upon an edge case, and you've unfortunately stumbled across it. And FWIW, I can repro this issue here.

That's for taking the time to file this! There's actually code in borgmatic 1.7.15 (and tests) that are supposed to protect from exactly this sort of case. But it sounds like there might be an edge case upon an edge case, and you've unfortunately stumbled across it. And FWIW, I can repro this issue here.
witten added the
bug
label 2023-06-26 16:18:09 +00:00
Owner

This is fixed in main and will be part of the next release. Thanks again for reporting it!

Side note: I'm considering some major-ish changes to borgmatic borg as part of the next release. I'll post my thoughts on #575 in case you're interested. You may also be interested in #345.

This is fixed in main and will be part of the next release. Thanks again for reporting it! Side note: I'm considering some major-ish changes to `borgmatic borg` as part of the next release. I'll post my thoughts on #575 in case you're interested. You may also be interested in #345.
Author

thanks for the quick fix...
Then I stick with 1.7.14 to pass the time until 1.7.16+ :)

Greetings,
Uno

thanks for the quick fix... Then I stick with 1.7.14 to pass the time until 1.7.16+ :) Greetings, Uno
Owner

Released in borgmatic 1.8.0!

Released in borgmatic 1.8.0!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#719
No description provided.