Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to use squirrel with Vercel Postgres #32

Open
JosephTLyons opened this issue Oct 9, 2024 · 2 comments
Open

Error when trying to use squirrel with Vercel Postgres #32

JosephTLyons opened this issue Oct 9, 2024 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JosephTLyons
Copy link

  1. I set an env var via: export DATABASE_URL=postgres://[USERNAME]:[PASSWORD]@[HOST]:[PORT]/[DATABASE_NAME]?sslmode=require
  2. I ran gleam run -m squirrel
  3. I got this output
Error: Cannot authenticate (no-method)

I ran into an unexpected problem while trying to authenticate with
the Postgres server. This is most definitely a bug!

Please open an issue at
https://github.com/giacomocavalieri/squirrel/issues/new
with some details about what you where doing, including the
following message:
  Expected: AuthMethod, Got: BeErrorResponse(Set(dict.from_list([#(Code("XX000"), []), #(Message("connection is insecure (try using `sslmode=require`)"), []), #(Severity("ERROR"), [])])))

I'm trying to connect to a Vercel Postgres - maybe that's the issue?

@giacomocavalieri
Copy link
Owner

Hello! From the error message it looks like I'm not properly handling the ssl connection that the Vercel Postgres server wants, I'll look into this :)

@giacomocavalieri giacomocavalieri added bug Something isn't working help wanted Extra attention is needed labels Oct 18, 2024
@dandeduck
Copy link

dandeduck commented Dec 13, 2024

@giacomocavalieri Hey, I ran into the same problem but I think it's a bug on pog that might not be properly interpreting the sslmode=require query param. When using the same connection string with it I'm getting the same error message unless I add .ssl(true) manually to the config like so:

  use config <- result.try(pog.url_config(url))
  config
  |> pog.ssl(True)
  |> pog.connect
  |> Ok

So maybe we should open a bug there?

Edit: Just noticed this PR should be fixing this issue. yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants