Error in borgmatic init on an existent but empty repository with Borg 1.4.0 #896

Closed
opened 2024-07-08 18:18:46 +00:00 by witten · 2 comments
Owner

What I'm trying to do and why

As discovered in https://github.com/borgmatic-collective/docker-borgmatic/issues/340, borgmatic init/borgmatic rcreate errors when trying to create a repository in an existent but empty directory with Borg 1.4.0.

Steps to reproduce

test.yaml:

...
repositories:
    - empty.borg
local_path: /root/borg1.4.0
...
$ mkdir empty.borg
$ borgmatic -c test.yaml -v 1 init -e none

Actual behavior

backup: Creating repository
/root/tmp/missing.borg is not a valid repository. Check repo config.
backup: Error running actions for repository
Command '('/root/borg1.4.0', 'info', '--json', 'missing.borg')' returned non-zero exit status 15.
/root/tmp/test.yaml: An error occurred

summary:
/root/tmp/test.yaml: An error occurred
backup: Error running actions for repository
Command '('/root/borg1.4.0', 'info', '--json', 'missing.borg')' returned non-zero exit status 15.

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

Expected behavior

backup: Creating repository
/root/tmp/missing.borg is not a valid repository. Check repo config.
Initializing repository at "missing.borg"
Encryption NOT enabled.
Use the "--encryption=repokey|keyfile" to enable encryption.
Synchronizing chunks cache...
Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0.
Done.

summary:
/root/tmp/test.yaml: Successfully ran configuration file

Other notes / implementation ideas

The problem is in borg/rcreate.py where borgmatic is not looking for exit code 15 along with the other exit codes for missing repositories:

RINFO_REPOSITORY_NOT_FOUND_EXIT_CODES = {2, 13}

borgmatic version

1.8.13 or main

borgmatic installation method

pipx install --editable

Borg version

1.4.0

Python version

3.12.4

Database version (if applicable)

No response

Operating system and version

Manjaro stable

### What I'm trying to do and why As discovered in https://github.com/borgmatic-collective/docker-borgmatic/issues/340, `borgmatic init`/`borgmatic rcreate` errors when trying to create a repository in an existent but empty directory with Borg 1.4.0. ### Steps to reproduce test.yaml: ```yaml ... repositories: - empty.borg local_path: /root/borg1.4.0 ... ``` ```bash $ mkdir empty.borg $ borgmatic -c test.yaml -v 1 init -e none ``` ### Actual behavior ``` backup: Creating repository /root/tmp/missing.borg is not a valid repository. Check repo config. backup: Error running actions for repository Command '('/root/borg1.4.0', 'info', '--json', 'missing.borg')' returned non-zero exit status 15. /root/tmp/test.yaml: An error occurred summary: /root/tmp/test.yaml: An error occurred backup: Error running actions for repository Command '('/root/borg1.4.0', 'info', '--json', 'missing.borg')' returned non-zero exit status 15. Need some help? https://torsion.org/borgmatic/#issues ``` ### Expected behavior ``` backup: Creating repository /root/tmp/missing.borg is not a valid repository. Check repo config. Initializing repository at "missing.borg" Encryption NOT enabled. Use the "--encryption=repokey|keyfile" to enable encryption. Synchronizing chunks cache... Archives: 0, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 0. Done. summary: /root/tmp/test.yaml: Successfully ran configuration file ``` ### Other notes / implementation ideas The problem is in `borg/rcreate.py` where borgmatic is not looking for exit code 15 along with the other exit codes for missing repositories: ```python RINFO_REPOSITORY_NOT_FOUND_EXIT_CODES = {2, 13} ``` ### borgmatic version 1.8.13 or main ### borgmatic installation method pipx install --editable ### Borg version 1.4.0 ### Python version 3.12.4 ### Database version (if applicable) _No response_ ### Operating system and version Manjaro stable
witten added the
bug
label 2024-07-08 18:22:43 +00:00
Author
Owner

Fixed in main and will be part of the next release!

Fixed in main and will be part of the next release!
Author
Owner

Released in borgmatic 1.8.14!

Released in borgmatic 1.8.14!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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