vercel / storage

Vercel Postgres, KV, Blob, and Edge Config
https://vercel.com/storage
Apache License 2.0
514 stars 57 forks source link

Error connecting to database #502

Closed mmeqbel-wiley closed 11 months ago

mmeqbel-wiley commented 11 months ago

I am trying to follow-up with https://nextjs.org/learn/dashboard-app, I got this error sometimes. I tried to increase the time-out but it didn't work

Database Error: NeonDbError: Error connecting to database: fetch failed
    at execute (webpack-internal:///(rsc)/./node_modules/@neondatabase/serverless/index.js:4689:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 2)
    at async fetchCardData (webpack-internal:///(rsc)/./app/lib/data.ts:68:22)
    at async Page (webpack-internal:///(rsc)/./app/dashboard/page.tsx:21:94) {
  code: null,
  sourceError: TypeError: fetch failed
      at node:internal/deps/undici/undici:11754:11
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    cause: ConnectTimeoutError: Connect Timeout Error
        at onConnectTimeout (node:internal/deps/undici/undici:6893:28)
        at node:internal/deps/undici/undici:6849:50
        at Immediate._onImmediate (node:internal/deps/undici/undici:6881:13)
        at process.processImmediate (node:internal/timers:478:21)
        at process.callbackTrampoline (node:internal/async_hooks:130:17) {
      code: 'UND_ERR_CONNECT_TIMEOUT'
    }
  }
}
adriancooney commented 11 months ago

Hi @mmeqbel-wiley! Thanks for the report. Can you share a reproduction in code with us (e.g. a Github repo)? Without a reproduction, there isn't much we can do here because there can be many causes for this error.

mmeqbel-wiley commented 11 months ago

Hi @mmeqbel-wiley! Thanks for the report. Can you share a reproduction in code with us (e.g. a Github repo)? Without a reproduction, there isn't much we can do here because there can be many causes for this error.

sure, here is it: https://github.com/mmeqbel-wiley/nextjs-dashboard you need .env file though!

adriancooney commented 11 months ago

you need .env file though!

Yep, indeed it will be difficult to debug without connecting to your database (please do not share your env file!). I think opening a support case with Vercel Support might be the best option here - it will allow us to look at your project and resources (with your permission of course). If there is an issue with the @vercel/postgres client, we can open one here. Given that I don't see any obvious issue with the client here, I'm going to close this issue out.