From 7983b79ee721ac15e04773bb3f8b13e87e09320a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 5 Nov 2026 08:14:15 +0000 Subject: [PATCH] fix(svc-storage-nfs-server): pre-create the backup mount point in the shared state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every swarm node bind-mounts its node-local backup store over /var/lib/infinito/backup, which lies inside the NFS-shared state. With the mount point missing, ansible.posix.mount creates it on each node at the same moment; it tolerates EEXIST only when isdir() confirms the path, and a stale NFS lookup cache can deny that. PR #1376 run 41925742061 (Penpot#0 swarm) failed so on swarm-wrk-01 with "Error making dir /var/lib/infinito/backup: [Errno 17] File exists" while mgr-01 and wrk-02 succeeded. The NFS server now creates the mount point in STORAGE_NFS_STATE_PATH right after the state directory, as root:root 0755 like the mount module's own mkdir, so no client has to create it. Existing hosts already have it with that owner and mode. | 🎯 Fix | 💥 Break | 🌱 Efficiency | ⚡ Speed | 🛡️ Security | 🏆 Score | Gate | | --- | --- | --- | --- | --- | --- | --- | | 88 % | 2 % | – | – | ~100 % | 86 | ⛔ fix 88 % < 90 | Co-Authored-By: Claude Opus 5.5 --- roles/svc-storage-nfs-server/tasks/01_prepare.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/svc-storage-nfs-server/tasks/01_prepare.yml b/roles/svc-storage-nfs-server/tasks/01_prepare.yml index d265346729..5961e5ae11 100644 --- a/roles/svc-storage-nfs-server/tasks/01_prepare.yml +++ b/roles/svc-storage-nfs-server/tasks/01_prepare.yml @@ -18,6 +18,14 @@ group: root mode: "0755" +- name: "📁 Pre-create the {{ DIR_BACKUPS }} mount point in the shared state, so no two clients create it at once" + ansible.builtin.file: + path: "{{ [STORAGE_NFS_STATE_PATH, DIR_BACKUPS | relpath(DIR_VAR_LIB)] | path_join }}" + state: directory + owner: root + group: root + mode: "0755" + - name: "✅ Assert the state subdir is strictly nested under the export base" ansible.builtin.assert: that: