TORNADO ZW
TORNADO ZW

Reputation: 1

Getting an error connecting to a Postgres DB from Fedora but runs well on Windows & Gitpod

I am a newbie in fedora, i was folowing the nextjs learn tutorial and when i was running on windows, everything was working well but when i started the development on fedora i cant connect to the database, i did a test with gitpod the db connected ok, but locally its giving errors, its the vercel db, this is the error


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 fetchRevenue (webpack-internal:///(rsc)/./app/lib/data.ts:30:22)
    at async Page (webpack-internal:///(rsc)/./app/dashboard/page.tsx:19:21) {
  code: null,
  sourceError: TypeError: fetch failed
      at node:internal/deps/undici/undici:12618:11
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    cause: AggregateError [ETIMEDOUT]: 
        at internalConnectMultiple (node:net:1116:18)
        at internalConnectMultiple (node:net:1184:5)
        at Timeout.internalConnectMultipleTimeout (node:net:1710:5)
        at listOnTimeout (node:internal/timers:575:11)
        at process.processTimers (node:internal/timers:514:7) {
      code: 'ETIMEDOUT',
      [errors]: [Array]
    }
  }
}
 ⨯ app/lib/data.ts (33:10) @ fetchRevenue
 ⨯ Error: Failed to fetch revenue data.
    at fetchRevenue (./app/lib/data.ts:35:15)
    at async Page (./app/dashboard/page.tsx:19:21)
  31 |   } catch (error) {
  32 |     console.error('Database Error:', error);
> 33 |     throw new Error('Failed to fetch revenue data.');
     |          ^
  34 |   }
  35 | }
  36 |
 ⨯ app/lib/data.ts (33:10) @ fetchRevenue
 ⨯ Error: Failed to fetch revenue data.
    at fetchRevenue (./app/lib/data.ts:35:15)
    at async Page (./app/dashboard/page.tsx:19:21)
digest: "1123824755"
  31 |   } catch (error) {
  32 |     console.error('Database Error:', error);
> 33 |     throw new Error('Failed to fetch revenue data.');
     |          ^
  34 |   }
  35 | }

i tried installing the postgreSQL driver on fedora and started the process but nothing changes,

Upvotes: 0

Views: 563

Answers (1)

HERACRAFT
HERACRAFT

Reputation: 21

I had the same exact problem.

I solved the issue by downgrading to v18.12.0.

I was on ArchLinux, using node v22.4.0-latest. Running the code in a codespace worked just fine.

Upvotes: 0

Related Questions