Drizzle-kit push:pg not working
I can't run npx drizzle-kit push:pg. I'm using an aws rds database with manage_master_user_password = true.
My drizzle config:
export default {
dbCredentials: {
database: 'ecominatestagingdb',
host: 'ecominate-staging-db.**.us-east-1.rds.amazonaws.com',
port: 5432
},
driver: 'pg',
out: './drizzle',
schema: './src/schema.ts'
} satisfies Config;
npx drizzle-kit push:pg outputs:
drizzle-kit: v0.20.9
drizzle-orm: v0.29.2
No config path provided, using default path
Reading config file '/Users/visiononyeaku/Desktop/Work/rip-technologies/packages/ecominate/database/drizzle.config.ts'
node:internal/process/promises:289
triggerUncaughtException(err, true / fromPromise /);
^
Error: connect ETIMEDOUT 172.31..:5432
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -60,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '172.31...*',
port: 5432
}
Node.js v21.5.0
10 Replies
@Angelelz
This is not my strong suit, drizzle-kit and aws
@Andrew Sherman Can probably help
Hi. I am facing similar problem, @Vision2023. Do you have any evolution about this error timeout? I have same problem, with vercel + neon + drizzle.
I eventually resolved it but I can't remember how sorry. However maybe try sth like ensuring the neon url is valid etc
Thank you for reply. I will search by , I have a strange behavior, after some reloads, sometimes works, appears be intermittent.
when run drizzle studio locally, or when I try run my application
Error: connect ETIMEDOUT 205.251.197.189:5432
After some reloads, sometimes works, appears be intermittent.
In my ENV has:
* pooler.us-east-2.aws.neon.tech/database?sslmode=require
and
import { neon } from '@Neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';
...
const sql = neon(process.env.DATABASE_URL!);
export const db = drizzle(sql, { schema });
export from "drizzle-orm";
Thank you, man. Have a great day!
@Podgorski @Vision2023 Hello! It is related to VPC Security rules
@solo Yhh ur right. I just remembered rn
Thats how I fixed it
Thank you @solo . Could you clarify to me, in my case I use Neon, not AWS environment. I think you told about vision2023 problema, correct?
@Podgorski yes, it was related to aws, but I will also consider your issue. It's a bit strange that the problem is not persistent
In terminal, when I run pnpm studio, after some reloads, appears:
drizzle-kit: v0.20.14
drizzle-orm: v0.29.3
No config path provided, using default path
Reading config file '/home/podgorski/projects/all/project/packages/db/drizzle.config.ts'
Drizzle Studio is up and running on https://local.drizzle.studio
Error: connect ETIMEDOUT 205.251.197.189:5432
at /home/podgorski/projects/all/project/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:24583:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at <anonymous> (/home/podgorski/projects/all/project/nodemodules/.pnpm/[email protected]@[email protected]@[email protected]@[email protected][email protected]/node_modules/src/node-postgres/session.ts:64:19)
at async /home/podgorski/projects/all/project/node_modules/.pnpm/@[email protected]/node_modules/@drizzle-team/studio/index.js:466:24
at async Promise.all (index 9)
at async /home/podgorski/projects/all/project/node_modules/.pnpm/@[email protected]/node_modules/@drizzle-team/studio/server.js:8293:19
at async /home/podgorski/projects/all/project/node_modules/.pnpm/@[email protected]/node_modules/@drizzle-team/studio/server.js:703:9
at async /home/podgorski/projects/all/project/node_modules/.pnpm/@[email protected]/node_modules/@drizzle-team/studio/server.js:6557:7
at async /home/podgorski/projects/all/project/node_modules/.pnpm/@[email protected]/node_modules/@drizzle-team/studio/server.js:5808:62
at async Server.<anonymous> (/home/podgorski/projects/all/project/node_modules/.pnpm/@[email protected]/node_modules/@drizzle-team/studio/server.js:6455:13) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '205.251.197.189',
port: 5432
}
in my env the connection is:
postgresql://:-pooler.us-east-2.aws.neon.tech/auth?sslmode=require&pgbouncer=true
After some reloads the tables appears in drizzle studio