2

I cloned a project i did on cloud9 IDE on my computer. This project is on rails and use Heroku & postgresql.

I want to launch it from my computer, i did everything needed to launch the project like install libs, bundle install, install postgresql etc...

But it seems i missed something for postgresql. I encounter 2 issues

The first one, I can't launch psql directly from my bash like i do on Cloud9. I must do :

sudo -i -u postgres //it open something like a new bash
psql //then psql is launch

I wish to be able to type only psql but it display

role tellimi is not permitted to log in

I tried to create role (PostgreSQL: role is not permitted to log in) but the message became

database tellimi does not exist

but tellimi is my username, not a database

Then i wanted to check my database on salesforce so i add the url in a new env variable $DTABASE_URL but when i do

psql $DATABASE_URL

it display

psql: could not connect to server: Connexion terminée par expiration du délai d'attente Is the server running on host "ec2-54-247-125-202.eu-west-1.compute.amazonaws.com" (54.247.125.202) and accepting TCP/IP connections on port 5432?

So how to set-up correctly postgresql to answer those 2 problems?

Community
  • 1
  • 1
Tellimi
  • 89
  • 10
  • 1
    what is your database name?.. try `psql -U postgres -d postgres` – Vao Tsun Nov 29 '16 at 14:22
  • I didn't create one localy. My database is on Salesforce servers and connected to my app with Heroku connect. It take $DATABASE_URL variable to found the DB. psql -U postgres -d postgres work – Tellimi Nov 29 '16 at 14:30
  • ah! I missed heroku. and what you see after `heroku pg:psql` ?.. – Vao Tsun Nov 29 '16 at 14:37
  • same error like 'psql $DATABASE_URL' : "psql: could not connect to the server.......... accepting TCP/IP connections on port 5432?" – Tellimi Nov 29 '16 at 14:45
  • then the value of `$DATABASE_URL` is bad :) – Vao Tsun Nov 29 '16 at 14:49
  • I copied and pasted it from c9 env where it worked. just in case it was a wrong value i just copied the variable from my heroku dashboard settings and it still fail – Tellimi Nov 29 '16 at 14:56
  • I guess this part of error message "accepting TCP/IP connections on port 5432?" is a part of the solution – Tellimi Nov 29 '16 at 14:57
  • well, connection can be firewalled for `54.247.125.202` from ne IP and allowed from the other... – Vao Tsun Nov 29 '16 at 15:01
  • I'm not at all good with Ip, Port etc. have you got any doc or something to help me? – Tellimi Nov 29 '16 at 16:12
  • `vao@ud64:/t/sq$ psql -h 54.247.125.202 -p 5432 -U postgres Password for user postgres: psql: FATAL: password authentication failed for user "postgres" FATAL: no pg_hba.conf entry for host "159.134.255.230", user "postgres", database "t", SSL off ` I tried to reach your db myself. It is not firewalled for me. try `ping www.google.com` from that machine (where you get error) – Vao Tsun Nov 29 '16 at 16:16
  • No problem when i ping google. Rails port is 3000, postgres error message talk about 5432. can it be the cause ? – Tellimi Nov 29 '16 at 17:21
  • I tell you - it allows me to reach your db. port and ip are ok – Vao Tsun Nov 29 '16 at 19:46

0 Answers0