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

Not able connect to postgres server configured with scram-sha-256 authentication #768

Closed
manojbsw opened this issue Dec 23, 2020 · 8 comments

Comments

@manojbsw
Copy link

Expected behavior

pg-promise client must connect to posgres server configured with scram-sha-256 authentication method

Actual behavior

Getting below error while connecting.
2020-12-16 12:40:47.622 - error: uncaughtException: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 }
Error: Unknown authenticationOk message typeMessage { name: 'authenticationOk', length: 23 } ��� at Connection.parseR (/opt/<some_path>/node_modules/pg/lib/connection.js:442:9)
��� at Connection.parseMessage (/opt/<some_path>/node_modules/pg/lib/connection.js:358:19)
��� at Socket. (/opt/<some_path>/node_modules/pg/lib/connection.js:119:22)

Steps to reproduce

  1. Install/Configure postgres db server configured with scram-sha-256 authentication method
  2. Try to initialize the connection with connection string having required credentials.

Environment

  • Version of pg-promise: 10.6.1
  • OS type (Linux/Windows/Mac): Linux
  • Version of Node.js: v12.15.0
@xscode-auto-reply
Copy link

Thanks for opening a new issue. The team has been notified and will review it as soon as possible.
For urgent issues and priority support, visit https://xscode.com/vitaly-tomilov/pg-promise

@vitaly-t
Copy link
Owner

vitaly-t commented Dec 23, 2020

Looks like a very old issue in the underlying driver, see #1508. It was fixed awhile ago. Update to the latest version of pg-promise, and it should be fine.

@manojbsw
Copy link
Author

manojbsw commented Dec 24, 2020

@vitaly-t Thanks for your quick reply, So from #1508 it looks pg-promise don't support scram-sha-256. Please let me know if I am wrong here.

@vitaly-t
Copy link
Owner

vitaly-t commented Dec 24, 2020

@manojbsw Have you updated to the latest version? It should have been fixed by now.

it looks pg-promise don't support scram-sha-256

Why does it look like that? The support for that encoding isn't it in pg-promise, it is in the underlying driver, which was patched for that awhile ago. Update the library, and then update the question.

@vitaly-t
Copy link
Owner

I'm not expecting any traction on this presently, and since it is a non-issue within this library, closing it, at least for now.

@Afoxcute
Copy link

Afoxcute commented Jun 6, 2021

Looks like a very old issue in the underlying driver, see #1508. It was fixed awhile ago. Update to the latest version of pg-promise, and it should be fine.

i updated pg-promise but I am still getting the same error

@vitaly-t
Copy link
Owner

vitaly-t commented Jun 6, 2021

Sometimes update doesn't go through well. Check console.log(db.$config.version) to make sure ;) Best is to delete and then install again ;)

@Afoxcute
Copy link

Afoxcute commented Jun 6, 2021

Sometimes update doesn't go through well. Check console.log(db.$config.version) to make sure ;) Best is to delete and then install again ;)

Sorry, best is to delete what? node_modules folder.

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

No branches or pull requests

3 participants