borg.repository.Repository.DoesNotExist #405

Closed
opened 2021-03-29 12:31:59 +00:00 by xLogiiCx · 4 comments

What I'm trying to do and why

Creating the first Backup.

Steps to reproduce (if a bug)

borgmatic -v 2 -c /home/user/Documents/BorgBackup/home.yaml

home.yaml:

location:
    # List of source directories to backup.
    source_directories:
        - /home

    # Paths of local or remote repositories to backup to.
    repositories:
        - /media/user/Backup/p-pc/home.borg:{hostname}-{now}

    # Any paths matching these patterns are excluded from backups.
    # Globs and tildes are expanded. See the output of "borg help
    # patterns" for more details.
    exclude_patterns:
        - '*.cache/*'

    exclude_caches: true

    exclude_if_present:
        - .nobackup

    keep_exclude_tags: true

storage:
    encryption_passcommand: secret-tool lookup borg-repository home.borg
    # encryption_passphrase: "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
    # ssh_command: ssh -i /path/to/private/key
    compression: lzma6

retention:
    # Retention policy for how many backups to keep.
    keep_daily: 7
    keep_weekly: 4
    keep_monthly: 6
    prefix: "{hostname}"

consistency:
    # List of checks to run to validate your backups.
    checks:
        - repository
        - archives

hooks:
    # Third-party services to notify you if backups aren't happening.
    healthchecks: https://hc-ping.com/xxx

Actual behavior (if a bug)

Ensuring legacy configuration is upgraded
/home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-everything hook
/home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function initialize_monitor
/home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-prune hook
/home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-backup hook
/home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-check hook
/home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function ping_monitor
/home/user/Documents/BorgBackup/home.yaml: Pinging Healthchecks start
/home/user/Documents/BorgBackup/home.yaml: Using Healthchecks ping URL https://hc-ping.com/xxxx
/media/user/Backup/p-pc/home.borg:{hostname}-{now}: Pruning archives
borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prefix {hostname} --debug --show-rc /media/user/Backup/p-pc/home.borg:{hostname}-{now}
using builtin fallback logging configuration
35 self tests completed in 0.06 seconds
Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 415, in open
    st = os.stat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4621, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4553, in run
    return set_ec(func(args))
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 162, in wrapper
    with repository:
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 190, 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 417, in open
    raise self.DoesNotExist(path)
borg.repository.Repository.DoesNotExist: Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist.
Platform: Linux P-PC 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64
Linux: Unknown Linux
Borg: 1.1.15  Python: CPython 3.8.5 msgpack: 0.5.6
PID: 79359  CWD: /home/user
sys.argv: ['/usr/bin/borg', 'prune', '--keep-daily', '7', '--keep-weekly', '4', '--keep-monthly', '6', '--prefix', '{hostname}', '--debug', '--show-rc', '/media/user/Backup/p-pc/home.borg:{hostname}-{now}']
SSH_ORIGINAL_COMMAND: None
terminating with error status, rc 2
/media/user/Backup/p-pc/home.borg:{hostname}-{now}: Error running actions for repository
Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prefix {hostname} --debug --show-rc /media/user/Backup/p-pc/home.borg:{hostname}-{now}' returned non-zero exit status 2.
/home/user/Documents/BorgBackup/home.yaml: No commands to run for on-error hook
/home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function ping_monitor
/home/user/Documents/BorgBackup/home.yaml: Pinging Healthchecks fail
/home/user/Documents/BorgBackup/home.yaml: Using Healthchecks ping URL https://xxx
/home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function destroy_monitor
/home/user/Documents/BorgBackup/home.yaml: Error running configuration file
/home/user/Documents/BorgBackup/home.yaml: No commands to run for post-everything hook

summary:
/home/user/Documents/BorgBackup/home.yaml: Error running configuration file
/media/user/Backup/p-pc/home.borg:{hostname}-{now}: Error running actions for repository
...
Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 415, in open
    st = os.stat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4621, in main
    exit_code = archiver.run(args)
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4553, in run
    return set_ec(func(args))
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 162, in wrapper
    with repository:
  File "/usr/lib/python3/dist-packages/borg/repository.py", line 190, 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 417, in open
    raise self.DoesNotExist(path)
borg.repository.Repository.DoesNotExist: Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist.
Platform: Linux P-PC 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64
Linux: Unknown Linux
Borg: 1.1.15  Python: CPython 3.8.5 msgpack: 0.5.6
PID: 79359  CWD: /home/user
sys.argv: ['/usr/bin/borg', 'prune', '--keep-daily', '7', '--keep-weekly', '4', '--keep-monthly', '6', '--prefix', '{hostname}', '--debug', '--show-rc', '/media/user/Backup/p-pc/home.borg:{hostname}-{now}']
SSH_ORIGINAL_COMMAND: None
terminating with error status, rc 2
Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prefix {hostname} --debug --show-rc /media/user/Backup/p-pc/home.borg:{hostname}-{now}' returned non-zero exit status 2.

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

Expected behavior (if a bug)

Creating / Pruning the Archive.

Other notes / implementation ideas

Environment

borgmatic version: [1.5.12]

borgmatic installation method: [pip3]

Borg version: [borg 1.1.15]

Python version: [Python 3.8.5]

Database version (if applicable): [none]

operating system and version: [Ubuntu LTS]

#### What I'm trying to do and why Creating the first Backup. #### Steps to reproduce (if a bug) ``` borgmatic -v 2 -c /home/user/Documents/BorgBackup/home.yaml ``` home.yaml: ``` location: # List of source directories to backup. source_directories: - /home # Paths of local or remote repositories to backup to. repositories: - /media/user/Backup/p-pc/home.borg:{hostname}-{now} # Any paths matching these patterns are excluded from backups. # Globs and tildes are expanded. See the output of "borg help # patterns" for more details. exclude_patterns: - '*.cache/*' exclude_caches: true exclude_if_present: - .nobackup keep_exclude_tags: true storage: encryption_passcommand: secret-tool lookup borg-repository home.borg # encryption_passphrase: "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" # ssh_command: ssh -i /path/to/private/key compression: lzma6 retention: # Retention policy for how many backups to keep. keep_daily: 7 keep_weekly: 4 keep_monthly: 6 prefix: "{hostname}" consistency: # List of checks to run to validate your backups. checks: - repository - archives hooks: # Third-party services to notify you if backups aren't happening. healthchecks: https://hc-ping.com/xxx ``` #### Actual behavior (if a bug) ``` Ensuring legacy configuration is upgraded /home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-everything hook /home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function initialize_monitor /home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-prune hook /home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-backup hook /home/user/Documents/BorgBackup/home.yaml: No commands to run for pre-check hook /home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function ping_monitor /home/user/Documents/BorgBackup/home.yaml: Pinging Healthchecks start /home/user/Documents/BorgBackup/home.yaml: Using Healthchecks ping URL https://hc-ping.com/xxxx /media/user/Backup/p-pc/home.borg:{hostname}-{now}: Pruning archives borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prefix {hostname} --debug --show-rc /media/user/Backup/p-pc/home.borg:{hostname}-{now} using builtin fallback logging configuration 35 self tests completed in 0.06 seconds Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/repository.py", line 415, in open st = os.stat(path) FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4621, in main exit_code = archiver.run(args) File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4553, in run return set_ec(func(args)) File "/usr/lib/python3/dist-packages/borg/archiver.py", line 162, in wrapper with repository: File "/usr/lib/python3/dist-packages/borg/repository.py", line 190, 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 417, in open raise self.DoesNotExist(path) borg.repository.Repository.DoesNotExist: Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist. Platform: Linux P-PC 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 Linux: Unknown Linux Borg: 1.1.15 Python: CPython 3.8.5 msgpack: 0.5.6 PID: 79359 CWD: /home/user sys.argv: ['/usr/bin/borg', 'prune', '--keep-daily', '7', '--keep-weekly', '4', '--keep-monthly', '6', '--prefix', '{hostname}', '--debug', '--show-rc', '/media/user/Backup/p-pc/home.borg:{hostname}-{now}'] SSH_ORIGINAL_COMMAND: None terminating with error status, rc 2 /media/user/Backup/p-pc/home.borg:{hostname}-{now}: Error running actions for repository Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prefix {hostname} --debug --show-rc /media/user/Backup/p-pc/home.borg:{hostname}-{now}' returned non-zero exit status 2. /home/user/Documents/BorgBackup/home.yaml: No commands to run for on-error hook /home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function ping_monitor /home/user/Documents/BorgBackup/home.yaml: Pinging Healthchecks fail /home/user/Documents/BorgBackup/home.yaml: Using Healthchecks ping URL https://xxx /home/user/Documents/BorgBackup/home.yaml: Calling healthchecks hook function destroy_monitor /home/user/Documents/BorgBackup/home.yaml: Error running configuration file /home/user/Documents/BorgBackup/home.yaml: No commands to run for post-everything hook summary: /home/user/Documents/BorgBackup/home.yaml: Error running configuration file /media/user/Backup/p-pc/home.borg:{hostname}-{now}: Error running actions for repository ... Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/repository.py", line 415, in open st = os.stat(path) FileNotFoundError: [Errno 2] No such file or directory: '/media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4621, in main exit_code = archiver.run(args) File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4553, in run return set_ec(func(args)) File "/usr/lib/python3/dist-packages/borg/archiver.py", line 162, in wrapper with repository: File "/usr/lib/python3/dist-packages/borg/repository.py", line 190, 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 417, in open raise self.DoesNotExist(path) borg.repository.Repository.DoesNotExist: Repository /media/user/Backup/p-pc/home.borg:P-PC-2021-03-29T14:27:59 does not exist. Platform: Linux P-PC 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 Linux: Unknown Linux Borg: 1.1.15 Python: CPython 3.8.5 msgpack: 0.5.6 PID: 79359 CWD: /home/user sys.argv: ['/usr/bin/borg', 'prune', '--keep-daily', '7', '--keep-weekly', '4', '--keep-monthly', '6', '--prefix', '{hostname}', '--debug', '--show-rc', '/media/user/Backup/p-pc/home.borg:{hostname}-{now}'] SSH_ORIGINAL_COMMAND: None terminating with error status, rc 2 Command 'borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prefix {hostname} --debug --show-rc /media/user/Backup/p-pc/home.borg:{hostname}-{now}' returned non-zero exit status 2. Need some help? https://torsion.org/borgmatic/#issues ``` #### Expected behavior (if a bug) Creating / Pruning the Archive. #### Other notes / implementation ideas #### Environment **borgmatic version:** [1.5.12] **borgmatic installation method:** [pip3] **Borg version:** [borg 1.1.15] **Python version:** [Python 3.8.5] **Database version (if applicable):** [none] **operating system and version:** [Ubuntu LTS]
Owner

Have you initialized the repository at all? If not, that could explain why the file is missing!

Repository initialization instructions are here: https://torsion.org/borgmatic/docs/how-to/set-up-backups/#initialization

Have you initialized the repository at all? If not, that could explain why the file is missing! Repository initialization instructions are here: https://torsion.org/borgmatic/docs/how-to/set-up-backups/#initialization
witten added the
question / support
label 2021-03-29 21:08:20 +00:00
Author

Yes, i initialized with "borg init -e repokey /media/user/Backup/p-pc/home.borg"

Yes, i initialized with "borg init -e repokey /media/user/Backup/p-pc/home.borg"
Owner

Oh! I think I see the problem. The archive name format doesn't go in the repository name. So instead of this:

    repositories:
        - /media/user/Backup/p-pc/home.borg:{hostname}-{now}

... try this:

    repositories:
        - /media/user/Backup/p-pc/home.borg

Then, if you'd like to override the archive name format, set the archive_name_format in the storage section. However, you may not need to do that at all, given that the default archive_name_format is already {hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}

Please let me know if this fixes it for you.

Oh! I think I see the problem. The archive name format doesn't go in the repository name. So instead of this: ```yaml repositories: - /media/user/Backup/p-pc/home.borg:{hostname}-{now} ``` ... try this: ```yaml repositories: - /media/user/Backup/p-pc/home.borg ``` Then, if you'd like to override the archive name format, set the `archive_name_format` in the `storage` section. However, you may not need to do that at all, given that the default `archive_name_format` is already `{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}` Please let me know if this fixes it for you.
Author

Yes, it does, thanks.

Yes, it does, thanks.
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#405
No description provided.