rcreate action broken with Borg 1.4 #820

Closed
opened 2024-01-24 23:19:54 +00:00 by witten · 2 comments
Owner

What I'm trying to do and why

#798 started calling Borg with the BORG_EXIT_CODES environment variable set to modern, which causes Borg 1.4 (only) to return different exit codes. It appears that the borgmatic rcreate action, which calls borg info to determine if the repository already exists, doesn't handle the new exit code (13) properly when the repository doesn't exit. The result is that the borg info call causes borgmatic to error instead of continuing on to run borg rcreate as expected.

This issue does not occur with other versions of Borg besides 1.4.

Steps to reproduce

Using Borg 1.4.0b1, run:

# borgmatic -v 2 -c test.yaml rcreate -e repokey

Actual behavior

/root/tmp/test.yaml: Skipping check/prune/compact actions due to configured skip_actions
BORG_EXIT_CODES=*** /root/borg1.4.0b1 --version --debug --show-rc
/root/tmp/test.yaml: Borg 1.4.0b1
backup: Running actions for repository
/root/tmp/test.yaml: No commands to run for pre-actions hook
backup: Creating repository
BORG_EXIT_CODES=*** /root/borg1.4.0b1 info --json 1.2.borg
Repository /root/tmp/1.2.borg does not exist.
backup: Error running actions for repository
Command '('/root/borg1.4.0b1', 'info', '--json', '1.2.borg')' returned non-zero exit status 13.
/root/tmp/test.yaml: An error occurred
...

Expected behavior

The Repository /root/tmp/1.2.borg does not exist. message is expected, but then instead of an error, I'd expect borgmatic to continue on to running borg rcreate.

Other notes / implementation ideas

No response

borgmatic version

1.8.7 or main

borgmatic installation method

pipx install --editable

Borg version

1.4.0b1

Python version

3.11.6

Database version (if applicable)

No response

Operating system and version

Manjaro stable

### What I'm trying to do and why #798 started calling Borg with the `BORG_EXIT_CODES` environment variable set to `modern`, which causes Borg 1.4 (only) to return different exit codes. It appears that the borgmatic `rcreate` action, which calls `borg info` to determine if the repository already exists, doesn't handle the new exit code (13) properly when the repository doesn't exit. The result is that the `borg info` call causes borgmatic to error instead of continuing on to run `borg rcreate` as expected. This issue does not occur with other versions of Borg besides 1.4. ### Steps to reproduce Using Borg 1.4.0b1, run: ``` # borgmatic -v 2 -c test.yaml rcreate -e repokey ``` ### Actual behavior ``` /root/tmp/test.yaml: Skipping check/prune/compact actions due to configured skip_actions BORG_EXIT_CODES=*** /root/borg1.4.0b1 --version --debug --show-rc /root/tmp/test.yaml: Borg 1.4.0b1 backup: Running actions for repository /root/tmp/test.yaml: No commands to run for pre-actions hook backup: Creating repository BORG_EXIT_CODES=*** /root/borg1.4.0b1 info --json 1.2.borg Repository /root/tmp/1.2.borg does not exist. backup: Error running actions for repository Command '('/root/borg1.4.0b1', 'info', '--json', '1.2.borg')' returned non-zero exit status 13. /root/tmp/test.yaml: An error occurred ... ``` ### Expected behavior The `Repository /root/tmp/1.2.borg does not exist.` message is expected, but then instead of an error, I'd expect borgmatic to continue on to running `borg rcreate`. ### Other notes / implementation ideas _No response_ ### borgmatic version 1.8.7 or main ### borgmatic installation method pipx install --editable ### Borg version 1.4.0b1 ### Python version 3.11.6 ### Database version (if applicable) _No response_ ### Operating system and version Manjaro stable
witten added the
bug
label 2024-01-24 23:44:34 +00:00
Author
Owner

Fixed in main. Will be part of the next release.

Fixed in main. Will be part of the next release.
Author
Owner

Released in borgmatic 1.8.8!

Released in borgmatic 1.8.8!
Sign in to join this conversation.
No Milestone
No Assignees
1 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#820
No description provided.