Sails: Error connecting to postgresql database

Created on 28 Apr 2016  路  10Comments  路  Source: balderdashy/sails

Hi,

I have a very inexplicable issue. For a month I have my application deployed on Scalingo (http://scalingo.com). Everything is working very well. Yesterday I added some changes to my app and try to deploy the new version. But on boost, Sails tell me that it's impossible to connect to my database.
error: password authentication failed for user "lucie_api_p_5297"
I tried everything :

  • git reset hard to my old version (not working)
  • diff between npm list of working container and not working container (0 diff)
  • Connect to my production database locally (working)

Did someone have a similar issue or have any idea helping me to debug ?

Thanks,
Gabriel

SOLUTION FOUND : Node version was updated to 6.0.0 since yesterday and connexion is broken with Node 6.0.0.

All 10 comments

@Gab-Metzger Thanks for posting, we'll take a look as soon as possible. In the meantime, if you haven鈥檛 already, please carefully read the issue contribution guidelines and double-check for any missing information above. In particular, please ensure that this issue is about a stability or performance bug with a documented feature; and make sure you鈥檝e included detailed instructions on how to reproduce the bug from a clean install. Finally, don鈥檛 forget to include the version of Node.js you tested with, as well as your version of Sails or Waterline, and of any relevant standalone adapters/generators/hooks.

Thank you!

5.11.0 also has problems. 5.10.1 is OK.

Thanks for the update re: Node 6, @Gab-Metzger. Seems like some modules in the ecosystem need to play catchup for the latest version of Node (note that the latest _long-term stable_ release of Node is still 4.4.3).

@sgress454: I feel this issue should be reopened, because it is still unsolved. I banged my head against this wall for several days until I found this thread. I am sure someone else is struggling as well.

I have two temporary solutions while upstream is solved:

_OPTION 1_: in package.json set the nodejs binary to the last known version that worked(thanks @shyshkov) : 5.10.1. I have confirmed this to work in Heroku.

"engine":{
    "node": "5.10.1"
  },

_OPTION 2:_ Deactivate user authentication in the pg_hba.conf file (Normally located in /etc/postgresql/<YOUR PG VERSION>/main/pg_hba.conf). You must change the line fo IPv4 Local connection to something other than md5.

# IPv4 local connections:
host    all             all             127.0.0.1/32            password

Do not forget to restart postgres after saving! (sudo /etc/init.d/postgresql restart)

@zubietaroberto Thanks for posting. The issue was closed because it's not a bug in sails-postgresql, so it doesn't seem like something we can fix on our end. But having it closed doesn't make it any harder to find in the issue search, so folks having similar issues should be able to find your workarounds! If there's something else we can do here, let me know.

Looks like it's an issue with crypto updates in node that has been patched in the pg module. I'll look at getting a patch out.

@zubietaroberto @Gab-Metzger @shyshkov I bumped the PG dependency and everything looks good so I'll go ahead and publish a new version of the 0.11.x branch. Seems to be issues with the query building stuff in 0.12 separate from this so make sure you stay on the 0.11.x versions. I'll have to look into that deeper when I get a chance.

The PR is here.

ok I published Waterline 0.11.4 which should get this patched up.

I am still getting this problem with node 6.7.0 and waterline 0.12.2. Any suggestions?

@mukk85 See option2 in my previous comment

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radoslavpetranov picture radoslavpetranov  路  4Comments

randallmeeker picture randallmeeker  路  4Comments

svmn picture svmn  路  4Comments

pawankorotane picture pawankorotane  路  3Comments

3imed-jaberi picture 3imed-jaberi  路  3Comments