From 12049a0f35592df4eb36cf6b53c1f504424ff987 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Wed, 24 Jun 2026 13:18:32 +0200 Subject: [PATCH] fix(infra): nrc-init runs migrations only, not setup_configuration (refs #30) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With OpenZaak now coming up, nrc-init ran for the first time and failed: nrc-init-1 | CommandError: No steps enabled, aborting. NRC's setup_configuration/data.yaml is intentionally empty ({}) — the OZ<->NRC wiring is deferred to S-06 — but /setup_configuration.sh runs `manage.py setup_configuration` regardless, and NRC 1.16.1 aborts when no steps are enabled. (This was masked until now: oz-init failed first, so openzaak never became healthy and nrc-init, which waits on it, never ran.) The documented intent is "init runs migrations only", so nrc-init now runs `manage.py migrate` directly instead of /setup_configuration.sh, and the dead RUN_SETUP_CONFIG env is dropped from the NRC services. nrc-web still migrates + creates the superuser itself via /start.sh. Also: - Makefile: bump compose `--wait-timeout` 300 -> 420. The serial oz-db -> oz-init -> openzaak(healthy) -> nrc-init -> nrc-web(healthy) chain runs ~260 s on the runner; 420 s gives comfortable headroom. - ci.yaml: widen the on-failure log dump to oz-init, openzaak, nrc-init, nrc-web, flowable-init, keycloak, acl, bff for full diagnosability. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/ci.yaml | 2 +- Makefile | 2 +- infra/docker-compose.yml | 7 +++++-- infra/opennotificaties/docker-compose.yml | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 39f0115..6774463 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -50,7 +50,7 @@ jobs: - run: make smoke - name: dump container logs on failure if: failure() - run: docker compose -f infra/docker-compose.yml logs --no-color --tail=100 oz-init nrc-init acl bff 2>&1 || true + run: docker compose -f infra/docker-compose.yml logs --no-color --tail=80 oz-init openzaak nrc-init nrc-web flowable-init keycloak acl bff 2>&1 || true - name: tear down on failure if: failure() run: docker compose -f infra/docker-compose.yml down --volumes 2>&1 || true diff --git a/Makefile b/Makefile index 6e60f21..859716c 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ unit: ## smoke: compose up (wait for healthy), curl /health, then tear down smoke: - docker compose -f $(COMPOSE) up -d --build --wait --wait-timeout 300 + docker compose -f $(COMPOSE) up -d --build --wait --wait-timeout 420 bash -c 'curl -fsS $(HEALTH_URL); rc=$$?; docker compose -f $(COMPOSE) down --volumes; exit $$rc' ## down: stop and remove the local stack diff --git a/infra/docker-compose.yml b/infra/docker-compose.yml index ac94a62..9a3fbe5 100644 --- a/infra/docker-compose.yml +++ b/infra/docker-compose.yml @@ -150,8 +150,11 @@ services: OPENNOTIFICATIES_SUPERUSER_USERNAME: admin DJANGO_SUPERUSER_PASSWORD: admin OPENNOTIFICATIES_SUPERUSER_EMAIL: admin@localhost - RUN_SETUP_CONFIG: "true" - command: /setup_configuration.sh + # Migrations only for now. No setup_configuration steps are enabled yet (the + # OZ<->NRC notification wiring lands in S-06), and NRC's `setup_configuration` + # aborts with "No steps enabled" on the empty data.yaml — so we run `migrate` + # directly instead of /setup_configuration.sh. See data.yaml and ADR-0002. + command: ["sh", "-c", "/wait_for_db.sh && OTEL_SDK_DISABLED=True python src/manage.py migrate"] depends_on: nrc-db: condition: service_healthy diff --git a/infra/opennotificaties/docker-compose.yml b/infra/opennotificaties/docker-compose.yml index d0b2836..d2b8986 100644 --- a/infra/opennotificaties/docker-compose.yml +++ b/infra/opennotificaties/docker-compose.yml @@ -56,8 +56,11 @@ services: OPENNOTIFICATIES_SUPERUSER_USERNAME: admin DJANGO_SUPERUSER_PASSWORD: admin OPENNOTIFICATIES_SUPERUSER_EMAIL: admin@localhost - RUN_SETUP_CONFIG: "true" - command: /setup_configuration.sh + # Migrations only for now. No setup_configuration steps are enabled yet (the + # OZ<->NRC notification wiring lands in S-06), and NRC's `setup_configuration` + # aborts with "No steps enabled" on the empty data.yaml — so we run `migrate` + # directly instead of /setup_configuration.sh. See data.yaml and ADR-0002. + command: ["sh", "-c", "/wait_for_db.sh && OTEL_SDK_DISABLED=True python src/manage.py migrate"] depends_on: nrc-db: condition: service_healthy