From 791c9a3c479bc078b179e0f836c28cddc19741e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Feb 2026 06:27:32 +0000 Subject: [PATCH] Fix YAML syntax error in Immich docker-compose templates The healthcheck test value contained "googlechecksum: $$Chksum" which YAML interprets as a mapping separator (colon-space in an unquoted scalar). This caused "mapping values are not allowed in this context" on the command line below it. Fixed by using >- block scalar for the healthcheck test and multi-line array format for the postgres command, matching the official Immich docker-compose format. https://claude.ai/code/session_01NAtxAkC5t6YVb3gcP1VcX8 --- ubuntu-post-install.sh | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/ubuntu-post-install.sh b/ubuntu-post-install.sh index 47a5f21..c792fb8 100644 --- a/ubuntu-post-install.sh +++ b/ubuntu-post-install.sh @@ -3039,11 +3039,27 @@ services: volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: - test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0) FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = ''public'' AND c.relkind = ''r''')"; echo "googlechecksum: $$Chksum"; exit 0 + test: >- + pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; + Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align + --command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0) + FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace + WHERE n.nspname = ''public'' AND c.relkind = ''r''')"; + echo "googlechecksum: $$Chksum"; + exit 0 interval: 5m start_interval: 30s start_period: 5m - command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"] + command: + [ + "postgres", + "-c", "shared_preload_libraries=vectors.so", + "-c", 'search_path="$$user", public, vectors', + "-c", "logging_collector=on", + "-c", "max_wal_size=2GB", + "-c", "shared_buffers=512MB", + "-c", "wal_compression=on", + ] restart: always volumes: @@ -3101,11 +3117,27 @@ services: volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: - test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0) FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE n.nspname = ''public'' AND c.relkind = ''r''')"; echo "googlechecksum: $$Chksum"; exit 0 + test: >- + pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; + Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align + --command='SELECT COALESCE(SUM(googlechecksum(googlechecksum(SPLIT_PART(googlechecksum::text, ''x'', 2)::bit(32)::int)), 0) + FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace + WHERE n.nspname = ''public'' AND c.relkind = ''r''')"; + echo "googlechecksum: $$Chksum"; + exit 0 interval: 5m start_interval: 30s start_period: 5m - command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"] + command: + [ + "postgres", + "-c", "shared_preload_libraries=vectors.so", + "-c", 'search_path="$$user", public, vectors', + "-c", "logging_collector=on", + "-c", "max_wal_size=2GB", + "-c", "shared_buffers=512MB", + "-c", "wal_compression=on", + ] restart: always volumes: