Unhandled 'error' event thrown when the connection password doesn't match
See original GitHub issueWhen I connect to an existing database with the connect username but the wrong password, I got an unhandled exception using the following code. The parameter err is set, but the exception is still thrown.
pg.connect(dbURL, function(err, client, done) {
if(err) {
return console.error('error fetching client from pool', err);
}
client.query('SELECT $1::int AS number', ['1'], function(err, result) {
//call `done()` to release the client back to the pool
done();
if(err) {
return console.error('error running query', err);
}
console.log(result.rows[0].number);
//output: 1
client.end();
});
});
Issue Analytics
- State:
- Created 9 years ago
- Comments:38 (20 by maintainers)
Top Results From Across the Web
Fix "The sign-in name or password does not match one in the ...
Here are the possible causes and solutions: Your user name or password could be wrong (Obviously!). Check if you are able to log...
Read more >Solved: Re: Failed Qlik Sense Enterprise on Windows August...
Finally when all of that failed I changed the qliksenserepository password and the errors in event logs still persist. Main errors below, repeat...
Read more >Initial setup fails: api pod crash-loop - Self Hosted Retool
The api pod gives the following error message: ... 14:34:59.670 UTC [111] DETAIL: Password does not match for user "retool_internal_user".
Read more >Error handling - Apollo GraphQL Docs
A client sent the hash of a query string to execute via automatic persisted queries, but the query was not in the APQ...
Read more >NodeJS/mySQL - ER_ACCESS_DENIED_ERROR Access ...
I have the same problem, I solved it by changing the password to empty string. var mysql = require('mysql'); var connection = mysql....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1000
The same error is thrown when we pass an invalid connection:
Other than that, it is 100% reproducible for me, for both invalid user name and invalid password.
It’s been way too long for such a critical issue to just sit here and nothing being done about it. Very frustrating.
I have a number of tests now for pg-promise commented out because of this error, which just kills jasmine framework that I’m using for testing.
Should have been labelled as a bug, at least, as it definitely is.
Upgrade to pg-pool ≥ 1.6.0.