我正在搞乱这个惊人的Sails项目here。
我设法让我的Macbook Pro 100%正常运行,几乎没有任何困难。
现在我正试图让它在Azure Ubuntu 14.04框上工作,并在使用npm start
运行它之后调用node app.js
我收到此错误:
Error creating a connection to Postgresql using the following settings:
{ host: 'localhost',
port: 5432,
schema: true,
ssl: false,
adapter: 'sails-postgresql',
user: 'electron_release_server_user',
password: '[redacted]',
database: 'electron_release_server',
identity: 'postgresql' }
* * *
Complete error details:
{ error: password authentication failed for user "electron_release_server_user"
at Connection.parseE (/home/azureuser/electron-release-server/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:539:11)
at Connection.parseMessage (/home/azureuser/electron-release-server/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:366:17)
at Socket.<anonymous> (/home/azureuser/electron-release-server/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:105: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:535:20)
name: 'error',
length: 117,
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' }
在我的local.js中我有:
connections: {
postgresql: {
adapter: 'sails-postgresql',
host: 'localhost',
user: 'electron_release_server_user',
password: '<SECRET>',
database: 'electron_release_server'
}
},
这个确切的配置适用于我的本地机器,但现在它在这个Ubuntu VM上......没有运气。
任何?我需要这个才能发布产品!
答案 0 :(得分:12)
所以它原来是我的Node版本。
Node.js 6.0似乎没有用。一旦我降级到LTS,poof,一切都按预期工作。
答案 1 :(得分:0)
根据我的经验,该问题属于Client Authentication
问题的范围,您可以参考Postgres文档了解它,请参阅http://www.postgresql.org/docs/9.1/static/client-authentication-problems.html。
通常的解决方案是通过Postgres命令ALTER USER
检查或更改指定用户的密码,请参阅文档http://www.postgresql.org/docs/9.1/static/sql-alteruser.html。
您可以参考一个现有的SO主题,请参阅Postgresql: password authentication failed for user "postgres"。
希望它有所帮助。