Solution skill
Timeout instead of error if the user did not configure the database URL
Complete solution
Serverless: timeout instead of error if the user did not configure the database URL. The verified fix is Fix: Anyone who genuinely wants the defaults can explicitly set `host`, `connectionString`, or `PGHOST`. Use this when you hit the symptoms above in serverless; not for unrelated serverless errors or general setup questions.
TL;DR
Fix: Anyone who genuinely wants the defaults can explicitly set host, connectionString, or PGHOST.
The error
Issue neondatabase/serverless#30 (closed, 10 comments): @skyzh's report:
The serverless driver will timeout instead of reporting any error if the user did not configure the database URL. It seems that the driver will try connecting to YOUR_HOST:5432 if the database URL is not configured, and it will timeout. This looks like the default behavior for pg library but I don’t think it makes sense if people are using the serverless driver as they are always connecting to an external provider? I feel it would be better to give a warning / throw an error in the serverless driver in case that the database endpoint is not configured?Fix
- Anyone who genuinely wants the defaults can explicitly set
host,connectionString, orPGHOST.
Success check: the symptom above is gone and the original operation completes.
When to use
- You hit this exact symptom in serverless.
- You want the verified fix without digging through the thread.
When not to use
- A different error in serverless, even a similar-looking one.
- General serverless setup or credential questions.
Compatibility
- Serverless (neondatabase/serverless)
Variant phrasings
- How to fix "timeout instead of error if the user did not configure the database URL" in serverless
- serverless: timeout instead of error if the user did not configure the database URL
- timeout instead of problem if the user did not configure the database URL
Edge cases
- [jawj (maintainer)]: As of driver 0.5.2, the driver throws an error when it detects default connection parameters (missing DATABASEURL / host), instead of hanging until the edge function times out (EDGEFUNCTIONINVOCATIONTIMEOUT with no useful logs).
Source
- https://github.com/neondatabase/serverless/issues/30
Evidence
Asked in gh:neondatabase/serverless#30 (https://github.com/neondatabase/serverless/issues/30): Timeout instead of error if the user did not configure the database URL. The issue report: Issue neondatabase/serverless#30 (closed, 10 comments): @skyzh's report:
The serverless driver will timeout instead of reporting any error if the user did not configure the database URL. It seems that the driver will try connecting to YOURHOST:5432 if the database URL is not configured, and it will timeout. This looks like the default behavior for pg library but I don’t think it makes sense if people are using the serverless driver as they are always connecting to an external provider? I feel it would be better to give a warning / throw an error in the serverless driver in case that the database endpoint is not configured? The verified answer: [jawj (maintainer)]: As of driver 0.5.2, the driver throws an error when it detects default connection parameters (missing DATABASEURL / host), instead of hanging until the edge function times out (EDGEFUNCTIONINVOCATION_TIMEOUT with no useful logs). Reporter confirmed it now fails fast. Anyone who genuinely wants the defaults can explicitly set host, connectionString, or PGHOST.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_D7dy9KArDaWdu6ZgNNKvmA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Timeout instead of error if the user did not configure the database URL <span>— Vectle</span></a>