I have a new NeonDbError "password authentication failed for user 'xxxx'" error when using Pool
Previously, my code seemed to be working fine until I switched to creating the database client as a Pool. The neon connection string is created in CI and passed into the server environment automatically, and this is the first time I'm seeing this error.
Is it known to be flakey/slow at creating connection strings that immediately start working? Or is there a difference between http vs websocket vs pool clients in Drizzle?
I can provide more details on the setup and everything, but I wanted to ask here first
9 Replies
typical-coralOP•15mo ago
gh-actions creates the neon branch + creates the connection string, then the server is deployed into a Cloudflare Pages worker which has been working well thus far. I am restarting all the jobs to see if it goes away on its own
xenial-black•15mo ago
Hi Cole, sorry to hear about your troubles with connecting to new branches.
New branches take about 1 sec to be operational. You can always use the API and check operations to make sure a branch is ready to be queried.
Do you see -pooler in the new connection string by any chance?
typical-coralOP•15mo ago
@raoufchebri - yes, the connection string that gets created in CI is like
***ep-square-dust-a41k8mau-pooler.us-east-1.aws.neon.tech/phosphor_db?sslmode=require
This connection string does work for the initial migrations task (each branch performs migrations)
My setup is kinda custom, but you can see how it is able to use that connection string for the initial drizzle migrations.
Hmm, it looks like it might be connecting again, but I'm having a general issue where the @neon/serverless is not closing the Cloudflare worker. It seems that something is being left opened when I use the websocket client instead of http.typical-coralOP•15mo ago
Reading through https://github.com/drizzle-team/drizzle-orm/issues/619 and removing my usage of Pool, calling connect(), & making sure to close the client completely all seemed to solve my other issue. I will report back if I see the issue with password authentication again
GitHub
[BUG]: Running drizzle for Neon on Cloudflare Workers: A hanging Pr...
What version of drizzle-orm are you using? 0.26.00 What version of drizzle-kit are you using? 0.18.0 Describe the Bug I run wrangler dev, or wrangler dev --remote to run the application. When makin...
xenial-black•15mo ago
Any chance your main branch is protected? You can check on the branches page
xenial-black•15mo ago
Neon
Protected branches - Neon Docs
Neon's protected branches feature implements a series of protections Protected branches cannot be deleted. Protected branches cannot be reset. Projects with protected branches cannot be deleted. Compu...
xenial-black•15mo ago
Are you also using password as secret and manually construct the connection string? or pulling connection string directly from the API call response?
typical-coralOP•15mo ago
I was pulling the full connection string from the API call. I will have to see if it comes up again
xenial-black•15mo ago
has the problem disappeared? It works again?
Mmm, if you're pulling the connection string with the password then it's strange that you cannot access.
One explanation is the operation is taking a little longer to execute. Therefore you might to check that the database is operation via the API:
Example output:
And you check
current_state object