Quantcast

Yesod app uses wrong port when connecting to PostgreSQL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Yesod app uses wrong port when connecting to PostgreSQL

Geraldus

Hi folks!

I'm struggling with following error:

libpq: failed (could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?

I see such messages in Keter's log (in app folder). The VPS where the app deployed running PostgreSQL 9.6 on port 5433. I have changed default port in:

  • config/settings
  • config/keter.yaml
  • /opt/keter/etc/postgres.yaml on server side

None of these steps helped. I wasn't able to find other port configuration places. What else can I do?



_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yesod app uses wrong port when connecting to PostgreSQL

David Turner-2
Hi,

It may help to know that libpq also looks to environment variables to get its config: https://www.postgresql.org/docs/9.3/static/libpq-envars.html

Cheers,

David

(Apologies for the double mail, I failed to CC the list in the first time)

On 6 Mar 2017 19:55, "Geraldus" <[hidden email]> wrote:

Hi folks!

I'm struggling with following error:

libpq: failed (could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?

I see such messages in Keter's log (in app folder). The VPS where the app deployed running PostgreSQL 9.6 on port 5433. I have changed default port in:

  • config/settings
  • config/keter.yaml
  • /opt/keter/etc/postgres.yaml on server side

None of these steps helped. I wasn't able to find other port configuration places. What else can I do?



_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yesod app uses wrong port when connecting to PostgreSQL

Geraldus
In reply to this post by Geraldus
Thank you David!

I've exported PGPORT variable and restarted Keter.  Now everything works!

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yesod app uses wrong port when connecting to PostgreSQL

Viktor Dukhovni
In reply to this post by Geraldus

> On Mar 6, 2017, at 2:55 PM, Geraldus <[hidden email]> wrote:
>
> Hi folks!
>
> I'm struggling with following error:
>
> libpq: failed (could not connect to server: Connection refused
>         Is the server running on host "localhost" (127.0.0.1) and accepting
>         TCP/IP connections on port 5432?
>
> I see such messages in Keter's log (in app folder). The VPS where the app deployed running PostgreSQL 9.6 on port 5433. I have changed default port in:
>
> • config/settings
> • config/keter.yaml
> • /opt/keter/etc/postgres.yaml on server side
> None of these steps helped. I wasn't able to find other port configuration places. What else can I do?

On my system:

$ grep '543[23]' /etc/services
postgresql      5432/tcp   #PostgreSQL Database
postgresql      5432/udp   #PostgreSQL Database

--
        Viktor.

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Loading...