Skip to content

Troubleshoot Backup Issues

Backups Fail with Failed to create/acquire the lock

This can happen if a backup operation was interrupted. To recover from this, you’ll need to enter the backup repository and break the lock.

SSH into the node that holds this backup, and enter a backup container with:

Replace VOLUME-ID with the ID of the volume. This can be found by viewing the volume in the administrator of ComputeStacks. It should be in the form of a UUID, however it may be a long string of lowercase letters and numbers if the volume was created by docker and later imported by ComputeStacks.

VOLID=VOLUME-ID; docker run --rm -it --label "com.computestacks.role=backup" -e "BORG_BASE_DIR=/mnt/borg" -e "BORG_REPO=/mnt/borg/backup" -v b-$VOLID:/mnt/borg -v $VOLID:/mnt/data ghcr.io/computestacks/cs-docker-borg:1.4 /usr/bin/borg break-lock

Backups Are Refused or Skipped During Maintenance

While a node is in maintenance, or offline, backups, restores, backup deletion, and backup downloads for its volumes are refused, and the event says why. Scheduled backups on the node are skipped for the length of the window, and the node page shows how many were skipped. With cs-agent 3.5 or later, each volume that missed a scheduled backup gets one catch-up backup when maintenance ends, unless its next scheduled backup is due within backups.maintenance_catchup_skip_sec (default 7200, in seconds). Set backups.maintenance_catchup: false in agent.yml to skip missed backups instead. Without catch-up, backups resume on their next scheduled slot.

If backups on a node stop without explanation, check the node page for a forgotten maintenance hold.

MariaDB Backups Fail Waiting for a Lock

On MariaDB 10.4 and later, the backup needs a short backup lock. That lock waits for long-running DDL (such as ALTER TABLE or OPTIMIZE TABLE) and for writes to MyISAM or other non-transactional tables, but never for a SELECT or an InnoDB write. A backup that waits longer than mariadb.lock_wait.timeout (default 60 seconds, 0 disables) is stopped, and the failure names the longest-running query. Wait for that statement to finish, or raise the timeout in the node's agent.yml:

mariadb:
  lock_wait:
    timeout: 60

These settings sit at the top level of agent.yml, not under backups:. mariadb.lock_wait.query_type and mariadb.long_queries.* are no longer used (cs-agent 3.5 or later).

MySQL or MariaDB Backups Fail with a Refused Root Login

If the database refuses the root login, the backup fails immediately and says so, instead of retrying and reporting Failed to connect. The backup connects as root with the container's root password, even when MYSQL_USER and MYSQL_PASSWORD are also set, so check that the root password the container was created with is still valid. Other connection failures are retried and include the client's last error.

Backups Succeed with a Warning About Vanished Paths

Files or directories deleted while the backup was running are listed in the backup's warning. This is expected for volumes with temporary files, and the backup is still complete. If instead the backup fails naming a missing path, something on the volume was renamed or moved during the backup; run it again.

NFS Backup Repositories Fail to Mount

Backup repositories on NFS are mounted as NFS 4.2 (backups.borg.nfs_version, default 4.2), which requires an NFS server that supports 4.1 or later. Older NFS 4.0 mounts can fail with cannot allocate memory under memory pressure on Linux 6.6 to 6.16 kernels. If your NFS server doesn't support 4.1 or later, set nfs_version: "4" to keep the previous behavior. Existing repository volumes are re-created with the new mount options the next time an idle volume is used; the backups on the NFS server aren't touched.

Adjusting the Backup Schedule Spread

Scheduled backups start at a per-project offset after their cron time, at most backups.schedule_spread_max_sec seconds (default 7200) and at most a quarter of the backup interval. Set it to 0 to run backups exactly at their cron time.