[community/borgbackup] fails with Signals.SIGSEGV: 11
Reference issue in the borgmatic repo
Dockerfile:
FROM alpine:latest
RUN apk add --no-cache borgmatic openssh postgresql14-client
CMD ["borgmatic", "--stats", "-v" ,"0"]
systemd unit (starts docker image):
[Unit]
Description=Matrix Borg Backup
Requires=docker.service
After=docker.service
Requires=matrix-postgres.service
After=matrix-postgres.service
DefaultDependencies=no
[Service]
Type=oneshot
Environment="HOME=/root"
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker kill matrix-backup-borg 2>/dev/null || true'
ExecStartPre=-/usr/bin/env sh -c '/usr/bin/env docker rm matrix-backup-borg 2>/dev/null || true'
ExecStartPre=-/usr/bin/env docker run --rm --name matrix-backup-borg \
--log-driver=none \
--cap-drop=ALL \
--read-only \
--user=998:1001 \
--network=matrix \
--tmpfs=/tmp:rw,noexec,nosuid,size=100m \
--mount type=bind,src=/matrix/backup-borg/config/passwd,dst=/etc/passwd,ro \
--mount type=bind,src=/matrix/backup-borg/config,dst=/etc/borgmatic.d,ro \
--mount type=bind,src=/matrix,dst=/matrix,ro \
registry.gitlab.com/etke.cc/borgmatic:14 \
sh -c "borgmatic --init --encryption repokey-blake2"
ExecStart=/usr/bin/env docker run --rm --name matrix-backup-borg \
--log-driver=none \
--cap-drop=ALL \
--read-only \
--user=998:1001 \
--network=matrix \
--tmpfs=/tmp:rw,noexec,nosuid,size=100m \
--mount type=bind,src=/matrix/backup-borg/config/passwd,dst=/etc/passwd,ro \
--mount type=bind,src=/matrix/backup-borg/config,dst=/etc/borgmatic.d,ro \
--mount type=bind,src=/matrix,dst=/matrix,ro \
registry.gitlab.com/etke.cc/borgmatic:14
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker kill matrix-backup-borg 2>/dev/null || true'
ExecStop=-/usr/bin/env sh -c '/usr/bin/env docker rm matrix-backup-borg 2>/dev/null || true'
SyslogIdentifier=matrix-backup-borg
[Install]
WantedBy=multi-user.target
borgmatic config:
consistency:
checks:
- repository
- archives
hooks:
after_backup:
- echo "Backup created."
on_error:
- echo "Error while creating a backup."
postgresql_databases:
- hostname: matrix-postgres
name: synapse
password: REDACTED
port: 5432
username: matrix
- hostname: matrix-postgres
name: miniflux
password: REDACTED
port: 5432
username: matrix
location:
exclude_patterns:
- /matrix/synapse/storage/media-store/local_thumbnails
- /matrix/synapse/storage/media-store/remote_thumbnail
- /matrix/synapse/storage/media-store/url_cache
- /matrix/synapse/storage/media-store/url_cache_thumbnails
- /matrix/postgres/data
one_file_system: true
repositories:
- REDACTED_REPO
source_directories:
- /matrix
retention:
keep_daily: 7
keep_hourly: 0
keep_monthly: 12
keep_weekly: 4
keep_yearly: 2
prefix: matrix-
storage:
archive_name_format: matrix-{now:%Y-%m-%d-%H%M%S}
compression: lz4
encryption_passphrase: REDACTED
ssh_command: ssh -o "StrictHostKeyChecking accept-new" -i /etc/borgmatic.d/sshkey
unknown_unencrypted_repo_access_is_ok: false
Error log:
borg[3242478]: Fatal Python error: Segmentation fault
borg[3242478]: Current thread 0x00007f8efcddbb48 (most recent call first):
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 769 in write_archive_index
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 765 in fetch_and_build_idx
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 853 in create_master_idx
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 899 in sync
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 493 in __init__
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 374 in local
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 383 in __new__
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/archiver.py", line 1522 in do_prune
borg[3242478]: REDACTED_REPO: Error running actions for repository
borg[3242478]: Command 'borg prune --keep-daily 7 --keep-hourly 0 --keep-monthly 12 --keep-weekly 4 --keep-yearly 2 --prefix matrix- --stats REDACTED_REPO' died with <Signals.SIGSEGV: 11>.
borg[3242478]: Error while creating a backup.
borg[3242478]: /etc/borgmatic.d/config.yaml: Error running configuration file
borg[3242478]: summary:
borg[3242478]: /etc/borgmatic.d/config.yaml: Error running configuration file
borg[3242478]: REDACTED_REPO: Error running actions for repository
borg[3242478]: Remote: Warning: Permanently added 'REDACTED_REPO_HOST' (ED25519) to the list of known hosts.
borg[3242478]: Fatal Python error: Segmentation fault
borg[3242478]: Current thread 0x00007f8efcddbb48 (most recent call first):
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 769 in write_archive_index
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 765 in fetch_and_build_idx
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 853 in create_master_idx
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 899 in sync
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 493 in __init__
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 374 in local
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/cache.py", line 383 in __new__
borg[3242478]: File "/usr/lib/python3.10/site-packages/borg/archiver.py", line 1522 in do_prune
borg[3242478]: Command 'borg prune --keep-daily 7 --keep-hourly 0 --keep-monthly 12 --keep-weekly 4 --keep-yearly 2 --prefix matrix- --stats REDACTED_REPO' died with <Signals.SIGSEGV: 11>.
similar issue with completely unrelated project has following comment:
Signals.SIGSEGV: 11 seems to be a common bug when you are using different libraries/environments for compiling and running the code. I find a similar issue in other projects such as nvvl, this might give you a hint to check the running/compiling libraries to fix the bug.