4

I was messing around with this amazing Sails project here.

I managed to get it 100% functional on my Macbook Pro with little to no difficulty.

Here's my fork.

Now I'm trying to get it working on an Azure Ubuntu 14.04 box and after running it with npm start which just calls node app.js I get this error:

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' }

In my local.js I have:

connections: {
    postgresql: {
      adapter: 'sails-postgresql',
      host: 'localhost',
      user: 'electron_release_server_user',
      password: '<SECRET>',
      database: 'electron_release_server'
    }
  },

This exact configuration worked on my local machine but now that it's on this Ubuntu VM... no luck.

Anyone? I need this in order to release a product!

2 Answers2

13

So it turned out to be my version of Node.

Node.js 6.0 just didn't seem to work. Once I downgraded to LTS, poof, everything worked as expected.

2

Per my experience, the issue belongs to the scope of Client Authentication problems that you can refer to the Postgres document to know it, please see http://www.postgresql.org/docs/9.1/static/client-authentication-problems.html.

The usual solution is that checking or changing the password for the specified user via the Postgres command ALTER USER, please see the document http://www.postgresql.org/docs/9.1/static/sql-alteruser.html.

There is an exsiting SO thread which you can refer to, please see Postgresql: password authentication failed for user "postgres".

Hope it helps.

Community
  • 1
  • 1
Peter Pan
  • 23,476
  • 4
  • 25
  • 43
  • Thanks for this. I've seen that SO thread and unfortunately the suggestions did not solve my issue. That's why I posted this question hopping that this was a Sails issue. I attempted to connect to that database using: `psql -U electron_release_server_user -h localhost electron_release_server` I was prompted for the password, I put it in, and it worked. I was successfully connected to the database: `electron_release_server=>` is my prompt. – Tyler James Leonhardt May 06 '16 at 13:40