• v0.24.1 7ef8062409

    v0.24.1 — fail at boot on an unparseable DATABASE_URL
    All checks were successful
    CI / gate (push) Successful in 47s
    CI / image (push) Successful in 16s
    Stable

    joeyr released this 2026-08-06 21:30:37 -05:00 | 95 commits to main since this release

    Fixed

    A DATABASE_URL that Postgres cannot parse now fails at boot, naming the cause.

    Both Swarm stack entries build their DSN by interpolating a password into a URL, and a password holding a literal /, # or ? ends the authority early — the port becomes a non-numeric string and the URL is rejected. The config only asked for a non-empty string, so it loaded clean and the API started, then died on its first query four frames inside pg:

    ERR fatal | error=TypeError: Invalid URL
        at parse (/app/node_modules/pg-connection-string/index.js:30)
        at ApiStore.assertSchema (file:///app/dist/src/api/store.js:73)
    

    Nothing in that names the variable at fault or the reason, and the stack points at library code.

    DATABASE_URL is now validated in both loadConfig and loadApiConfig against pg own parser rather than a new URL lookalike — the question worth answering is whether new Pool() will accept the string, and a check that can drift from the real one is not that question.

    Two things beyond it parsed are also required, because parse cannot fail on a stray word: it resolves relative strings against a base URL, so x comes back as host base. A scheme is what distinguishes a DSN, and a non-empty host is what distinguishes postgres:///db, which parses fine and then fails as a refused connection. Both unix-socket forms still pass.

    The message names the variable and the offending characters and never quotes the DSN, which carries the password inline.

    pg-connection-string moves from a transitive dependency of pg to a declared one, since it is now imported directly. It adds no install weight.

    Downloads