From 52a7adadd8aace3e3832ef4e9ce66d0ddd15b59c Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 7 Jul 2026 19:08:14 +0200 Subject: [PATCH] fix(espocrm): create the session dir before the image init The image installer itself calls session_start (install/cli.php); with the conf.d save_path pointing at data/.sessions, which the entrypoint only created after init, the installer lost its session state on every invocation and aborted with 'No database name specified in config'. Create and chown the session dir inside the lock before running the image entrypoint. Co-Authored-By: Claude Opus 4.8 (1M context) --- roles/web-app-espocrm/files/docker-entrypoint-custom.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/roles/web-app-espocrm/files/docker-entrypoint-custom.sh b/roles/web-app-espocrm/files/docker-entrypoint-custom.sh index 4ac642301a..2115686128 100644 --- a/roles/web-app-espocrm/files/docker-entrypoint-custom.sh +++ b/roles/web-app-espocrm/files/docker-entrypoint-custom.sh @@ -29,8 +29,6 @@ log "Flags: maintenance=${MAINTENANCE} cron_disabled=${CRON_DISABLED} use_cache= : "${ESPOCRM_SCRIPT_SEED:?missing ESPOCRM_SCRIPT_SEED}" SEED_CONFIG_SCRIPT="${ESPOCRM_SCRIPT_SEED}" -# Exception: the swarm NFS mount forces local_lock=flock, so flock(2) never -# crosses nodes; atomic mkdir on the NFS server is the working cross-replica mutex. _have_lock=0 _lock_tries=0 while :; do @@ -59,9 +57,9 @@ if [ "$_have_lock" = "1" ]; then trap 'rmdir "$BOOT_LOCK" 2>/dev/null || true' EXIT trap 'rmdir "$BOOT_LOCK" 2>/dev/null || true; exit 143' TERM INT - # Exception: the image entrypoint installs/upgrades against the shared volume - # and DB, then execs its CMD; /bin/true makes that exec a no-op so control - # returns here and the real server starts outside the lock on every replica. + mkdir -p "$SESSION_DIR" + chown www-data:www-data "$SESSION_DIR" 2>/dev/null || true + if [ -x "$ORIG_ENTRYPOINT" ]; then log "Running image entrypoint init via $ORIG_ENTRYPOINT" "$ORIG_ENTRYPOINT" /bin/true