question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AuthenticateSASL with bouncer error

See original GitHub issue

Hi!

After migrating to .Net 5 (maybe this is not the reason) we start having error while connecting through bouncer. If we are connecting direct to main instance AuthenticateSASL work as expected but when we are using bouncer port everything stop working at var saslFinalServerMsg = Expect<AuthenticationSASLFinalMessage>(await ReadMessage(async), this); with 08P01: SASL authentication failed error.

What can be reason for this behavior?

Thanks!

We have this error both at 5.0.1 and 5.0.2 while everything looks fine at 3.1.4 and 3.1.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
vonzshikcommented, Jan 26, 2021

The point being, this exact problem was fixed with version 1.12

3reactions
euroUKcommented, Jan 26, 2021

So the reason is in incorrect ?: operator:

if (!successfulBind && supportsSha256)
            {
                mechanism = "SCRAM-SHA-256";
                // We can get here if PostgreSQL supports only SCRAM-SHA-256 or there was an error while binding to SCRAM-SHA-256-PLUS
                // So, we set 'n' (client does not support binding) if there was an error while binding
                // or 'y' (client supports but server doesn't) in other case
                cbindFlag = supportsSha256Plus ? "n" : "y";
                cbind = supportsSha256Plus ? "biws" : "eSws";
                successfulBind = true;
                IsScram = true;
            }

it should be like

if (!successfulBind && supportsSha256)
            {
                mechanism = "SCRAM-SHA-256";
                // We can get here if PostgreSQL supports only SCRAM-SHA-256 or there was an error while binding to SCRAM-SHA-256-PLUS
                // So, we set 'n' (client does not support binding) if there was an error while binding
                // or 'y' (client supports but server doesn't) in other case
                cbindFlag = supportsSha256Plus ? "y" : "n";
                cbind = supportsSha256Plus ? "eSws" :"biws";
                successfulBind = true;
                IsScram = true;
            }

Should I create pull request to fix it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turn off SSL when connecting to bouncer
I'm getting this error when connecting to the bouncer service. ERROR: SQLSTATE[08006] [7] connection to server at "postgres-db-pg-db-pgbouncer.
Read more >
Using SASL
Connecting bots which lack SASL support from SASL access only ranges can be achieved if you connect the bot via a bouncer that...
Read more >
SASL authentication failure: cannot connect to saslauthd ...
I've been up searching for hours to no avail. IMAP successfully authenticates (despite dovecot being configured to piggyback off of postfix auth) ...
Read more >
Error on SASL SMTP authentication
Hello Guys, iI installed a new Mailserver using Dovecot, Postfix and a MySQL-Database for the Users and Domains and Mailboxes.
Read more >
Sasl
The SASL module allows you to authenticate to an IRC network via SASL. ... If you are using a ZNC bouncer provided by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found