fix: route bugsink.esle.fi to the web service #7

Merged
ivuorinen merged 2 commits from fix/web-domain-and-port into main 2026-11-01 20:13:20 +00:00
Owner

Summary

bugsink.esle.fi returns 503 no available server. The web container has
crash-looped since the 2026-10-23 deploy, so Traefik has no router for the host
and Coolify's catch-all router answers instead.

Root cause

Coolify reads SERVICE_URL_<NAME> as a compose service name. The compose file
used SERVICE_URL_BUGSINK, but the service is web:

  • Coolify writes SERVICE_URL_WEB to the deploy's .env, not
    SERVICE_URL_BUGSINK, so BASE_URL=${SERVICE_URL_BUGSINK} rendered empty.
    Bugsink's startup check then fails with bsmain.W003 The BASE_URL setting must be a valid URL and the container exits 1.
  • The _8000 suffix never reached the web domain, so its Traefik router has
    no loadbalancer.server.port label. The image declares no EXPOSE, so
    Traefik would drop the container with port is missing even once it started.

CI stubbed SERVICE_URL_BUGSINK — a variable Coolify never writes — which hid
both failures.

Changes

  • fix: name the domain variable after the web service —
    BASE_URL=${SERVICE_URL_WEB}, and expose: "8000" on web. Coolify 4.5.3
    uses the first expose entry as the routing port for any domain that names
    none, including domains edited in the UI later. CI stub renamed; README
    updated.
  • fix: point the db healthcheck at the real database — pg_isready now
    passes -d ${POSTGRES_DB:-bugsink}. Without it, Postgres logged
    FATAL: database "<user>" does not exist on every 5-second probe, while the
    probe itself still passed.

The credential variables (SERVICE_USER_BUGSINK, SERVICE_PASSWORD_*) are
unchanged: renaming them would generate credentials the existing database
rejects.

Verification

  • Rendered with a .env shaped like Coolify's: before, BASE_URL='' and no
    exposed port; after, BASE_URL=https://bugsink.esle.fi and expose: 8000.
  • docker compose config --quiet with the CI stubs: exit 0, no warnings.
  • Against the live db container: the new probe exits 0, and a 10-probe burst
    logs no FATAL lines (the old form logs 10).
  • actionlint and editorconfig-checker: clean. yamllint and prettier (defaults;
    neither is configured in this repo): no new findings, pre-existing ones
    unchanged.

After merge

Redeploy in Coolify. Expected: web reports Up (healthy), its router labels
include loadbalancer.server.port=8000, and https://bugsink.esle.fi serves
Bugsink.

Optional cleanup in Coolify: the stale SERVICE_URL_BUGSINK* and
SERVICE_FQDN_BUGSINK* environment variables.

## Summary `bugsink.esle.fi` returns `503 no available server`. The `web` container has crash-looped since the 2026-10-23 deploy, so Traefik has no router for the host and Coolify's catch-all router answers instead. ## Root cause Coolify reads `SERVICE_URL_<NAME>` as a compose service name. The compose file used `SERVICE_URL_BUGSINK`, but the service is `web`: - Coolify writes `SERVICE_URL_WEB` to the deploy's `.env`, not `SERVICE_URL_BUGSINK`, so `BASE_URL=${SERVICE_URL_BUGSINK}` rendered empty. Bugsink's startup check then fails with `bsmain.W003 The BASE_URL setting must be a valid URL` and the container exits 1. - The `_8000` suffix never reached the `web` domain, so its Traefik router has no `loadbalancer.server.port` label. The image declares no `EXPOSE`, so Traefik would drop the container with `port is missing` even once it started. CI stubbed `SERVICE_URL_BUGSINK` — a variable Coolify never writes — which hid both failures. ## Changes - **fix: name the domain variable after the web service** — `BASE_URL=${SERVICE_URL_WEB}`, and `expose: "8000"` on `web`. Coolify 4.5.3 uses the first `expose` entry as the routing port for any domain that names none, including domains edited in the UI later. CI stub renamed; README updated. - **fix: point the db healthcheck at the real database** — `pg_isready` now passes `-d ${POSTGRES_DB:-bugsink}`. Without it, Postgres logged `FATAL: database "<user>" does not exist` on every 5-second probe, while the probe itself still passed. The credential variables (`SERVICE_USER_BUGSINK`, `SERVICE_PASSWORD_*`) are unchanged: renaming them would generate credentials the existing database rejects. ## Verification - Rendered with a `.env` shaped like Coolify's: before, `BASE_URL=''` and no exposed port; after, `BASE_URL=https://bugsink.esle.fi` and `expose: 8000`. - `docker compose config --quiet` with the CI stubs: exit 0, no warnings. - Against the live db container: the new probe exits 0, and a 10-probe burst logs no `FATAL` lines (the old form logs 10). - actionlint and editorconfig-checker: clean. yamllint and prettier (defaults; neither is configured in this repo): no new findings, pre-existing ones unchanged. ## After merge Redeploy in Coolify. Expected: `web` reports `Up (healthy)`, its router labels include `loadbalancer.server.port=8000`, and `https://bugsink.esle.fi` serves Bugsink. Optional cleanup in Coolify: the stale `SERVICE_URL_BUGSINK*` and `SERVICE_FQDN_BUGSINK*` environment variables.
Coolify reads SERVICE_URL_<NAME> as a compose service name. With
SERVICE_URL_BUGSINK there is no matching service, so Coolify left it
out of the deploy's .env, BASE_URL rendered empty, and Bugsink's
startup check (bsmain.W003) failed on every boot. The same mismatch
kept port 8000 off the web service's domain, so its router had no
port label.

Reference SERVICE_URL_WEB instead, and expose 8000 on web: Coolify
uses the first expose entry as the port for any domain that names
none, which also covers domains edited in the UI. CI stubbed the
misnamed variable, which hid the bug; it now stubs SERVICE_URL_WEB.
fix: point the db healthcheck at the real database
All checks were successful
validate / compose (push) Successful in 3s
validate / compose (pull_request) Successful in 17s
910f3c382b
Without -d, pg_isready connects to a database named after the user.
None exists, so Postgres logged a FATAL on every 5-second probe. The
probe still passed, so the only effect was a log full of false errors.
ivuorinen deleted branch fix/web-domain-and-port 2026-11-01 20:13:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ivuorinen/coolify-bugsink!7
No description provided.