drizzle-kit push fails with neon

I connected drizzle with a neon posgres instance. The connection itself works and i can query data. But when i comes to drizzle-kit and pushing a scheme, i encounter problems. Credentials in drizzle.config.ts are correctly set (i tried both url and manually setting all credential properties). When i run (i use deno btw) deno run -A npm:drizzle-kit push I encounter the following error:
No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/matthias/Documents/repos/[personal]/plightos-demo/drizzle.config.ts'
Using '@neondatabase/serverless' driver for database querying
Warning '@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket
[⣷] Pulling schema from database...
ErrorEvent {
[Symbol(kTarget)]: _WebSocket {
_events: [Object: null prototype] {
error: [Function: onError] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function (anonymous)]
},
message: [Function: onMessage] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function (anonymous)]
},
close: [Function: onClose] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function (anonymous)]
},
open: [Function: onOpen] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function: handleWebSocketOpen]
}
},
_eventsCount: 4,
_maxListeners: undefined,
_binaryType: "arraybuffer",
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: <Buffer >,
_closeTimer: null,
_extensions: {},
_paused: false,
_protocol: "",
_readyState: 3,
_receiver: null,
_sender: null,
_socket: null,
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_autoPong: true,
_url: "wss://ep-cold-river-a280kcyt-pooler.eu-central-1.aws.neon.tech/v2",
_req: null,
[Symbol(kCapture)]: false
},
[Symbol(kType)]: "error",
[Symbol(kError)]: BadResource: Bad resource ID
at node:http:306:27
at HttpsClientRequest._writeHeader (node:http:398:7)
at HttpsClientRequest._flushHeaders (node:_http_outgoing:382:12)
at TLSSocket.onConnect (node:http:444:16)
at TLSSocket.emit (ext:deno_node/_events.mjs:405:35)
at _afterConnect (node:net:159:12)
at _afterConnectMultiple (node:net:214:3)
at TCP.afterConnect (ext:deno_node/internal_binding/connection_wrap.ts:43:11)
at TCP.handle.afterConnect (node:_tls_wrap:157:29)
at eventLoopTick (ext:core/01_core.js:175:7) {
name: "BadResource"
},
[Symbol(kMessage)]: "Bad resource ID"
}
No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/matthias/Documents/repos/[personal]/plightos-demo/drizzle.config.ts'
Using '@neondatabase/serverless' driver for database querying
Warning '@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket
[⣷] Pulling schema from database...
ErrorEvent {
[Symbol(kTarget)]: _WebSocket {
_events: [Object: null prototype] {
error: [Function: onError] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function (anonymous)]
},
message: [Function: onMessage] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function (anonymous)]
},
close: [Function: onClose] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function (anonymous)]
},
open: [Function: onOpen] {
[Symbol(kIsForOnEventAttribute)]: false,
[Symbol(kListener)]: [Function: handleWebSocketOpen]
}
},
_eventsCount: 4,
_maxListeners: undefined,
_binaryType: "arraybuffer",
_closeCode: 1006,
_closeFrameReceived: false,
_closeFrameSent: false,
_closeMessage: <Buffer >,
_closeTimer: null,
_extensions: {},
_paused: false,
_protocol: "",
_readyState: 3,
_receiver: null,
_sender: null,
_socket: null,
_bufferedAmount: 0,
_isServer: false,
_redirects: 0,
_autoPong: true,
_url: "wss://ep-cold-river-a280kcyt-pooler.eu-central-1.aws.neon.tech/v2",
_req: null,
[Symbol(kCapture)]: false
},
[Symbol(kType)]: "error",
[Symbol(kError)]: BadResource: Bad resource ID
at node:http:306:27
at HttpsClientRequest._writeHeader (node:http:398:7)
at HttpsClientRequest._flushHeaders (node:_http_outgoing:382:12)
at TLSSocket.onConnect (node:http:444:16)
at TLSSocket.emit (ext:deno_node/_events.mjs:405:35)
at _afterConnect (node:net:159:12)
at _afterConnectMultiple (node:net:214:3)
at TCP.afterConnect (ext:deno_node/internal_binding/connection_wrap.ts:43:11)
at TCP.handle.afterConnect (node:_tls_wrap:157:29)
at eventLoopTick (ext:core/01_core.js:175:7) {
name: "BadResource"
},
[Symbol(kMessage)]: "Bad resource ID"
}
1 Reply
Matthias
MatthiasOP2mo ago
Ok i solved the problem, it was related to an an bug in an outdated version of Deno i was using, mentioned here https://github.com/denoland/deno/issues/27802 Upgraded Deno and now everything works
GitHub
WebSocket client using npm:ws errors out with Bad resource ID ·...
Issue WebSocket client created using npm:ws errors out when establishing a connection via TLS. Reproducer Server Run this script in Node.js (it's runnable in Deno as well, but let's run it ...

Did you find this page helpful?