diff --git a/apps/base/osint/README.md b/apps/base/osint/README.md index eb44b51..a3f838d 100644 --- a/apps/base/osint/README.md +++ b/apps/base/osint/README.md @@ -8,7 +8,7 @@ instead of a host Docker container on the Pi. | Deployment | Image | Purpose | |---|---|---| -| `osint-db` | `forgejo…/sirius/osint-dashboard-pg:amd64-c48788d4b614-r2` | TimescaleDB 2 + PostGIS 3 on Postgres 16, `local-path` PVC `osint-pgdata` 15 Gi | +| `osint-db` | `forgejo…/sirius/osint-dashboard-pg:amd64-c48788d4b614-r3` | TimescaleDB 2.32.1 + PostGIS 3 on Postgres 16.16, `local-path-linode` PVC `osint-pgdata-linode` 15 Gi | | `osint-nats` | `forgejo…/sirius/nats:2.10` | JetStream event bus (`-js -m 8222`) | | `osint-app` | `forgejo…/sirius/osint-dashboard:amd64-915f6cbe25be` | FastAPI + static HUD; runs `alembic upgrade heads` on start; single-admin auth (`app/auth.py`) — public read-only site, admin-only keys/settings/mutations | | `osint-ingester` | same app image | RSS/GDELT/USGS/FIRMS/vessel ingest → NATS → Postgres | @@ -56,13 +56,23 @@ docker build -f pg-image/Dockerfile -t 127.0.0.1:3000/sirius/osint-das ``` `pg-image/Dockerfile` is the cluster copy of `Dockerfile.pg`. **It pins -`postgres:16-bookworm`**: the upstream file's bare `postgres:16` now resolves to -Debian trixie, whose `postgresql-16-postgis-3` (3.7.0+pgdg13) fails to load +`postgres:16.16-bookworm`**: the upstream file's bare `postgres:16` now resolves +to Debian trixie, whose `postgresql-16-postgis-3` (3.7.0+pgdg13) fails to load against PG 16.15 with `undefined symbol: heap_datum_check` — `CREATE EXTENSION postgis` crashes the server. On bookworm (`+pgdg12`) PostGIS 3.7 loads and `create_hypertable()` works. Port the one-line base-image pin upstream when the Pi stack is next rebuilt. +It also pins the TimescaleDB packages to `2.32.1~debian12-1616` (the `-1616` +suffix = built against PG 16.16) and the base image to the 16.16 minor. PG +16.16 added the `PortalDrop()` "cannot drop portal while it is being set up" +check that TimescaleDB <=2.32.0 trips in its background-worker path, so every +policy job failed with SQLSTATE 24000 while `CALL run_job()` worked +(timescale/timescaledb#11038, fixed in 2.31.2/2.32.1). Never unpin either half: +a pg minor bump without a matching TimescaleDB build reintroduces the failure. +`-r3` is that build. After a pod recreate the extension itself still has to be +moved: `ALTER EXTENSION timescaledb UPDATE TO '2.32.1'`. + ## Secrets (never in git) ```bash diff --git a/apps/base/osint/pg-image/Dockerfile b/apps/base/osint/pg-image/Dockerfile index faa014e..fa7acbc 100644 --- a/apps/base/osint/pg-image/Dockerfile +++ b/apps/base/osint/pg-image/Dockerfile @@ -1,19 +1,32 @@ # Cluster build of the OSINT Postgres image (amd64). # # Identical to `Dockerfile.pg` in sirius/osint-dashboard EXCEPT the base image -# is pinned to bookworm. The upstream `FROM postgres:16` now resolves to Debian -# trixie, where postgresql-16-postgis-3 (3.7.0+pgdg13) fails to load against -# PostgreSQL 16.15: +# is pinned to Debian bookworm AND to the 16.16 minor. The upstream file's bare +# `FROM postgres:16` now resolves to Debian trixie, where +# postgresql-16-postgis-3 (3.7.0+pgdg13) fails to load against PostgreSQL 16.15: # could not load library "/usr/lib/postgresql/16/lib/postgis-3.so": # undefined symbol: heap_datum_check # On bookworm (+pgdg12) both extensions load and create_hypertable() works. -FROM postgres:16-bookworm +# +# PostgreSQL minor and the TimescaleDB package build MUST match. TimescaleDB +# publishes one .so per PG minor (the packagecloud suffix `-1616` means built +# against 16.16). PostgreSQL 16.16/17.12/18.7 added the PortalDrop() "while it +# is being set up" check, which the <=2.32.0 background scheduler trips on, so +# every policy job fails with `cannot drop portal ""` (timescale#11038, fixed +# in 2.32.1). Both halves are pinned here so a rebuild cannot silently drift +# back onto a mismatched pair. +# +# Resulting versions: PostgreSQL 16.16, postgis 3.7.0, timescaledb 2.32.1. +# After a pod recreate run `ALTER EXTENSION timescaledb UPDATE TO '2.32.1'`. +FROM postgres:16.16-bookworm RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl gnupg lsb-release && \ curl -fsSL https://packagecloud.io/install/repositories/timescale/timescaledb/script.deb.sh | bash && \ apt-get update && apt-get install -y --no-install-recommends \ - postgresql-16-postgis-3 timescaledb-2-postgresql-16 && \ + postgresql-16-postgis-3 \ + timescaledb-2-postgresql-16=2.32.1~debian12-1616 \ + timescaledb-2-loader-postgresql-16=2.32.1~debian12-1616 && \ mkdir -p /etc/postgresql/16/main/conf.d && \ echo "shared_preload_libraries = 'timescaledb'" > /etc/postgresql/16/main/conf.d/timescaledb.conf && \ rm -rf /var/lib/apt/lists/* diff --git a/apps/base/osint/postgres-deployment.yaml b/apps/base/osint/postgres-deployment.yaml index 2c84ab7..3f37a54 100644 --- a/apps/base/osint/postgres-deployment.yaml +++ b/apps/base/osint/postgres-deployment.yaml @@ -43,7 +43,7 @@ spec: - linode containers: - name: postgres - image: forgejo.siriusdevops.com/sirius/osint-dashboard-pg:amd64-c48788d4b614-r2 + image: forgejo.siriusdevops.com/sirius/osint-dashboard-pg:amd64-c48788d4b614-r3 imagePullPolicy: IfNotPresent args: - -c