Repository navigation
Description
Description
NS8 backups currently require internet access even when the restic backup image is already cached locally. core/imageroot/var/lib/nethserver/node/update-core.d/96cleanup_restic_images unconditionally removes cached restic image tags on every core update, and prepare_restic_command() (agent/pypkg/agent/__init__.py:215-271) never passes --pull=missing (or similar) to podman. So every backup run tries to re-pull ghcr.io/nethserver/restic:<version> first.
In air-gapped or intermittently-offline clusters this means backups either hang for minutes (3 retries against an unreachable registry) or fail outright, even though a working local image is available.
We want backups to work offline when a compatible restic image is already present locally, using it instead of always trying to re-pull.
Backup related logs:
Jul 07 16:06:59 ns8 agent@node[3314501]: Trying to pull ghcr.io/nethserver/restic:3.20.0...
Jul 07 16:07:29 ns8 agent@node[3314501]: time="2026-07-07T16:07:29+02:00" level=warning msg="Failed, retrying in 1s ... (1/3). Error: initializing source docker://ghcr.io/nethserver/restic:3.20.0: pinging container registry ghcr.io: Get \"https://ghcr.io/v2/\": dial tcp 140.82.121.33:443: i/o timeout"
Jul 07 16:08:00 ns8 agent@node[3314501]: time="2026-07-07T16:08:00+02:00" level=warning msg="Failed, retrying in 1s ... (2/3). Error: ...same..."
Jul 07 16:08:31 ns8 agent@node[3314501]: time="2026-07-07T16:08:31+02:00" level=warning msg="Failed, retrying in 1s ... (3/3). Error: ...same..."
Jul 07 16:09:03 ns8 podman[924198]: ... image pull-error ghcr.io/nethserver/restic:3.20.0 unable to copy from source docker://ghcr.io/nethserver/restic:3.20.0: ...i/o timeout
Jul 07 16:09:03 ns8 agent@node[3314501]: [ERROR] restic stats failed for 86d1a8ac-ef89-557a-8e19-8582ab86b7c4/traefik/e410ec36-ab9d-4eb9-9dc0-4e3ae4710825: Command '['podman', 'run', ...]' returned non-zero exit status 125.
Alternative solutions
- Use cached rootfull image: distribute rootfull restic image to all module agents.
- Pull policy fix only: pass
--pull=missingto thepodman runinvocation so a cached local image is used when present, and pull is only attempted when missing. - Pull policy fix + safer cleanup: additionally stop
96cleanup_restic_imagesfrom removing the currently-in-use image tag, so a cached image always survives across updates for offline use.
References
- Parent issue: Support offline operation (no internet access) #8088 (Support offline operation / no internet access)
- Customer ticket: https://helpdesk.nethesis.it/a/tickets/203497
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(backup): run Restic from node image store (#1437)
DavidePrincipi commentedon Dec 3, 2026
Fixed by NethServer/ns8-core#1437 and NethServer/ns8-core#1436, available in core 3.26.0-dev.7.
Test case
/var/lib/nethserver/node/restic-store/holds the Restic image, andrunagent -m mail1 podman imageslists no Restic image.0.0.0.0 ghcr.io pkg-containers.githubusercontent.comto/etc/hostsand run the backup again: it succeeds, and the journal has noTrying to pullline. Remove the line afterwards.DavidePrincipi commentedon Dec 3, 2026
QA verification: passed
Tested on a 3-node cluster with Rocky Linux 9 (SELinux enforcing). Nodes 1 and 2 were installed with core 3.25.1 and updated with
update-coretomain(with #1436, #1437) and then to 3.26.0-dev.7. Node 3 was installed directly with the new core and joined the cluster later. Backup destination: cluster local storage on node 2.Apps: Mail 2.0.0 (rootless), CrowdSec 1.5.1 (rootfull, with the
datavolume), Samba 3.5.1 (rootless since this release, so CrowdSec covers the rootfull case)./var/lib/nethserver/node/restic-store/<image>and no module, Mail included, has a Restic image. On the next update the previous store is kept next to the new one, as designed.0.0.0.0 ghcr.io pkg-containers.githubusercontent.comin/etc/hostson both nodes, two backups succeeded, including retention (forget and prune), with noTrying to pullline in the journal. For comparison, the same backup on 3.25.1 loggedTrying to pull ghcr.io/nethserver/restic:3.25.1.No SELinux denials (
ausearch -m avc) on any node.DavidePrincipi commentedon Dec 4, 2026
Release
NethServer/ns8-core3.26.0