Actions are started although before_actions command exited with 75 #1059

Closed
opened 2025-04-07 16:50:24 +00:00 by palto42 · 3 comments
Contributor

What I'm trying to do and why

I upgraded from 1.9.14 to 2.0.1 and my backups on removable device started to fail.
It turned out, that although the pre-command exited with "75", it continued ton run the repository actions.

I used the before_actions and also tried the new command: before: repository, both with same issue.

Downgrading to 1.9.14 solved the issue.

Steps to reproduce

  • Configure a before_action which exits with error code 75.
  • Start a backup.
  • Check that the action is started anyway

Actual behavior

Despite before_action/command exit code 75 the action is started, causing the backup to fail since the removable device is not present.

❯ sudo borgmatic --verbosity 2 -c /etc/borgmatic.d/hp250_seagate.yaml
/etc/borgmatic.d/hp250_seagate.yaml: BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc
/etc/borgmatic.d/hp250_seagate.yaml: Borg 1.4.0
backupserver: Running actions for repository
backupserver: Running before repository command hook
backupserver: /opt/scripts/check_ssh_mnt
backupserver: Command hook exited with soft failure exit code (75); skipping remaining repository actions
backupserver: Creating archive
backupserver: Using runtime directory /tmp/borgmatic-xwgbqcpd/borgmatic

...

backupserver: Creating archive
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/remote.py", line 252, in serve
    res = f(**args)
  File "/usr/lib/python3/dist-packages/borg/remote.py", line 380, in open
    self.repository.__enter__()  # clean exit handled by serve() method
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 217, in __enter__
    self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock)
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 459, in open
    st = os.stat(path)
OSError: [Errno 19] No such device: '/mnt/seagate/lenovo/main'

Expected behavior

No response

Other notes / implementation ideas

No response

borgmatic version

2.0.1

borgmatic installation method

pipx

Borg version

1.4.0

Python version

3.12.6

Database version (if applicable)

No response

Operating system and version

Solus 4.7

### What I'm trying to do and why I upgraded from 1.9.14 to 2.0.1 and my backups on removable device started to fail. It turned out, that although the pre-command exited with "75", it continued ton run the repository actions. I used the `before_actions` and also tried the new `command: before: repository`, both with same issue. Downgrading to 1.9.14 solved the issue. ### Steps to reproduce - Configure a before_action which exits with error code 75. - Start a backup. - Check that the action is started anyway ### Actual behavior Despite before_action/command exit code 75 the action is started, causing the backup to fail since the removable device is not present. ``` ❯ sudo borgmatic --verbosity 2 -c /etc/borgmatic.d/hp250_seagate.yaml /etc/borgmatic.d/hp250_seagate.yaml: BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc /etc/borgmatic.d/hp250_seagate.yaml: Borg 1.4.0 backupserver: Running actions for repository backupserver: Running before repository command hook backupserver: /opt/scripts/check_ssh_mnt backupserver: Command hook exited with soft failure exit code (75); skipping remaining repository actions backupserver: Creating archive backupserver: Using runtime directory /tmp/borgmatic-xwgbqcpd/borgmatic ... backupserver: Creating archive Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/remote.py", line 252, in serve res = f(**args) File "/usr/lib/python3/dist-packages/borg/remote.py", line 380, in open self.repository.__enter__() # clean exit handled by serve() method File "/usr/lib/python3/dist-packages/borg/repository.py", line 217, in __enter__ self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock) File "/usr/lib/python3/dist-packages/borg/repository.py", line 459, in open st = os.stat(path) OSError: [Errno 19] No such device: '/mnt/seagate/lenovo/main' ``` ### Expected behavior _No response_ ### Other notes / implementation ideas _No response_ ### borgmatic version 2.0.1 ### borgmatic installation method pipx ### Borg version 1.4.0 ### Python version 3.12.6 ### Database version (if applicable) _No response_ ### Operating system and version Solus 4.7
Owner

Thanks for filing this! I've reproduced this behavior with 2.0.1, at least with one test case.

Note that before_actions and the new command hooks run the exact same code under the hood, so it makes sense that this bug would manifest with both.

Thanks for filing this! I've reproduced this behavior with 2.0.1, at least with one test case. Note that `before_actions` and the new command hooks run the exact same code under the hood, so it makes sense that this bug would manifest with both.
Owner

This is fixed in main and will part of the next release! Thanks again for the bug report.

This is fixed in main and will part of the next release! Thanks again for the bug report.
Owner

Released in borgmatic 2.0.2!

Released in borgmatic 2.0.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#1059
No description provided.