Wrangler Local Dev Broken

Ah, 3.84.1 works locally? Does it cooperate with local dev against a remote connection string?
25 Replies
AJR
AJROP13mo ago
Moving this to a thread so I can keep things straight
alex (he/him)
alex (he/him)13mo ago
3.84.1 works with localhost db but with remote neon db it does show
{"DB":{"connectionString":"postgresql://repguide_owner:XXX@bfa6001c99d06d2a8c5936d7aa551dac.hyperdrive.local:5432/repguide?sslmode=disable","port":5432,"host":"bfa6001c99d06d2a8c5936d7aa551dac.hyperdrive.local","password":"XXX","user":"repguide_owner","database":"repguide"}}
✘ [ERROR] Uncaught (in promise) PostgresError: connection is insecure (try using `sslmode=require`)

at ErrorResponse
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/src/connection.js:790:26)
at handle
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/src/connection.js:475:7)
at data
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/src/connection.js:317:9)
at emit (node-internal:events:307:32)
at read
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/polyfills.js:202:13)
{"DB":{"connectionString":"postgresql://repguide_owner:XXX@bfa6001c99d06d2a8c5936d7aa551dac.hyperdrive.local:5432/repguide?sslmode=disable","port":5432,"host":"bfa6001c99d06d2a8c5936d7aa551dac.hyperdrive.local","password":"XXX","user":"repguide_owner","database":"repguide"}}
✘ [ERROR] Uncaught (in promise) PostgresError: connection is insecure (try using `sslmode=require`)

at ErrorResponse
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/src/connection.js:790:26)
at handle
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/src/connection.js:475:7)
at data
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/src/connection.js:317:9)
at emit (node-internal:events:307:32)
at read
(file:///Users/alexanderniebuhr/Developer/Projects/frickegroup/workers/node_modules/.pnpm/postgres@3.4.5/node_modules/postgres/cf/polyfills.js:202:13)
Even if my connectionString is WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_DB="postgresql://repguide_owner:XXX@ep-winter-sunset-a2xrhmv9.eu-central-1.aws.neon.tech/repguide?sslmode=require" So it doesn't take sslmode I set into consideration
AJR
AJROP13mo ago
No, workerd interpolates. I wonder if this is the workerd change, then.
alex (he/him)
alex (he/him)13mo ago
Correction, 3.85.0 also works, but only with localhost So it seems like > 3.86.0 breaks Okay so my guess <= 3.85.0 only works with localhost connectionString >= 3.86.0 doesn't work with any connectionString -> timeouts
Slylencer
Slylencer13mo ago
Can confirm 3.85.0 works locally for me as well
AJR
AJROP13mo ago
I've messaged the team, and we'll take a look. Thank you.
alex (he/him)
alex (he/him)13mo ago
Thanks for taking a look so quick. And glad to hear that the intended behavior is, that even remote connection strings should be supported, so we can use solutions like Neon for development 🙂
thomasgauvin
thomasgauvin13mo ago
Definitely, we want you to be able to use remote db's for dev, we added this a few versions ago @alex (he/him) @Slylencer while we investigate local dev, just making sure you're unblocked since npx wrangler dev --remote is working
alex (he/him)
alex (he/him)13mo ago
For me not really. We have an architecture with multiple workers connected with service bindings to use RPC calls, that doesn't seem to work if we use --remote, since it doesn't find the scripts anymore
Slylencer
Slylencer13mo ago
I'm fine
alex (he/him)
alex (he/him)13mo ago
AJR
AJROP13mo ago
Good catch. I've already opened up a revert to get us back to the prior state (https://github.com/cloudflare/workerd/pull/3148). We'll take another run at it working with remote DBs when we can.
GitHub
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
From An unknown user
From An unknown user
From An unknown user
alex (he/him)
alex (he/him)13mo ago
So this brings us back to the <= 3.85.0 behavior, which didn’t support remote db's for devs?
AJR
AJROP13mo ago
For the time being, yes
piffie
piffie12mo ago
also same issue for me - 3.85 works.
alex (he/him)
alex (he/him)12mo ago
@AJR I know that’s hard to tell. But any ETA when to expect the reimplementation of the remote db support. I’m in the middle of migration a clients full backend architecture to CF. And it is planned to be finished by end of December. Would be great to at least be able to tell the client when it will work with remote db.
AJR
AJROP12mo ago
It's not something I anticipate having cycles to tackle in December. I'd say, likely, it's something we'll try to fit into Q1. I can't promise anything here though, will need to coordinate with product a bit. The original behavior, with local dev on local DBs, will be restored with the next workerd release
AJR
AJROP12mo ago
@elithrar This restores local support. It does not add remote DB support, as most remote DB options do not work with sslmode=disable
Matt Silverlock
Matt Silverlock12mo ago
Yes sorry - this is just the local only fix (The title of this thread was local dev)
alex (he/him)
alex (he/him)12mo ago
Understood.. we really need remote db support though
thomasgauvin
thomasgauvin12mo ago
Thanks @alex (he/him) . We do intend to support this, and it's something we're investigating. For the time being, are you unblocked if you toggle between your direct connection string and the hyperdrive connection string based on if you are in local dev vs production env?
alex (he/him)
alex (he/him)12mo ago
Thanks for asking. Our client driver settings are a bit different between Hyperdrive and direct connection string, e.g. conneting to Hyperdrive doesn't support ssl enabled, so we would need to add more conditional logic. But we can investigate this for sure, if the support will take a longer time to implement
thomasgauvin
thomasgauvin12mo ago
It will take some time to implement and we can't confidently give out a timeline at this time
alex (he/him)
alex (he/him)6mo ago
Okay then we will need to investigate a workaround @thomasgauvin @AJR @Matt Silverlock sorry for the ping.. I was just getting back to this, and it seems that it is still not fixed, to be able to use a remote connection string with WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_DB. Any updates from your side?

Did you find this page helpful?