From 7538ea8608fbae999d5004baef0425a05ea89f3f Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 2 Sep 2026 19:24:30 +0200 Subject: [PATCH] fix(release): refuse to run from a snap-sandboxed HOME When release.sh is launched from VS Code's integrated terminal, podman sees $HOME=/home/$USER/snap/code// and stores its database there. If snapd auto-updates code mid-session (rev 258 -> 260), the next podman invocation finds a stale static-dir pointer and aborts with: Error: database static dir ".../snap/code/258/.../libpod" does not match our static dir ".../snap/code/260/.../libpod" Detect the pattern ($HOME under /home/*/snap/*) and bail out early with an actionable message: re-run from a regular host terminal. --- Docker/push.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Docker/push.sh b/Docker/push.sh index 9c7c173..4e9851e 100644 --- a/Docker/push.sh +++ b/Docker/push.sh @@ -59,9 +59,26 @@ else err "Neither podman nor docker is installed." fi -# --------------------------------------------------------------------------- +# ------------------------------------------------------------------- +# Refuse to run from inside a confined snap sandbox (e.g. the VS Code +# integrated terminal). When the script is launched from such a +# sandbox, $HOME points under /home/$USER/snap/code// and podman +# stores its DB under that path. If a snap revision bump happens mid +# session, the next podman invocation finds a stale static-dir pointer +# and aborts with a confusing "database static dir ... does not match" +# error. Re-run the script from a regular host shell instead. +# ------------------------------------------------------------------- +case "${HOME:-}" in + /home/*/snap/*) + err "Refusing to run inside a snap-sandboxed HOME (${HOME}). \ +Re-run from a regular host terminal (e.g. gnome-terminal, konsole) \ +so podman uses a stable storage path." + ;; +esac + +# ------------------------------------------------------------------- # Pre-flight checks -# --------------------------------------------------------------------------- +# ------------------------------------------------------------------- echo "============================================" echo " AniWorld — Build & Push" echo " Engine : ${ENGINE}"