Unix Technical Forum

Yet Another Socket .s.PGSQL.5432 Problem

This is a discussion on Yet Another Socket .s.PGSQL.5432 Problem within the pgsql Admins forums, part of the PostgreSQL category; --> Hi folks! That's another "sob sob.. I can't connect to socket blah blah .. ..s.PGSQL.5432" asking for help. But ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 08:06 AM
Hilton Perantunes
 
Posts: n/a
Default Yet Another Socket .s.PGSQL.5432 Problem

Hi folks!

That's another "sob sob.. I can't connect to socket blah blah ..
..s.PGSQL.5432" asking for help. But this is somewhat bizarre, and i'm not
used to the 8.2's postgresql.conf file.

I'm running a PostgreSQL 8.4.2 powered by Debian Sarge (very)Unstable. My
PHP application successfully connects to the appropriated database. Even
PgAdmin3 connects to the database. But my 'postgres' user cannot connect to
the database via command line:

----------
psql: could not connect to server:
Is the server running locally and accepting
connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.5432"?
----------

Well, the socket file actually IS there (zero bytes of size) and it's given
the correct permissions. Now, I have this in my pg_hba.conf (replace XXX by
my network, and I just added the second line recently, in despair):

----------
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all XXX.XXX.XXX.1/24 trust
host all postgres 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
----------

Finally, that's the hot section in my postgresql.conf:

----------
listen_addresses = '*' # what IP address(es) to listen on;

port = 5432 # (change requires restart)
----------

So, I just can't connect in the database through command line. Someone can
waste some time helping me?

Thanks in advance =)

--
Hilton William Ganzo Perantunes
Sistemas de Informação - Universidade Federal de Santa Catarina
--
Dinheiro não traz felicidade, mas dá uma sensação tão parecida...-_-

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:06 AM
samngan@telus.net
 
Posts: n/a
Default Re: unsubcribe

[ADMIN] unsubcribe





---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 08:06 AM
Julio Cesar =?ISO-8859-1?Q?S=E1nchez_Gonz=E1lez?=
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

El mié, 15-08-2007 a las 17:13 -0300, Hilton Perantunes escribió:
> Hi folks!
>
> That's another "sob sob.. I can't connect to socket blah
> blah .. .s.PGSQL.5432" asking for help. But this is somewhat bizarre,
> and i'm not used to the 8.2's postgresql.conf file.
>
> I'm running a PostgreSQL 8.4.2 powered by Debian Sarge (very)Unstable.
> My PHP application successfully connects to the appropriated database.
> Even PgAdmin3 connects to the database. But my 'postgres' user cannot
> connect to the database via command line:
>
> ----------
> psql: could not connect to server:
> Is the server running locally and accepting
> connections on Unix domain socket
> "/var/run/postgresql/.s.PGSQL.5432"?
> ----------
>
> Well, the socket file actually IS there (zero bytes of size) and it's
> given the correct permissions. Now, I have this in my pg_hba.conf
> (replace XXX by my network, and I just added the second line recently,
> in despair):
>


Try stoping the postgresql process and delete the socket unix file,
restart the postgresql daemon and we to mean.

> ----------
> # "local" is for Unix domain socket connections only
> local all all trust
> # IPv4 local connections:
> host all all XXX.XXX.XXX.1 /24 trust
> host all postgres 127.0.0.1/32 trust
> # IPv6 local connections:
> host all all ::1/128 trust
> ----------
>
> Finally, that's the hot section in my postgresql.conf:
>
> ----------
> listen_addresses = '*' # what IP address(es) to
> listen on;
> port = 5432 # (change requires restart)
> ----------
>
> So, I just can't connect in the database through command line. Someone
> can waste some time helping me?
>
> Thanks in advance =)
>
> --
> Hilton William Ganzo Perantunes
> Sistemas de Informação - Universidade Federal de Santa Catarina
> --
> Dinheiro não traz felicidade, mas dá uma sensação tão parecida... -_-




--
Regards,

Julio Cesar Sánchez González
www.sistemasyconectividad.com.mx
blog: http://darkavngr.blogspot.com

---
Ahora me he convertido en la muerte, destructora de mundos.
Soy la Muerte que se lleva todo, la fuente de las cosas que vendran.


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 08:06 AM
Hilton Perantunes
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

Thanks for answering, Julio.

When I stop the database, the socket file is automatically removed. That's
the way it happened before... but now, oddly enough, I restarted the
database at will several times, my app is still running, pgadmin too... and
no socket file is created. o.0

(and I still can't connect via bash)

Hilton



On 8/15/07, Julio Cesar Sánchez González <
knowhow@sistemasyconectividad.com.mx> wrote:
>
> El mié, 15-08-2007 a las 17:13 -0300, Hilton Perantunes escribió:
> > Hi folks!
> >
> > That's another "sob sob.. I can't connect to socket blah
> > blah .. .s.PGSQL.5432" asking for help. But this is somewhat bizarre,
> > and i'm not used to the 8.2's postgresql.conf file.
> >
> > I'm running a PostgreSQL 8.4.2 powered by Debian Sarge (very)Unstable.
> > My PHP application successfully connects to the appropriated database.
> > Even PgAdmin3 connects to the database. But my 'postgres' user cannot
> > connect to the database via command line:
> >
> > ----------
> > psql: could not connect to server:
> > Is the server running locally and accepting
> > connections on Unix domain socket
> > "/var/run/postgresql/.s.PGSQL.5432"?
> > ----------
> >
> > Well, the socket file actually IS there (zero bytes of size) and it's
> > given the correct permissions. Now, I have this in my pg_hba.conf
> > (replace XXX by my network, and I just added the second line recently,
> > in despair):
> >

>
> Try stoping the postgresql process and delete the socket unix file,
> restart the postgresql daemon and we to mean.
>
> > ----------
> > # "local" is for Unix domain socket connections only
> > local all all trust
> > # IPv4 local connections:
> > host all all XXX.XXX.XXX.1 /24 trust
> > host all postgres 127.0.0.1/32 trust
> > # IPv6 local connections:
> > host all all ::1/128 trust
> > ----------
> >
> > Finally, that's the hot section in my postgresql.conf:
> >
> > ----------
> > listen_addresses = '*' # what IP address(es) to
> > listen on;
> > port = 5432 # (change requires restart)
> > ----------
> >
> > So, I just can't connect in the database through command line. Someone
> > can waste some time helping me?
> >
> > Thanks in advance =)
> >
> > --
> > Hilton William Ganzo Perantunes
> > Sistemas de Informação - Universidade Federal de Santa Catarina
> > --
> > Dinheiro não traz felicidade, mas dá uma sensação tão parecida... -_-

>
>
>
> --
> Regards,
>
> Julio Cesar Sánchez González
> www.sistemasyconectividad.com.mx
> blog: http://darkavngr.blogspot.com
>
> ---
> Ahora me he convertido en la muerte, destructora de mundos.
> Soy la Muerte que se lleva todo, la fuente de las cosas que vendran.
>
>



--
Hilton William Ganzo Perantunes
Sistemas de Informação - Universidade Federal de Santa Catarina
--
Dinheiro não traz felicidade, mas dá uma sensação tão parecida...-_-

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 08:06 AM
Tom Lane
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

"Hilton Perantunes" <hperantunes@gmail.com> writes:
> When I stop the database, the socket file is automatically removed. That's
> the way it happened before... but now, oddly enough, I restarted the
> database at will several times, my app is still running, pgadmin too... and
> no socket file is created. o.0


Are you sure that's where the database thinks the socket file should be?
/var/run/postgresql is *not* the factory default for this; /tmp is.
If you replaced a distro build with your own or vice versa you may be
confused by that.

Wrong permissions on the directory or its parents could be the
problem, too.

> psql: could not connect to server:
> Is the server running locally and accepting
> connections on Unix domain socket
> "/var/run/postgresql/.s.PGSQL.5432"?


This clip omits the most important part of the message: there should be
a kernel error code after the colon.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 08:06 AM
Hilton Perantunes
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

Tom, really... the socket lies in /tmp/. The socket file has 0777
postgresostgres. /tmp/ has 0777 root:root.

The socket file is removed when I stop the database.




On 8/15/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Hilton Perantunes" <hperantunes@gmail.com> writes:
> > When I stop the database, the socket file is automatically removed.

> That's
> > the way it happened before... but now, oddly enough, I restarted the
> > database at will several times, my app is still running, pgadmin too...

> and
> > no socket file is created. o.0

>
> Are you sure that's where the database thinks the socket file should be?
> /var/run/postgresql is *not* the factory default for this; /tmp is.
> If you replaced a distro build with your own or vice versa you may be
> confused by that.
>
> Wrong permissions on the directory or its parents could be the
> problem, too.
>
> > psql: could not connect to server:
> > Is the server running locally and accepting
> > connections on Unix domain socket
> > "/var/run/postgresql/.s.PGSQL.5432"?

>
> This clip omits the most important part of the message: there should be
> a kernel error code after the colon.
>
> regards, tom lane
>




--
Hilton William Ganzo Perantunes
Sistemas de Informação - Universidade Federal de Santa Catarina
--
Dinheiro não traz felicidade, mas dá uma sensação tão parecida...-_-

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-10-2008, 08:07 AM
Alvaro Herrera
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

Hilton Perantunes escribió:
> Tom, really... the socket lies in /tmp/. The socket file has 0777
> postgresostgres. /tmp/ has 0777 root:root.


psql is complaining about /var/run/postgresql (the Debian packaging of
libpq does that). Try setting PGHOST to /tmp, like in

PGHOST=/tmp psql


--
Alvaro Herrera Developer, http://www.PostgreSQL.org/
"The eagle never lost so much time, as
when he submitted to learn of the crow." (William Blake)

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-10-2008, 08:07 AM
Hilton Perantunes
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

Alvaro, it works like a charm =). Thank you all.

Bad, bad Debian.. no cookies for you (and I'll read the error messages more
carefully next time)!

Abraços..

Hilton Perantunes



On 8/16/07, Alvaro Herrera <alvherre@commandprompt.com> wrote:
>
> Hilton Perantunes escribió:
> > Tom, really... the socket lies in /tmp/. The socket file has 0777
> > postgresostgres. /tmp/ has 0777 root:root.

>
> psql is complaining about /var/run/postgresql (the Debian packaging of
> libpq does that). Try setting PGHOST to /tmp, like in
>
> PGHOST=/tmp psql
>
>
> --
> Alvaro Herrera Developer,
> http://www.PostgreSQL.org/
> "The eagle never lost so much time, as
> when he submitted to learn of the crow." (William Blake)
>




--
Hilton William Ganzo Perantunes
Sistemas de Informação - Universidade Federal de Santa Catarina
--
Dinheiro não traz felicidade, mas dá uma sensação tão parecida...-_-

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-10-2008, 08:07 AM
Peter Eisentraut
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

Am Donnerstag, 16. August 2007 23:41 schrieb Hilton Perantunes:
> Alvaro, it works like a charm =). Thank you all.
>
> Bad, bad Debian.. no cookies for you (and I'll read the error messages more
> carefully next time)!


The problem is quite likely some variant on the following: You had your
distribution-supplied PostgreSQL packages installed, which
use /var/run/postgresql as the socket location. Then you built your own
pieces of PostgreSQL, which use /tmp. When you call just "psql"
or "pgadmin3", they will use the system-supplied libpq, which uses the
system-specific socket location, since they don't know about your
hand-crafted installation. If you had called the psql binary from your own
installation with an explicit path (and your used the rpath feature during
compilation), then this would have worked. Or you could have used the
environment variable LD_LIBRARY_PATH to point to the libpq of your choice.
There are a few ways to get this wrong. On Debian the socket location is
usually the first indicator, but you ought to be careful in general if you
mix installations like that.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-10-2008, 08:07 AM
Hilton Perantunes
 
Posts: n/a
Default Re: Yet Another Socket .s.PGSQL.5432 Problem

Exactly what happened, Peter. Something was preventing me of successfully
install 8.2.4 through apt-get, so I did it by hand.

I'll read the documentation about LD_LIBRARY_PATH.

Thank you.

Hilton Perantunes


On 8/17/07, Peter Eisentraut <peter_e@gmx.net> wrote:
>
> Am Donnerstag, 16. August 2007 23:41 schrieb Hilton Perantunes:
> > Alvaro, it works like a charm =). Thank you all.
> >
> > Bad, bad Debian.. no cookies for you (and I'll read the error messages

> more
> > carefully next time)!

>
> The problem is quite likely some variant on the following: You had your
> distribution-supplied PostgreSQL packages installed, which
> use /var/run/postgresql as the socket location. Then you built your own
> pieces of PostgreSQL, which use /tmp. When you call just "psql"
> or "pgadmin3", they will use the system-supplied libpq, which uses the
> system-specific socket location, since they don't know about your
> hand-crafted installation. If you had called the psql binary from your
> own
> installation with an explicit path (and your used the rpath feature during
> compilation), then this would have worked. Or you could have used the
> environment variable LD_LIBRARY_PATH to point to the libpq of your choice..
> There are a few ways to get this wrong. On Debian the socket location is
> usually the first indicator, but you ought to be careful in general if you
> mix installations like that.
>
> --
> Peter Eisentraut
> http://developer.postgresql.org/~petere/
>




--
Hilton William Ganzo Perantunes
Sistemas de Informação - Universidade Federal de Santa Catarina
--
Dinheiro não traz felicidade, mas dá uma sensação tão parecida...-_-

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com