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

die on "fe_sendauth: no password supplied" #2801

Closed
steve-chavez opened this issue May 24, 2023 · 1 comment · Fixed by #2813
Closed

die on "fe_sendauth: no password supplied" #2801

steve-chavez opened this issue May 24, 2023 · 1 comment · Fixed by #2813
Labels

Comments

@steve-chavez
Copy link
Member

Problem

We keep retrying the connection when we get a fe_sendauth: no password supplied.

image

Reported on gitter.

Solution

Die when the above error happens. Should be done here:

checkIsFatal :: SQL.UsageError -> Maybe Text
checkIsFatal (SQL.ConnectionUsageError e)
| isAuthFailureMessage = Just $ toS failureMessage
| otherwise = Nothing
where isAuthFailureMessage = "FATAL: password authentication failed" `isInfixOf` failureMessage
failureMessage = BS.unpack $ fromMaybe mempty e

@steve-chavez
Copy link
Member Author

If you have a local database(besides the nix one), this can be reproduced with:

PGHOST="localhost" postgrest-run

06/Jun/2023:14:19:49 -0500: Attempting to connect to the database...
06/Jun/2023:14:19:49 -0500: {"code":"PGRST000","details":"connection to server at \"localhost\" (::1), port 5432 failed: fe_sendauth: no password supplied\n","hint":null,"message":"Database co
nnection error. Retrying the connection."}
06/Jun/2023:14:19:49 -0500: connection to server at "localhost" (::1), port 5432 failed: fe_sendauth: no password supplied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant