[Errno 18] Cross-device link #931

Closed
opened 2024-11-08 02:00:39 +00:00 by modem7 Β· 13 comments

What I'm trying to do and why

Backups started failing in 1.9.0. Probably me not RTFMing and understanding the release notes re "Move the default check state directory".

summary:
/etc/borgmatic.d/config.yml: An error occurred
Borgbase: Error running actions for repository
[Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks'

Steps to reproduce

source_directories:
     - ${BORG_SOURCE_1}
     - ${BORG_SOURCE_2}
repositories:
     - path: ${BORG_REPO}
       label: Borgbase
one_file_system: true
exclude_caches: true

#storage:
#   Passphase is set in variable $BORG_PASSPHRASE
compression: lz4
archive_name_format: 'backup-{now}'

keep_hourly: 0
keep_daily: 7
keep_weekly: 4
keep_monthly: 12
keep_yearly: 1

checks:
#  - name: repository
#    frequency: 2 weeks
#  - name: archives
#    frequency: always
#  - name: extract
#    frequency: 2 weeks
#  - name: data
#    frequency: 1 month

before_everything:
#    - borgmatic break-lock
#    - echo "Starting a backup job."
    - echo "Stopping containers."
    - exec /borgscripts/docker-stop.sh
after_everything:
    - echo "Starting containers."
    - exec /borgscripts/docker-start.sh
    - echo "Backup created."
on_error:
    - echo "Error while creating a backup."
    - exec /borgscripts/docker-start.sh
    # https://torsion.org/borgmatic/docs/how-to/backup-your-databases/

healthchecks:
    ping_url: ${BORG_HEALTHCHECK_URL}

Actual behavior

No response

Expected behavior

No response

Other notes / implementation ideas

apprise 1.9.0
borg 1.4.0
borgmatic 1.9.0
dockercli 25.0.5
composecli 2.23.3
python 3.13.0

borgmatic version

No response

borgmatic installation method

No response

Borg version

No response

Python version

No response

Database version (if applicable)

No response

Operating system and version

No response

### What I'm trying to do and why Backups started failing in 1.9.0. Probably me not RTFMing and understanding the release notes re "Move the default check state directory". ``` summary: /etc/borgmatic.d/config.yml: An error occurred Borgbase: Error running actions for repository [Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks' ``` ### Steps to reproduce ```yaml source_directories: - ${BORG_SOURCE_1} - ${BORG_SOURCE_2} repositories: - path: ${BORG_REPO} label: Borgbase one_file_system: true exclude_caches: true #storage: # Passphase is set in variable $BORG_PASSPHRASE compression: lz4 archive_name_format: 'backup-{now}' keep_hourly: 0 keep_daily: 7 keep_weekly: 4 keep_monthly: 12 keep_yearly: 1 checks: # - name: repository # frequency: 2 weeks # - name: archives # frequency: always # - name: extract # frequency: 2 weeks # - name: data # frequency: 1 month before_everything: # - borgmatic break-lock # - echo "Starting a backup job." - echo "Stopping containers." - exec /borgscripts/docker-stop.sh after_everything: - echo "Starting containers." - exec /borgscripts/docker-start.sh - echo "Backup created." on_error: - echo "Error while creating a backup." - exec /borgscripts/docker-start.sh # https://torsion.org/borgmatic/docs/how-to/backup-your-databases/ healthchecks: ping_url: ${BORG_HEALTHCHECK_URL} ``` ### Actual behavior _No response_ ### Expected behavior _No response_ ### Other notes / implementation ideas apprise 1.9.0 borg 1.4.0 borgmatic 1.9.0 dockercli 25.0.5 composecli 2.23.3 python 3.13.0 ### borgmatic version _No response_ ### borgmatic installation method _No response_ ### Borg version _No response_ ### Python version _No response_ ### Database version (if applicable) _No response_ ### Operating system and version _No response_
Owner

Thanks for taking the time to file this! I think I have an idea of what might be going on.. Are /root/.borgmatic/checks and /root/.local/state/borgmatic/checks on different filesystems on your machine?

If that's the case, I have a way to fix the borgmatic code so that it can do cross-filesystem moves.

Thanks for taking the time to file this! I think I have an idea of what might be going on.. Are `/root/.borgmatic/checks` and `/root/.local/state/borgmatic/checks` on different filesystems on your machine? If that's the case, I have a way to fix the borgmatic code so that it can do cross-filesystem moves.
witten added the
bug
label 2024-11-08 02:58:14 +00:00
Owner

Okay, I've pushed a fix to main, but it would still be good to confirm whether your two paths are on different filesystems. Thanks!

Okay, I've pushed a fix to main, but it would still be good to confirm whether your two paths are on different filesystems. Thanks!

Hi, i am having the same issue. Looking forward for the fix in main.

For me it is basically in two different file systems (running in docker /root/.borgmatic is mapped to a folder on my host and /root/.local/ is in a docker volume.

Hi, i am having the same issue. Looking forward for the fix in main. For me it is basically in two different file systems (running in docker `/root/.borgmatic` is mapped to a folder on my host and `/root/.local/` is in a docker volume.
Owner

Thanks for weighing in. That makes sense as a use case where this issue would manifest.

Thanks for weighing in. That makes sense as a use case where this issue would manifest.
Author

This is my current compose file (which I realise I didn't post originally (derp))

  #############
  ##Borgmatic##
  #############

  borgmatic:
    image: modem7/borgmatic-docker
    # image: modem7/borgmatic-docker:1.8.13-1.4.0
    # image: borgmatic:test
    # image: ghcr.io/borgmatic-collective/borgmatic
    container_name: Borgmatic
    environment:
      TZ: $TZ
      BORG_PASSPHRASE: $BORG_PASSPHRASE
      BORG_SOURCE_1: $BORG_SOURCE_1
      BORG_SOURCE_2: $BORG_SOURCE_2
      BORG_REPO: $BORG_REPO
      BORG_HEALTHCHECK_URL: $BORG_HEALTHCHECK_URL
      # EXTRA_PKGS: postgresql16-client rclone coreutils jq
      DOCKERCLI: true
      CRON: $BORG_CRON
      CRON_COMMAND: $BORG_CRON_COMMAND
      # EXTRA_CRON: |-
      #   @daily borgmatic check -v 1 2>&1 > tee /mnt/log/check-$(date +\%Y-\%m-\%dT\%H:\%M:\%S).log
      #   0 7 1 * * command2
    logging:
      driver: "local"
      options:
        max-size: 10m
        max-file: "3"
    volumes:
      - $BORGHOMESOURCEDIR:/mnt/source/
      # - $CRONTAB:/mnt/source/Cron
      # - Pihole:/mnt/source/Pihole/Pihole
      # - Dnsmasq:/mnt/source/Pihole/Dnsmasq
      - $BORGSERVBACKUPDIR/Database:/mnt/borg-DBrepository
      - $BORGSERVBACKUPDIR/Docker:/mnt/borg-repository
      - $RAMDRIVEBACKUP/borg:/mnt/ramdrive
      - $USERDIR:/mnt/source/DockerApps/
      - $USERDIR/Borgmatic/borgmatic.d/:/etc/borgmatic.d/
      - $USERDIR/Borgmatic/.config/borg/:/root/.config/borg
      - $USERDIR/Borgmatic/.ssh/:/root/.ssh
      - $USERDIR/Borgmatic/.state/:/root/.borgmatic
      - $USERDIR/Borgmatic/.cache/borg/:/root/.cache/borg
      - $DOCKERDIR/HDA/.env:/mnt/docker/HDA/.env:ro
      - $DOCKERDIR/HDA/docker-compose.yml:/mnt/docker/HDA/docker-compose.yml:ro
      - $BORGSCRIPTS:/borgscripts:ro
      - /var/run/docker.sock:/var/run/docker.sock # So we can run scripts
      # - /mnt/downloads/script/:/custom-cont-init.d:ro
    networks:
      isonet:
      isolated:
    restart: always

So I'm not quite sure why it thinks it's going across filesystems in my particular case.

Hopefully the fix will resolve! Will test when it gets released!

This is my current compose file (which I realise I didn't post originally (derp)) ```yaml ############# ##Borgmatic## ############# borgmatic: image: modem7/borgmatic-docker # image: modem7/borgmatic-docker:1.8.13-1.4.0 # image: borgmatic:test # image: ghcr.io/borgmatic-collective/borgmatic container_name: Borgmatic environment: TZ: $TZ BORG_PASSPHRASE: $BORG_PASSPHRASE BORG_SOURCE_1: $BORG_SOURCE_1 BORG_SOURCE_2: $BORG_SOURCE_2 BORG_REPO: $BORG_REPO BORG_HEALTHCHECK_URL: $BORG_HEALTHCHECK_URL # EXTRA_PKGS: postgresql16-client rclone coreutils jq DOCKERCLI: true CRON: $BORG_CRON CRON_COMMAND: $BORG_CRON_COMMAND # EXTRA_CRON: |- # @daily borgmatic check -v 1 2>&1 > tee /mnt/log/check-$(date +\%Y-\%m-\%dT\%H:\%M:\%S).log # 0 7 1 * * command2 logging: driver: "local" options: max-size: 10m max-file: "3" volumes: - $BORGHOMESOURCEDIR:/mnt/source/ # - $CRONTAB:/mnt/source/Cron # - Pihole:/mnt/source/Pihole/Pihole # - Dnsmasq:/mnt/source/Pihole/Dnsmasq - $BORGSERVBACKUPDIR/Database:/mnt/borg-DBrepository - $BORGSERVBACKUPDIR/Docker:/mnt/borg-repository - $RAMDRIVEBACKUP/borg:/mnt/ramdrive - $USERDIR:/mnt/source/DockerApps/ - $USERDIR/Borgmatic/borgmatic.d/:/etc/borgmatic.d/ - $USERDIR/Borgmatic/.config/borg/:/root/.config/borg - $USERDIR/Borgmatic/.ssh/:/root/.ssh - $USERDIR/Borgmatic/.state/:/root/.borgmatic - $USERDIR/Borgmatic/.cache/borg/:/root/.cache/borg - $DOCKERDIR/HDA/.env:/mnt/docker/HDA/.env:ro - $DOCKERDIR/HDA/docker-compose.yml:/mnt/docker/HDA/docker-compose.yml:ro - $BORGSCRIPTS:/borgscripts:ro - /var/run/docker.sock:/var/run/docker.sock # So we can run scripts # - /mnt/downloads/script/:/custom-cont-init.d:ro networks: isonet: isolated: restart: always ``` So I'm not quite sure why it thinks it's going across filesystems in my particular case. Hopefully the fix will resolve! Will test when it gets released!
Owner

Ah yeah. So it does appear that /root/.borgmatic would be on one filesystem (since it's a mounted volume) while /root/.local/state would be on another. Once you upgrade, it would be good to switch your volume mount from the former to the latter if you'd like check state to persist across container restarts.

Ah yeah. So it does appear that `/root/.borgmatic` would be on one filesystem (since it's a mounted volume) while `/root/.local/state` would be on another. Once you upgrade, it would be good to switch your volume mount from the former to the latter if you'd like check state to persist across container restarts.
Owner

Fixed in borgmatic 1.9.1, just released!

Fixed in borgmatic 1.9.1, just released!

Fixed in borgmatic 1.9.1, just released!

Halo I'm experiencing this issue too.

this my docker compose

services:

  borgmatic:
    container_name: borgmatic
    image: ghcr.io/borgmatic-collective/borgmatic
    restart: always
    security_opt:
      - no-new-privileges:true
    networks:
      borg_proxy:
    volumes:
      - $VOLUME_SOURCE:/mnt/source:ro
      - $BORGDIR/data:/mnt/borg-repository
      - $BORGDIR/borgmatic.d:/etc/borgmatic.d/
      - $BORGDIR/.config/borg:/root/.config/borg
      - $BORGDIR/.ssh:/root/.ssh
      - $BORGDIR/.cache/borg:/root/.cache/borg
      - $BORGDIR/.borgmatic/:/root/.borgmatic
    environment:
      - TZ=$TZ

this my borgmatic config:

repositories:
    - path: ssh://
      label: rsync

one_file_system: true
read_special: true
encryption_passphrase: ""
compression: lz4
ssh_command: ssh
archive_name_format: '-rsync-{now}'

keep_daily: 5
keep_weekly: 4
keep_monthly: 3

checks:
    - name: repository
    - name: archives
      frequency: 2 weeks
check_last: 3

before_backup:
    - echo "Starting a backup rsync."
after_backup:
    - echo "Finished a backup rsync."
on_error:
    - echo "Error during create/prune/compact/check."

the error:

rsync: Error running actions for repository
[Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks'
> Fixed in borgmatic 1.9.1, just released! Halo I'm experiencing this issue too. this my docker compose ``` services: borgmatic: container_name: borgmatic image: ghcr.io/borgmatic-collective/borgmatic restart: always security_opt: - no-new-privileges:true networks: borg_proxy: volumes: - $VOLUME_SOURCE:/mnt/source:ro - $BORGDIR/data:/mnt/borg-repository - $BORGDIR/borgmatic.d:/etc/borgmatic.d/ - $BORGDIR/.config/borg:/root/.config/borg - $BORGDIR/.ssh:/root/.ssh - $BORGDIR/.cache/borg:/root/.cache/borg - $BORGDIR/.borgmatic/:/root/.borgmatic environment: - TZ=$TZ ``` this my borgmatic config: ``` repositories: - path: ssh:// label: rsync one_file_system: true read_special: true encryption_passphrase: "" compression: lz4 ssh_command: ssh archive_name_format: '-rsync-{now}' keep_daily: 5 keep_weekly: 4 keep_monthly: 3 checks: - name: repository - name: archives frequency: 2 weeks check_last: 3 before_backup: - echo "Starting a backup rsync." after_backup: - echo "Finished a backup rsync." on_error: - echo "Error during create/prune/compact/check." ``` the error: ``` rsync: Error running actions for repository [Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks' ```

Fixed in borgmatic 1.9.1, just released!

Halo I'm experiencing this issue too.

this my docker compose

services:

  borgmatic:
    container_name: borgmatic
    image: ghcr.io/borgmatic-collective/borgmatic
    restart: always
    security_opt:
      - no-new-privileges:true
    networks:
      borg_proxy:
    volumes:
      - $VOLUME_SOURCE:/mnt/source:ro
      - $BORGDIR/data:/mnt/borg-repository
      - $BORGDIR/borgmatic.d:/etc/borgmatic.d/
      - $BORGDIR/.config/borg:/root/.config/borg
      - $BORGDIR/.ssh:/root/.ssh
      - $BORGDIR/.cache/borg:/root/.cache/borg
      - $BORGDIR/.borgmatic/:/root/.borgmatic
    environment:
      - TZ=$TZ

this my borgmatic config:

repositories:
    - path: ssh://
      label: rsync

one_file_system: true
read_special: true
encryption_passphrase: ""
compression: lz4
ssh_command: ssh
archive_name_format: '-rsync-{now}'

keep_daily: 5
keep_weekly: 4
keep_monthly: 3

checks:
    - name: repository
    - name: archives
      frequency: 2 weeks
check_last: 3

before_backup:
    - echo "Starting a backup rsync."
after_backup:
    - echo "Finished a backup rsync."
on_error:
    - echo "Error during create/prune/compact/check."

the error:

rsync: Error running actions for repository
[Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks'

Container β€žLatestβ€œ is not version 1.9.1 yet.

> > Fixed in borgmatic 1.9.1, just released! > > Halo I'm experiencing this issue too. > > this my docker compose > > ``` > services: > > borgmatic: > container_name: borgmatic > image: ghcr.io/borgmatic-collective/borgmatic > restart: always > security_opt: > - no-new-privileges:true > networks: > borg_proxy: > volumes: > - $VOLUME_SOURCE:/mnt/source:ro > - $BORGDIR/data:/mnt/borg-repository > - $BORGDIR/borgmatic.d:/etc/borgmatic.d/ > - $BORGDIR/.config/borg:/root/.config/borg > - $BORGDIR/.ssh:/root/.ssh > - $BORGDIR/.cache/borg:/root/.cache/borg > - $BORGDIR/.borgmatic/:/root/.borgmatic > environment: > - TZ=$TZ > ``` > > this my borgmatic config: > > ``` > repositories: > - path: ssh:// > label: rsync > > one_file_system: true > read_special: true > encryption_passphrase: "" > compression: lz4 > ssh_command: ssh > archive_name_format: '-rsync-{now}' > > keep_daily: 5 > keep_weekly: 4 > keep_monthly: 3 > > checks: > - name: repository > - name: archives > frequency: 2 weeks > check_last: 3 > > before_backup: > - echo "Starting a backup rsync." > after_backup: > - echo "Finished a backup rsync." > on_error: > - echo "Error during create/prune/compact/check." > ``` > > the error: > > ``` > rsync: Error running actions for repository > [Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks' > ``` Container β€žLatestβ€œ is not version 1.9.1 yet.
Author

Fixed in borgmatic 1.9.1, just released!

Halo I'm experiencing this issue too.

this my docker compose

services:

  borgmatic:
    container_name: borgmatic
    image: ghcr.io/borgmatic-collective/borgmatic
    restart: always
    security_opt:
      - no-new-privileges:true
    networks:
      borg_proxy:
    volumes:
      - $VOLUME_SOURCE:/mnt/source:ro
      - $BORGDIR/data:/mnt/borg-repository
      - $BORGDIR/borgmatic.d:/etc/borgmatic.d/
      - $BORGDIR/.config/borg:/root/.config/borg
      - $BORGDIR/.ssh:/root/.ssh
      - $BORGDIR/.cache/borg:/root/.cache/borg
      - $BORGDIR/.borgmatic/:/root/.borgmatic
    environment:
      - TZ=$TZ

this my borgmatic config:

repositories:
    - path: ssh://
      label: rsync

one_file_system: true
read_special: true
encryption_passphrase: ""
compression: lz4
ssh_command: ssh
archive_name_format: '-rsync-{now}'

keep_daily: 5
keep_weekly: 4
keep_monthly: 3

checks:
    - name: repository
    - name: archives
      frequency: 2 weeks
check_last: 3

before_backup:
    - echo "Starting a backup rsync."
after_backup:
    - echo "Finished a backup rsync."
on_error:
    - echo "Error during create/prune/compact/check."

the error:

rsync: Error running actions for repository
[Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks'

borgmatic-collective/borgmatic has not been updated to 1.9.1 just yet.

Please monitor borgmatic docker releases for an update.

Should hopefully be done in the next day or two.

Edit: @xLogiiCx - doi - just realised I replied to you. I think I need more coffee...

> > Fixed in borgmatic 1.9.1, just released! > > Halo I'm experiencing this issue too. > > this my docker compose > > ``` > services: > > borgmatic: > container_name: borgmatic > image: ghcr.io/borgmatic-collective/borgmatic > restart: always > security_opt: > - no-new-privileges:true > networks: > borg_proxy: > volumes: > - $VOLUME_SOURCE:/mnt/source:ro > - $BORGDIR/data:/mnt/borg-repository > - $BORGDIR/borgmatic.d:/etc/borgmatic.d/ > - $BORGDIR/.config/borg:/root/.config/borg > - $BORGDIR/.ssh:/root/.ssh > - $BORGDIR/.cache/borg:/root/.cache/borg > - $BORGDIR/.borgmatic/:/root/.borgmatic > environment: > - TZ=$TZ > ``` > > this my borgmatic config: > > ``` > repositories: > - path: ssh:// > label: rsync > > one_file_system: true > read_special: true > encryption_passphrase: "" > compression: lz4 > ssh_command: ssh > archive_name_format: '-rsync-{now}' > > keep_daily: 5 > keep_weekly: 4 > keep_monthly: 3 > > checks: > - name: repository > - name: archives > frequency: 2 weeks > check_last: 3 > > before_backup: > - echo "Starting a backup rsync." > after_backup: > - echo "Finished a backup rsync." > on_error: > - echo "Error during create/prune/compact/check." > ``` > > the error: > > ``` > rsync: Error running actions for repository > [Errno 18] Cross-device link: '/root/.borgmatic/checks' -> '/root/.local/state/borgmatic/checks' > ``` borgmatic-collective/borgmatic has not been updated to 1.9.1 just yet. Please monitor [borgmatic docker releases](https://github.com/borgmatic-collective/docker-borgmatic/releases) for an update. Should hopefully be done in the next day or two. Edit: @xLogiiCx - doi - just realised I replied to you. I think I need more coffee...
Author

@witten - For feedback, I can confirm the 1.9.1 works as intended, thank you!

@witten - For feedback, I can confirm the 1.9.1 works as intended, thank you!

I can confirm that it works now as well. Thank you!

I can confirm that it works now as well. Thank you!
Owner

Awesome, glad to hear it!

Awesome, glad to hear it!
Sign in to join this conversation.
No Milestone
4 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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