I'm building a Sails.js app, and I set up the sails-postgresql adapter with all of my connection info and it worked fine the first time I lifted the app and created all of my tables.
Now I get this error:
error: A hook (`orm`) failed to load!
error: error: password authentication failed for user "postgres"
at Connection.parseE (/root/royaltyPayer/vigilant-disco/royaltyPayer/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:540:11)
at Connection.parseMessage (/root/royaltyPayer/vigilant-disco/royaltyPayer/node_modules/sails-postgresql/node_modules/pg/lib/connection.js:367:17)
at Socket.<anonymous> (/root/royaltyPayer/vigilant-disco/royaltyPayer/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)
I have already tried all of the answers posted to this question: Postgresql: password authentication failed for user "postgres"
I have made sure that my linux password and database password for user postgres are the same.
Here is the relevant line from /etc/postgresql/9.4/main/pg_hba.conf:
local all postgres peer
Here is my code in config/connections.js:
module.exports.connections = {
PostgresqlServer: {
adapter: 'sails-postgresql',
host: 'localhost',
user: 'postgres',
password: '12345',
port:'5433',
database: 'myDB'
}
Here is my code in config/models.js
module.exports.models = {
connection: 'PostgresqlServer',
migrate: 'safe'
}
I am using: Sails version 0.11.0, Postgres version 9.4, Node version 6.0.0
My permissions on the database in psql:
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
---------------+----------+----------+-------------+-------------+----------------------------
myDB | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres +
| | | | | postgres=CTc/postgres