borgmatic fails with borg prune when backing up to an rclone mounted drive #344

Closed
opened 2020-07-28 23:12:36 +00:00 by anaxonda · 3 comments

What I'm trying to do and why

I'm trying to backup to a network drive mounted with rclone.

Steps to reproduce (if a bug)

Relevant config file:

location:
# List of source directories to backup (required). Globs and
source_directories:
- /home/test.borg

        repositories:
  • /mnt/test/test1.borg

retention:
# Keep all archives within this time interval.

Number of hourly archives to keep.
keep_hourly: 24

Number of daily archives to keep.
keep_daily: 7

Number of weekly archives to keep.
keep_weekly: 4

Number of monthly archives to keep.
keep_monthly: 6

I run the command:

borgmatic --config ~/.config/borgmatic/config.yaml --verbosity 2

Actual behavior (if a bug)

Ensuring legacy configuration is upgraded
/home/.config/borgmatic/config.yaml: No commands to run for pre-everything hook
/home/.config/borgmatic/config.yaml: No commands to run for pre-prune hook
/home/.config/borgmatic/config.yaml: No commands to run for pre-backup hook
/home/.config/borgmatic/config.yaml: No commands to run for pre-check hook
/mnt/test/test1.borg: Pruning archives
borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg
using builtin fallback logging configuration
35 self tests completed in 0.12 seconds
Local Exception
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/borg/archiver.py", line 4565, in main
/mnt/test/test1.borg: Error running actions for repository
Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg' returned non-zero exit status 2.
/home/.config/borgmatic/config.yaml: No commands to run for on-error hook
/home/.config/borgmatic/config.yaml: Error running configuration file
/home/.config/borgmatic/config.yaml: No commands to run for post-everything hook

summary:
/home/.config/borgmatic/config.yaml: Error running configuration file
/mnt/test/test1.borg: Error running actions for repository
using builtin fallback logging configuration
35 self tests completed in 0.12 seconds
Local Exception
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/borg/archiver.py", line 4565, in main
Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg' returned non-zero exit status 2.

Expected behavior (if a bug)

borgmatic to run successfully

Other notes / implementation ideas

I can run borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 successfully on the repository, but it seems like borgmatic is failing with it.

I assume this has something to do with rclone, because borgmatic runs successfuly for a locally mounted drive.

Environment

borgmatic version: [1.5.8]

borgmatic installation method: [Arch AUR]

Borg version: [1.1.13]

Python version: [3.8.3]

Database version (if applicable): [12.3]

operating system and version: [Arch Linux]

#### What I'm trying to do and why I'm trying to backup to a network drive mounted with rclone. #### Steps to reproduce (if a bug) Relevant config file: location: # List of source directories to backup (required). Globs and source_directories: - /home/test.borg repositories: - /mnt/test/test1.borg retention: # Keep all archives within this time interval. Number of hourly archives to keep. keep_hourly: 24 Number of daily archives to keep. keep_daily: 7 Number of weekly archives to keep. keep_weekly: 4 Number of monthly archives to keep. keep_monthly: 6 I run the command: borgmatic --config ~/.config/borgmatic/config.yaml --verbosity 2 #### Actual behavior (if a bug) Ensuring legacy configuration is upgraded /home/.config/borgmatic/config.yaml: No commands to run for pre-everything hook /home/.config/borgmatic/config.yaml: No commands to run for pre-prune hook /home/.config/borgmatic/config.yaml: No commands to run for pre-backup hook /home/.config/borgmatic/config.yaml: No commands to run for pre-check hook /mnt/test/test1.borg: Pruning archives borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg using builtin fallback logging configuration 35 self tests completed in 0.12 seconds Local Exception Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/borg/archiver.py", line 4565, in main /mnt/test/test1.borg: Error running actions for repository Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg' returned non-zero exit status 2. /home/.config/borgmatic/config.yaml: No commands to run for on-error hook /home/.config/borgmatic/config.yaml: Error running configuration file /home/.config/borgmatic/config.yaml: No commands to run for post-everything hook summary: /home/.config/borgmatic/config.yaml: Error running configuration file /mnt/test/test1.borg: Error running actions for repository using builtin fallback logging configuration 35 self tests completed in 0.12 seconds Local Exception Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/borg/archiver.py", line 4565, in main Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg' returned non-zero exit status 2. #### Expected behavior (if a bug) borgmatic to run successfully #### Other notes / implementation ideas I can run `borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6` successfully on the repository, but it seems like borgmatic is failing with it. I assume this has something to do with rclone, because borgmatic runs successfuly for a locally mounted drive. #### Environment **borgmatic version:** [1.5.8] **borgmatic installation method:** [Arch AUR] **Borg version:** [1.1.13] **Python version:** [3.8.3] **Database version (if applicable):** [12.3] **operating system and version:** [Arch Linux]
Owner

Thank you for taking the time to file this and include all the detailed information. Based on the log from running borgmatic, the error is occurring within Borg itself:

Local Exception
Traceback (most recent call last):
File “/usr/lib/python3.8/site-packages/borg/archiver.py”, line 4565, in main

So it's super odd that the problem doesn't reproduce when you run Borg by itself. A couple of thoughts:

  • Is the Borg command you're running identical to what borgmatic's invoking? It's: borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg ... The addition of --debug --show-rc shouldn't make a difference, but good to check anyway.
  • Have you tried running borgmatic prune --config ~/.config/borgmatic/config.yaml --verbosity 2. (Note the addition of prune.) It's possible that one thing that's differen't between borgmatic and Borg is that borgmatic is also doing a create and a check. But if you just specify borgmatic prune, then it'll be more similiar to running Borg by itself.

Hopefully that'll help us figure out what's going on here!

Thank you for taking the time to file this and include all the detailed information. Based on the log from running borgmatic, the error is occurring within Borg itself: ```bash Local Exception Traceback (most recent call last): File “/usr/lib/python3.8/site-packages/borg/archiver.py”, line 4565, in main ``` So it's super odd that the problem doesn't reproduce when you run Borg by itself. A couple of thoughts: * Is the Borg command you're running identical to what borgmatic's invoking? It's: `borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --debug --show-rc /mnt/test/test1.borg` ... The addition of `--debug --show-rc` *shouldn't* make a difference, but good to check anyway. * Have you tried running `borgmatic prune --config ~/.config/borgmatic/config.yaml --verbosity 2`. (Note the addition of `prune`.) It's possible that one thing that's differen't between borgmatic and Borg is that borgmatic is also doing a `create` and a `check`. But if you just specify `borgmatic prune`, then it'll be more similiar to running Borg by itself. Hopefully that'll help us figure out what's going on here!
witten added the
bug
label 2020-07-29 02:47:17 +00:00
Author

So, today I came back to it, and did as you suggested. I ran borgmatic prune --config ~/.config/borgmatic/config.yaml --verbosity 2, also borgmatic create and borgmatic check. All suceeded without error.

I went back to my original borgmatic command: borgmatic --config ~/.config/borgmatic/config.yaml --verbosity 2, and now that worked as well.

What is different now, I cannot tell you, but everything seems ok on my end now. Fingers crossed its smooth sailing from here.

Thanks for the help though, really appreciate it!

So, today I came back to it, and did as you suggested. I ran `borgmatic prune --config ~/.config/borgmatic/config.yaml --verbosity 2`, also `borgmatic create` and `borgmatic check`. All suceeded without error. I went back to my original borgmatic command: `borgmatic --config ~/.config/borgmatic/config.yaml --verbosity 2`, and now that worked as well. What is different now, I cannot tell you, but everything seems ok on my end now. Fingers crossed its smooth sailing from here. Thanks for the help though, really appreciate it!
Owner

I'm glad to hear it's working now! Please let me know if the problem occurs again.

I'm glad to hear it's working now! Please let me know if the problem occurs again.
witten added
question / support
and removed
bug
labels 2020-07-30 04:18:16 +00:00
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#344
No description provided.