-
Notifications
You must be signed in to change notification settings - Fork 181
"Password authentication failed for user" error after the upgrade to 2.6.0 #145
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
Comments
How does your ds config look like? |
{
"pg": {
"host": "localhost",
"port": 5432,
"url": "postgres://user:password@localhost/database",
"database": "database",
"password": "password",
"name": "pg",
"user": "user",
"connector": "postgresql"
}
} |
Can you try the following within your app?
What is your printout? |
You can also use |
Here is what I get: {
"user":"user",
"database":"database",
"port":5432,
"host":"localhost",
"password":"password",
"binary":false,
"ssl":false,
"client_encoding":"",
"isDomainSocket":false
} I tried both 2.5.0 and 2.6.0 and I get exactly the same result. |
I have also tried with the SET DEBUG=loopback:connector:postgresql - results are the same for both versions of the connector: {
"host":"localhost",
"port":5432,
"url":"postgres://user:password@localhost/database",
"database":"database",
"password":"password",
"name":"pg",
"user":"postgres",
"connector":"postgresql",
"debug":true
} |
Should be fixed now by 2.6.1 |
Nope, I have 2.6.1 now and it is still not working. |
Hmm, I verified it on both Windows and Mac. One of my tests fails before the fix and works now. It's due to the usage of |
This is not an issue anymore. You can specify the password as a part of the Here is a sample reproduction: datasources.json {
"postgresqlDs": {
"host": "localhost",
"port": 5432,
"url": "",
"database": "testdb",
"password": "<pass>",
"name": "postgresqlDs",
"user": "<user>",
"connector": "postgresql"
},
"newDs": {
"host": "",
"port": 5432,
"url": "postgres://<user>:<pass>@localhost/testdb",
"database": "",
"password": "",
"name": "newDs",
"user": "",
"connector": "postgresql"
}
} boot-script.js 'use strict';
var util = require('util');
var _ = require('lodash');
module.exports = function(app) {
var db = app.datasources.postgresqlDs;
var db2 = app.datasources.newDs;
db.ping(function(err) {
if (err) throw err;
console.log('\nPinged first db.');
db2.ping(function(err) {
if (err) throw err;
console.log('\nPinged second db.');
});
});
}; output sakibs-mac:postgresql-145 ssh$ node .
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer
Pinged first db.
Pinged second db. |
I installed nodejs and loopback 4 on Windows 10 today and experienced this issue. >npm ls loopback-connector-postgresql
>lb4 --version
|
@johnhaire89 can you reproduce the problem using
|
@johnhaire89 sorry for the confusion, I see that the latest version of To help us to help you, please create a small application we can use to reproduce the problem and open a new issue.
|
After the upgrade to 2.6.0 I can not run my loopback project with loopback-connector-postgresql anymore.
Here is the error I get:
Connection fails: { error: password authentication failed for user "Lyapin" at Connection.parseE (\node_modules\pg\lib\connection.js:543:11) at Connection.parseMessage (\node_modules\pg\lib\connection.js:370:17) at Socket.<anonymous> (\node_modules\pg\lib\connection.js:109:22) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at readableAddChunk (_stream_readable.js:172:18) at Socket.Readable.push (_stream_readable.js:130:10) at TCP.onread (net.js:542:20) name: 'error', length: 95, severity: 'FATAL', code: '28P01', detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'auth.c', line: '285', routine: 'auth_failed' }
I use Windows and it looks like with the new version of the connector (which has pg library updated from 4.2.0 to 6.0.0 as well) it tries to use my current user's windows credentials to connect to postgresql instead of the credentials specified in the datasources.json file.
If i use 2.5.0 it works as expected.
The text was updated successfully, but these errors were encountered: