You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The connection is configured via connection string from the Neon dashboard which requires sslmode.
constpool=newPool({connectionString: 'postgresql://dbauszus:***@ep-curly-base-242741.eu-central-1.aws.neon.tech/neondb?sslmode=require',connectionTimeoutMillis: 5000,dbs: 'NEON',idleTimeoutMillis: 30000,// 5 secondskeepAlive: true,// 30 secondsmax: 20,// Maximum number of clients in the pool});client=awaitpool.connect();
The connection seems to fail when attempting to request the SSL certificate. at Connection.requestSsl (file:///home/dbauszus-glx/xyz_dev/node_modules/pg/lib/connection.js#cjs:121:33)
Below is the full stack log from the terminal.
{
err: Error: Connection terminated due to connection timeout
at eval (/home/dbauszus-glx/xyz_dev/node_modules/pg-pool/index.js:45:11)
at <anonymous> (https://xyzdev-mrwe.w-credentialless-staticblitz.com/blitz.55edb8f4.js:31:28929) {
[cause]: Error: Connection terminated unexpectedly
at Connection.eval (/home/dbauszus-glx/xyz_dev/node_modules/pg/lib/client.js:136:73)
at Object.onceWrapper (node:events:30:8244)
at Connection.emit (node:events:30:11034)
at Socket.eval (/home/dbauszus-glx/xyz_dev/node_modules/pg/lib/connection.js:62:12)
at Socket.emit (node:events:30:11034)
at <anonymous> (node:net:292:3722)
at <anonymous> (https://xyzdev-mrwe.w-credentialless-staticblitz.com/blitz.55edb8f4.js:31:295130)
},
pool: 'NEON',
query: '\n' +
' SELECT\n' +
' id AS id\n' +
' , ST_AsText(geom_3857) AS geometry\n' +
' FROM scratch\n' +
' WHERE TRUE AND geom_3857 IS NOT NULL ;',
retry: 1,
variables: []
}
TypeError: Cannot perform Construct on a detached ArrayBuffer
at new Uint8Array (<anonymous>)
at new FastBuffer (https://xyzdev-mrwe.w-credentialless-staticblitz.com/builtins.97a3df4f.js:55:12767)
at allocate (https://xyzdev-mrwe.w-credentialless-staticblitz.com/builtins.97a3df4f.js:19:5565)
at Buffer.allocUnsafe (https://xyzdev-mrwe.w-credentialless-staticblitz.com/builtins.97a3df4f.js:19:5621)
at Object.requestSsl (file:///home/dbauszus-glx/xyz_dev/node_modules/pg-protocol/dist/serializer.js#cjs:19:29)
at Connection.requestSsl (file:///home/dbauszus-glx/xyz_dev/node_modules/pg/lib/connection.js#cjs:121:33)
at Connection.eval (file:///home/dbauszus-glx/xyz_dev/node_modules/pg/lib/client.js#cjs:123:13)
at Connection.emit (https://xyzdev-mrwe.w-credentialless-staticblitz.com/builtins.97a3df4f.js:30:11034)
at Socket.eval (file:///home/dbauszus-glx/xyz_dev/node_modules/pg/lib/connection.js#cjs:49:12)
at Object.onceWrapper (https://xyzdev-mrwe.w-credentialless-staticblitz.com/builtins.97a3df4f.js:30:8244)
Describe the bug
We are trying to connect the node-pg library to a Neon Postgres database.
We use node-pg version 8.16. https://www.npmjs.com/package/pg
The connection is configured via connection string from the Neon dashboard which requires sslmode.
The connection seems to fail when attempting to request the SSL certificate.
at Connection.requestSsl (file:///home/dbauszus-glx/xyz_dev/node_modules/pg/lib/connection.js#cjs:121:33)
Below is the full stack log from the terminal.
Link to the blitz that caused the error
https://stackblitz.com/~/github.com/dbauszus-glx/xyz_dev?file=.env&layers=true
Steps to reproduce
Unfortunately this can only be reproduced with a valid Neon connection string which I can not share here.
Expected behavior
We would expect the node-pg library to connect to the defined pool with SSL.
Parity with Local
Screenshots
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: