Is borg debug supported as arbitrary borg command? #538

Closed
opened 2022-05-29 13:32:16 +00:00 by ams_tschoening · 2 comments

What I'm trying to do and why

For the last too weeks I've multiple times ran into an issue with corrupted repo indexes and wanted to debug further using e.g. the following commands:

sudo borgmatic --config ~/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml --verbosity 2 borg debug get-obj 28eac01d646f253f847681d6e46f342d53873c905c6eb839ff3181e84232e4f5
sudo borgmatic --config ~/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml --verbosity 2 borg debug info

Actual behavior (if a bug)

Though, it seems that BorgMatic generates a wrong command line for those commands:

Ensuring legacy configuration is upgraded
borg --version --debug --show-rc
amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Running arbitrary Borg command
borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft get-obj 28eac01d646f253f847681d6e46f342d53873c905c6eb839ff3181e84232e4f5 --debug --show-rc
usage: borg debug [-h] [--critical] [--error] [--warning] [--info] [--debug]
                  [--debug-topic TOPIC] [-p] [--log-json]
                  [--lock-wait SECONDS] [--bypass-lock] [--show-version]
                  [--show-rc] [--umask M] [--remote-path PATH]
                  [--remote-ratelimit RATE] [--consider-part-files]
                  [--debug-profile FILE] [--rsh RSH]
                  <command> ...
borg debug: error: argument <command>: invalid choice: 'amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft' (choose from 'info', 'dump-archive-items', 'dump-archive', 'dump-manifest', 'dump-repo-objs', 'search-repo-objs', 'get-obj', 'put-obj', 'delete-obj', 'refcount-obj', 'dump-hints', 'convert-profile')
amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Error running actions for repository
Command 'borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft get-obj 28eac01d646f253f847681d6e46f342d53873c905c6eb839ff3181e84232e4f5 --debug --show-rc' returned non-zero exit status 2.
/home/ams_d_bak_borg/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml: Error running configuration file
Ensuring legacy configuration is upgraded
borg --version --debug --show-rc
amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Running arbitrary Borg command
borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft info --debug --show-rc
usage: borg debug [-h] [--critical] [--error] [--warning] [--info] [--debug]
                  [--debug-topic TOPIC] [-p] [--log-json]
amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Error running actions for repository
Command 'borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft info --debug --show-rc' returned non-zero exit status 2.
/home/ams_d_bak_borg/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml: Error running configuration file

It seems that the path to the repo is wronlgy put where the command of debug is expected instead.

Expected behavior (if a bug)

borg debug info|get-obj|... to succeed.

Other notes / implementation ideas

Environment

borgmatic version: 1.5.24
borgmatic installation method: PIP, system wide
Borg version: 1.1.16
Python version: 3.8.10
operating system and version: Ubuntu 20.04

#### What I'm trying to do and why For the last too weeks I've multiple times ran into an issue with [corrupted repo indexes](https://github.com/borgbackup/borg/issues/6687) and wanted to debug further using e.g. the following commands: ```bash sudo borgmatic --config ~/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml --verbosity 2 borg debug get-obj 28eac01d646f253f847681d6e46f342d53873c905c6eb839ff3181e84232e4f5 ``` ```bash sudo borgmatic --config ~/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml --verbosity 2 borg debug info ``` #### Actual behavior (if a bug) Though, it seems that BorgMatic generates a wrong command line for those commands: ```bash Ensuring legacy configuration is upgraded borg --version --debug --show-rc amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Running arbitrary Borg command borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft get-obj 28eac01d646f253f847681d6e46f342d53873c905c6eb839ff3181e84232e4f5 --debug --show-rc usage: borg debug [-h] [--critical] [--error] [--warning] [--info] [--debug] [--debug-topic TOPIC] [-p] [--log-json] [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc] [--umask M] [--remote-path PATH] [--remote-ratelimit RATE] [--consider-part-files] [--debug-profile FILE] [--rsh RSH] <command> ... borg debug: error: argument <command>: invalid choice: 'amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft' (choose from 'info', 'dump-archive-items', 'dump-archive', 'dump-manifest', 'dump-repo-objs', 'search-repo-objs', 'get-obj', 'put-obj', 'delete-obj', 'refcount-obj', 'dump-hints', 'convert-profile') amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Error running actions for repository Command 'borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft get-obj 28eac01d646f253f847681d6e46f342d53873c905c6eb839ff3181e84232e4f5 --debug --show-rc' returned non-zero exit status 2. /home/ams_d_bak_borg/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml: Error running configuration file ``` ```bash Ensuring legacy configuration is upgraded borg --version --debug --show-rc amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Running arbitrary Borg command borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft info --debug --show-rc usage: borg debug [-h] [--critical] [--error] [--warning] [--info] [--debug] [--debug-topic TOPIC] [-p] [--log-json] amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft: Error running actions for repository Command 'borg debug amsoft-sbox.bitstore.group:bak_borg/hosts/group.bitstore.amsoft info --debug --show-rc' returned non-zero exit status 2. /home/ams_d_bak_borg/.config/borgmatic.d/hosts/bts.ams/net.elrev.software.yaml: Error running configuration file ``` It seems that the path to the repo is wronlgy put where the command of `debug` is expected instead. #### Expected behavior (if a bug) `borg debug info|get-obj|...` to succeed. #### Other notes / implementation ideas #### Environment **borgmatic version:** 1.5.24 **borgmatic installation method:** PIP, system wide **Borg version:** 1.1.16 **Python version:** 3.8.10 **operating system and version:** Ubuntu 20.04
Owner

This is implemented in master now, and will be part of the next release. Thanks for suggesting this!

This is implemented in master now, and will be part of the next release. Thanks for suggesting this!
Owner

This has been released in borgmatic 1.6.2!

This has been released in borgmatic 1.6.2!
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#538
No description provided.