Password authentication failed when trying to run migration postgresql

When i run this command "db:migrate": "tsx src/drizzle/migrate.ts" i get the below error
susant@susants-mint:~/elixer$ npm run db:migrate

> [email protected] db:migrate
> tsx src/drizzle/migrate.ts

node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

PostgresError: password authentication failed for user "susant"
at ErrorResponse (/home/susant/elixer/node_modules/postgres/cjs/src/connection.js:788:26)
at handle (/home/susant/elixer/node_modules/postgres/cjs/src/connection.js:474:6)
at Socket.data (/home/susant/elixer/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:518:28)
at Socket.emit (node:domain:488:12)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
severity_local: 'FATAL',
severity: 'FATAL',
code: '28P01',
file: 'auth.c',
line: '335',
routine: 'auth_failed'
}

Node.js v20.11.1
susant@susants-mint:~/elixer$ npm run db:migrate

> [email protected] db:migrate
> tsx src/drizzle/migrate.ts

node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

PostgresError: password authentication failed for user "susant"
at ErrorResponse (/home/susant/elixer/node_modules/postgres/cjs/src/connection.js:788:26)
at handle (/home/susant/elixer/node_modules/postgres/cjs/src/connection.js:474:6)
at Socket.data (/home/susant/elixer/node_modules/postgres/cjs/src/connection.js:315:9)
at Socket.emit (node:events:518:28)
at Socket.emit (node:domain:488:12)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
severity_local: 'FATAL',
severity: 'FATAL',
code: '28P01',
file: 'auth.c',
line: '335',
routine: 'auth_failed'
}

Node.js v20.11.1
The DB url is DATABASE_URl = "postgresql://susant:susant@localhost:5432/elixer" the user and password is correct as i am using the same credentials in a different project with objection and knex.js and its working fine. I can't figure out the issue here
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server