Using parameter "--repository <LABEL>" print error "Repository <LABEL> found in multiple configuration files" #818

Closed
opened 2024-01-19 22:08:54 +00:00 by borg.haefemeier · 3 comments

What I'm trying to do and why

I defined several configuration files to backup per applications and define multiple repositories, but in each config file the same repo definition (add per include). Now I try to call borgmatic list --repository repo1 and print the error. message "Repository local found in multiple configuration files".

Steps to reproduce

  • define multiple configuration files (default /etc/borgmatic/config.yaml and list of configuration in /etc/borgmatic.d)
  • add in each a repositories section
repositories:
  - path: /path/backup
     label: local.repo
  - path: ssh:user@remote:/path/backup
     label: remote.repo
  • call borgmatic list --repository local.repo

Actual behavior

Repository local.repo found in multiple configuration files

summary:
/etc/borgmatic/config.yaml: Loading configuration file
/etc/borgmatic.d/config-2.yaml: Loading configuration file
/etc/borgmatic.d/config-3.yaml: Loading configuration file
Repository local found in multiple configuration files

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

Expected behavior

No error message and command behavior as defined, but print only archives for one repository.

Other notes / implementation ideas

No response

borgmatic version

1.8.6

borgmatic installation method

Fedora package via 'dnf'

Borg version

1.2.7

Python version

3.12.1

Database version (if applicable)

No response

Operating system and version

NAME="Fedora Linux" VERSION="39 (Server Edition)"

### What I'm trying to do and why I defined several configuration files to backup per applications and define multiple repositories, but in each config file the same repo definition (add per include). Now I try to call `borgmatic list --repository repo1` and print the error. message "Repository local found in multiple configuration files". ### Steps to reproduce - define multiple configuration files (default `/etc/borgmatic/config.yaml` and list of configuration in `/etc/borgmatic.d`) - add in each a repositories section ``` repositories: - path: /path/backup label: local.repo - path: ssh:user@remote:/path/backup label: remote.repo ``` - call `borgmatic list --repository local.repo` ### Actual behavior Repository local.repo found in multiple configuration files summary: /etc/borgmatic/config.yaml: Loading configuration file /etc/borgmatic.d/config-2.yaml: Loading configuration file /etc/borgmatic.d/config-3.yaml: Loading configuration file Repository local found in multiple configuration files Need some help? https://torsion.org/borgmatic/#issues ### Expected behavior No error message and command behavior as defined, but print only archives for one repository. ### Other notes / implementation ideas _No response_ ### borgmatic version 1.8.6 ### borgmatic installation method Fedora package via 'dnf' ### Borg version 1.2.7 ### Python version 3.12.1 ### Database version (if applicable) _No response_ ### Operating system and version NAME="Fedora Linux" VERSION="39 (Server Edition)"
borg.haefemeier changed title from Using parameter "--repository <LABEL>" print error "Repository local found in multiple configuration files" to Using parameter "--repository <LABEL>" print error "Repository <LABEL> found in multiple configuration files" 2024-01-19 22:09:21 +00:00
Owner

Thanks for filing this. I believe the original rationale for the error message you're seeing is that borgmatic can't match the requested --repository value to a single repo in a single configuration file, and therefore it gives up. I suppose though that the restriction could be lifted so that it applies each matching configuration file with that one requested repository. I don't know offhand though how possible that is based on the code. I'll look into it!

Thanks for filing this. I believe the original rationale for the error message you're seeing is that borgmatic can't match the requested `--repository` value to a single repo in a single configuration file, and therefore it gives up. I suppose though that the restriction could be lifted so that it applies each matching configuration file with that one requested repository. I don't know offhand though how possible that is based on the code. I'll look into it!
Owner

Looks like there was no good reason for this restriction, so I've simply removed it. Thanks again for suggesting this! The change will be part of the next release.

Looks like there was no good reason for this restriction, so I've simply removed it. Thanks again for suggesting this! The change will be part of the next release.
Owner

Released in borgmatic 1.8.8!

Released in borgmatic 1.8.8!
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#818
No description provided.