borgmatic info --archive latest --json creates invalid borg invocation including duplicate --glob-archives argument #670

Closed
opened 2023-04-08 21:13:43 +00:00 by ginkel · 5 comments

What I'm trying to do and why

After running a backup I'd like to determine statistics using:

borgmatic info --archive latest --json

Steps to reproduce (if a bug)

Run borgmatic info --archive latest --json with the following config:

consistency:
    checks:
    -   frequency: 2 weeks
        name: repository
hooks:
    after_backup:
    - /etc/borgmatic/hooks/btrfs-snapshot-remove.sh
    - /etc/borgmatic/hooks/update-metrics.py
    before_backup:
    - /etc/borgmatic/hooks/btrfs-snapshot-create.sh
location:
    exclude_patterns:
    - /backup
    - /mnt
    - /proc
    - /sys
    - /tmp
    - /var/tmp
    - /borg-backup/srv/elasticsearch/log
    - /borg-backup/srv/docker-registry
    - /borg-backup/srv/gitlab-elasticsearch
    one_file_system: false
    repositories:
    - ssh://<user>@<user>.your-storagebox.de:23/./borg/<hostname>
    source_directories:
    - /borg-backup/srv
retention:
    keep_daily: 7
    keep_monthly: 6
    keep_yearly: 1
storage:
    archive_name_format: '{fqdn}-{now:%Y-%m-%d.%H:%M}'
    encryption_passphrase: <redacted>
    retries: 2
    retry_wait: 120
    ssh_command: ssh -i /root/.ssh/id_borg

Actual behavior (if a bug)

# borgmatic info --archive latest --json --verbosity 2

Ensuring legacy configuration is upgraded
borg --version --debug --show-rc
ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus: Running actions for repository
/etc/borgmatic/config.yaml: No commands to run for pre-actions hook
borg list --last 1 --short ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus
ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus: Latest archive is <fqdn>-2023-04-08.19:52
borg info --glob-archives {fqdn}-* --json ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus --glob-archives <fqdn>-2023-04-08.19:52
usage: borg info [-h] [--critical] [--error] [--warning] [--info] [--debug]
                 [--debug-topic TOPIC] [-p] [--iec] [--log-json]
                 [--lock-wait SECONDS] [--bypass-lock] [--show-version]
                 [--show-rc] [--umask M] [--remote-path PATH]
                 [--remote-ratelimit RATE] [--upload-ratelimit RATE]
                 [--remote-buffer UPLOAD_BUFFER]
                 [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
                 [--debug-profile FILE] [--rsh RSH] [--json]
                 [-P PREFIX | -a GLOB] [--sort-by KEYS] [--first N | --last N]
                 [REPOSITORY_OR_ARCHIVE]
borg info: error: argument -a/--glob-archives: There can be only one.
ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus: Error running actions for repository
Command '('borg', 'info', '--glob-archives', '{fqdn}-*', '--json', 'ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus', '--glob-archives', '<fqdn>-2023-04-08.19:52')' returned non-zero exit status 2.

Expected behavior (if a bug)

The command completes successfully and returns JSON info about the most recent archive.

Other notes / implementation ideas

Environment

borgmatic version: 1.7.11

borgmatic installation method: pip

Borg version: 1.2.4

Python version: 3.8.10

Database version (if applicable): n/a

operating system and version: Ubuntu 20.04.6 LTS

#### What I'm trying to do and why After running a backup I'd like to determine statistics using: ``` borgmatic info --archive latest --json ``` #### Steps to reproduce (if a bug) Run `borgmatic info --archive latest --json` with the following config: ``` consistency: checks: - frequency: 2 weeks name: repository hooks: after_backup: - /etc/borgmatic/hooks/btrfs-snapshot-remove.sh - /etc/borgmatic/hooks/update-metrics.py before_backup: - /etc/borgmatic/hooks/btrfs-snapshot-create.sh location: exclude_patterns: - /backup - /mnt - /proc - /sys - /tmp - /var/tmp - /borg-backup/srv/elasticsearch/log - /borg-backup/srv/docker-registry - /borg-backup/srv/gitlab-elasticsearch one_file_system: false repositories: - ssh://<user>@<user>.your-storagebox.de:23/./borg/<hostname> source_directories: - /borg-backup/srv retention: keep_daily: 7 keep_monthly: 6 keep_yearly: 1 storage: archive_name_format: '{fqdn}-{now:%Y-%m-%d.%H:%M}' encryption_passphrase: <redacted> retries: 2 retry_wait: 120 ssh_command: ssh -i /root/.ssh/id_borg ``` #### Actual behavior (if a bug) ``` # borgmatic info --archive latest --json --verbosity 2 Ensuring legacy configuration is upgraded borg --version --debug --show-rc ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus: Running actions for repository /etc/borgmatic/config.yaml: No commands to run for pre-actions hook borg list --last 1 --short ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus: Latest archive is <fqdn>-2023-04-08.19:52 borg info --glob-archives {fqdn}-* --json ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus --glob-archives <fqdn>-2023-04-08.19:52 usage: borg info [-h] [--critical] [--error] [--warning] [--info] [--debug] [--debug-topic TOPIC] [-p] [--iec] [--log-json] [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc] [--umask M] [--remote-path PATH] [--remote-ratelimit RATE] [--upload-ratelimit RATE] [--remote-buffer UPLOAD_BUFFER] [--upload-buffer UPLOAD_BUFFER] [--consider-part-files] [--debug-profile FILE] [--rsh RSH] [--json] [-P PREFIX | -a GLOB] [--sort-by KEYS] [--first N | --last N] [REPOSITORY_OR_ARCHIVE] borg info: error: argument -a/--glob-archives: There can be only one. ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus: Error running actions for repository Command '('borg', 'info', '--glob-archives', '{fqdn}-*', '--json', 'ssh://<user>@<user>.your-storagebox.de:23/./borg/pegasus', '--glob-archives', '<fqdn>-2023-04-08.19:52')' returned non-zero exit status 2. ``` #### Expected behavior (if a bug) The command completes successfully and returns JSON info about the most recent archive. #### Other notes / implementation ideas #### Environment **borgmatic version:** 1.7.11 **borgmatic installation method:** pip **Borg version:** 1.2.4 **Python version:** 3.8.10 **Database version (if applicable):** n/a **operating system and version:** Ubuntu 20.04.6 LTS
Owner

Thank you for taking the time to file this. This was actually just fixed in #666 for a related borgmatic info case. I just confirmed that it was indeed fixed; I used your config file and tried the code before and after the change. The fix will be released in the next version of borgmatic in the next few days!

Thank you for taking the time to file this. This was actually just fixed in #666 for a related `borgmatic info` case. I just confirmed that it was indeed fixed; I used your config file and tried the code before and after the change. The fix will be released in the next version of borgmatic in the next few days!
witten added the
bug
label 2023-04-08 21:30:35 +00:00
Author

Thanks for the speedy reply! I have downgraded borgmatic to 1.7.10 for now and am looking forward to the upcoming release for a permanent fix.

Thanks for the speedy reply! I have downgraded borgmatic to 1.7.10 for now and am looking forward to the upcoming release for a permanent fix.
Owner

This fix has been released as part of borgmatic 1.7.12!

This fix has been released as part of borgmatic 1.7.12!
Author

Excellent, thanks! I can confirm that 1.7.12 indeed fixes the issue.

Excellent, thanks! I can confirm that 1.7.12 indeed fixes the issue.
Owner

Glad to hear it!

Glad to hear it!
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#670
No description provided.