Does Hyperdrive support connecting *from* non-Cloudflare services (e.g. from Fly.io)? Because it see

Does Hyperdrive support connecting from non-Cloudflare services (e.g. from Fly.io)? Because it seems that changes from CF Workers through Hyperdrive is not propagated immediately to the "bare" DB, so my service in Fly.io that connects directly doesn't see it yet
15 Replies
VIO
VIOā€¢4w ago
Hello there, I have a postgres db setup on a machine, a CF tunnel pointing to that db, and Acces service auth setup above all, is there a way to get the connection string by API and simply use that in a nodejs project?
okku
okkuā€¢4w ago
Hi, has anyone been experiencing caching problem on hyperdrive? My website cannot connect to a database when connecting through hyperdrive. It looks like it is resolved for 5-10 mins after either switching on and off the caching. Metrics reads fine, and it can connect to the database with cache and without cache, but it only works for 5-10 mins on both cases.
Nick
Nickā€¢4w ago
I try to setup Hyperdrive with a tunnel. Followed all the steps 3 times but get this error: "Failed to connect to database using the provided information: Internal error." - On the server "cloudflared tail --level debug" and in the dashboards 'Access authentication logs' i dont see anything happen. - Tunnel status on dashboard says "Healthy". - Everytime i try to setup it up in Application > Policies a policy is automaticly created. - First time I run "cloudflared tail --level debug" i got the error "Cannot determine default origin certificate path." which i fixed with this
thomasgauvin
thomasgauvinā€¢4w ago
šŸ“¢ Hyperdrive update: 2024-10-30: New Hyperdrive configurations to private databases using Tunnels are validated before creation to make it easier to troubleshoot connectivity issues https://developers.cloudflare.com/hyperdrive/platform/changelog/#2024-10-30
SteffTek
SteffTekā€¢3w ago
Hey guys! I have a small problem with hyperdrive. I want to test it with a local postgres instance in docker, to which I can connect without problems, but my worker script says it's failing to authenticate due to bad password. Same connection string works with drizzle for migrations
AJR
AJRā€¢3w ago
Interesting. Same connection string works in hyperdrive? What username and password did you provide when making your Hyperdrive? I wonder if there was some shell escaping or something that caused it to not have your DB password stored correctly?
SteffTek
SteffTekā€¢3w ago
yeah sorry im just incredibly stupid. the db controller that fires first somehow still had the old d1 object as param and typescript screamed at me and i just ignored it...
AJR
AJRā€¢3w ago
Heh. Happens to the best of us. Good luck!
DoggeSlapper
DoggeSlapperā€¢3w ago
I'm trying to use hyperdrive with neon drizzle & postgresjs but I'm getting
āœ˜ [ERROR] Uncaught (async) Error: write CONNECT_TIMEOUT 2a4a9d73ee44058fe7577f3b613e1ae9.hyperdrive.local:5432
āœ˜ [ERROR] Uncaught (async) Error: write CONNECT_TIMEOUT 2a4a9d73ee44058fe7577f3b613e1ae9.hyperdrive.local:5432
I been trying pg & postgresjs but cant manage to cconnect I have reduced to:
const sql = postgres(env.HYPERDRIVE.connectionString, { ssl: true });
const result = await sql`SELECT * FROM pg_tables;`;
console.log(result);
const sql = postgres(env.HYPERDRIVE.connectionString, { ssl: true });
const result = await sql`SELECT * FROM pg_tables;`;
console.log(result);
Without SSL true I get
āœ˜ [ERROR] Uncaught (in promise) PostgresError: connection is insecure (try using `sslmode=require`)
āœ˜ [ERROR] Uncaught (in promise) PostgresError: connection is insecure (try using `sslmode=require`)
AJR
AJRā€¢3w ago
Is your database configured with ssl=on?
DoggeSlapper
DoggeSlapperā€¢3w ago
When I have it enabled I get timeout error
Uncaught (in promise) Error: write CONNECT_TIMEOUT f86bad4f8437b66de3bf8efae5264dd3.hyperdrive.local:5432
Uncaught (in promise) Error: write CONNECT_TIMEOUT f86bad4f8437b66de3bf8efae5264dd3.hyperdrive.local:5432
AJR
AJRā€¢3w ago
SSL is required to be configured for databases Hyperdrive connects to.
DoggeSlapper
DoggeSlapperā€¢3w ago
it's ?sslmode=require I'm trying to use neon with hyperdrive from local
AJR
AJRā€¢3w ago
That's the client-side request mode. Is the database itself set up with SSL?
DoggeSlapper
DoggeSlapperā€¢3w ago
afaik neon uses ssl right?
export WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE= my connection string
pnpm run dev
export WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE= my connection string
pnpm run dev
With ssl I get TIMEOUT
Want results from more Discord servers?
Add your server