Thread: URGENT : StreamServerPort: bind() failed: Cannot assign requested address

URGENT : StreamServerPort: bind() failed: Cannot assign requested address

From
"Siddharth Rath (sirath)"
Date:
Hi,
I've an application running on RedHat Linux and we are using Postgres as our DB. Initially the DB was running perfectly
butdue to 
some requirement we stopped the DB with " pg_ctl stop -m 'fast' " command. When I tried to restart the DB/Postmaster it
says: 

StreamServerPort: bind() failed: Cannot assign requested address
        Is another postmaster already running on port 5432?
        If not, wait a few seconds and retry.
 cannot create INET stream port

Since I don't have root access , I took the help of the Sysadmin to reboot the system and the DB server(POSTGRES)
startedcorrectly 
, but when I stopped the DB server with above mentioned command and started again it throws back the same old error. Is
thereanyway 
to get rid of these.

I found some details in archieves at http://list.linux-vserver.org/archive/vserver/msg04095.html . But I don't
understandwhat to do 
next.

The O/P of >netstat -plunt | grep 5432

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -

And O/P of netstat -ranv

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.83.103.0     0.0.0.0         255.255.255.192 U         0 0          0 eth2
64.102.29.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         64.102.29.1     0.0.0.0         UG        0 0          0 eth0

Any pointers/help in resolving this issue will be highly appreciated.

Thanx and regards
Sidd


Re: URGENT : StreamServerPort: bind() failed: Cannot

From
mike g
Date:
Hi,

I believe a fast shutdown prevents new connections to the db, sends
termination signals to any applications with current connections, and
then after it receives confirmation that those applications have aborted
their transactions and closed their connections the db stops.

It sounds like your application is either not responding to or
confirming the shutdown request from the db.

The details in that archive were trying to explain how to find which
process / application are still connected to the db after the fast
shutdown attempted to terminate them.

Without root access though maybe you aren't able to see which process is
still attached to the db?

Try doing a ps -A and see if the postmaster is still showing up in the
process list.  If it is then you know for sure that the db is not truly
shutdown.

On Thu, 2004-06-03 at 21:22, Siddharth Rath (sirath) wrote:
> Hi,
> I've an application running on RedHat Linux and we are using Postgres as our DB. Initially the DB was running
perfectlybut due to 
> some requirement we stopped the DB with " pg_ctl stop -m 'fast' " command. When I tried to restart the DB/Postmaster
itsays : 
>
> StreamServerPort: bind() failed: Cannot assign requested address
>         Is another postmaster already running on port 5432?
>         If not, wait a few seconds and retry.
>  cannot create INET stream port
>
> Since I don't have root access , I took the help of the Sysadmin to reboot the system and the DB server(POSTGRES)
startedcorrectly 
> , but when I stopped the DB server with above mentioned command and started again it throws back the same old error.
Isthere anyway 
> to get rid of these.
>
> I found some details in archieves at http://list.linux-vserver.org/archive/vserver/msg04095.html . But I don't
understandwhat to do 
> next.
>
> The O/P of >netstat -plunt | grep 5432
>
> (Not all processes could be identified, non-owned process info
>  will not be shown, you would have to be root to see it all.)
> tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
> udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -
>
> And O/P of netstat -ranv
>
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
> 10.83.103.0     0.0.0.0         255.255.255.192 U         0 0          0 eth2
> 64.102.29.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
> 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
> 127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
> 0.0.0.0         64.102.29.1     0.0.0.0         UG        0 0          0 eth0
>
> Any pointers/help in resolving this issue will be highly appreciated.
>
> Thanx and regards
> Sidd
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: 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

"Siddharth Rath (sirath)" <sirath@cisco.com> writes:
> When I tried to restart the DB/Postmaster it says :

> StreamServerPort: bind() failed: Cannot assign requested address
>         Is another postmaster already running on port 5432?
>         If not, wait a few seconds and retry.
>  cannot create INET stream port

Did you try waiting a while, as suggested by the error message?  Many
TCP stacks have a timeout before they will let a pre-existing port
number be reassigned.  (This is to prevent any risk of packets for old
connections getting delivered to the new owner of the port.)

            regards, tom lane

Re: URGENT : StreamServerPort: bind() failed: Cannot

From
Tom Lane
Date:
mike g <mike@thegodshalls.com> writes:
> It sounds like your application is either not responding to or
> confirming the shutdown request from the db.

I think not.  If the old postmaster were still alive, he'd be getting
a different error message --- the data directory lockfile is checked
before trying to grab the port.

            regards, tom lane

Re: URGENT : StreamServerPort: bind() failed: Cannotassign requested address

From
"Siddharth Rath (sirath)"
Date:
Hi Mike,
Thanx for the response. The ps -A don't have POSTMASTER and I did check it earlier too. Do you foresee any issue with
Linux
configuration or is it the POSTGRES issue? Please let me know how to proceed from here.

Thanx in advance.

Regards
Sidd

-----Original Message-----
From: mike g [mailto:mike@thegodshalls.com]
Sent: Thursday, June 03, 2004 8:56 PM
To: sirath@cisco.com
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannotassign requested address


Hi,

I believe a fast shutdown prevents new connections to the db, sends termination signals to any applications with
current
connections, and then after it receives confirmation that those applications have aborted their transactions and closed
their
connections the db stops.

It sounds like your application is either not responding to or confirming the shutdown request from the db.

The details in that archive were trying to explain how to find which process / application are still connected to the
dbafter the 
fast shutdown attempted to terminate them.

Without root access though maybe you aren't able to see which process is still attached to the db?

Try doing a ps -A and see if the postmaster is still showing up in the process list.  If it is then you know for sure
thatthe db is 
not truly shutdown.

On Thu, 2004-06-03 at 21:22, Siddharth Rath (sirath) wrote:
> Hi,
> I've an application running on RedHat Linux and we are using Postgres
> as our DB. Initially the DB was running perfectly but due to some
> requirement we stopped the DB with " pg_ctl stop -m 'fast' " command.
> When I tried to restart the DB/Postmaster it says :
>
> StreamServerPort: bind() failed: Cannot assign requested address
>         Is another postmaster already running on port 5432?
>         If not, wait a few seconds and retry.
>  cannot create INET stream port
>
> Since I don't have root access , I took the help of the Sysadmin to
> reboot the system and the DB server(POSTGRES) started correctly , but
> when I stopped the DB server with above mentioned command and started
> again it throws back the same old error. Is there anyway to get rid of
> these.
>
> I found some details in archieves at
> http://list.linux-vserver.org/archive/vserver/msg04095.html . But I
> don't understand what to do next.
>
> The O/P of >netstat -plunt | grep 5432
>
> (Not all processes could be identified, non-owned process info  will
> not be shown, you would have to be root to see it all.)
> tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
> udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -
>
> And O/P of netstat -ranv
>
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
> 10.83.103.0     0.0.0.0         255.255.255.192 U         0 0          0 eth2
> 64.102.29.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
> 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
> 127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
> 0.0.0.0         64.102.29.1     0.0.0.0         UG        0 0          0 eth0
>
> Any pointers/help in resolving this issue will be highly appreciated.
>
> Thanx and regards
> Sidd
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: 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


Re: URGENT : StreamServerPort: bind() failed: Cannot assign requested address

From
"Siddharth Rath (sirath)"
Date:
Hi Tom,
Thanx for the reply and suggestion. Actually , I did wait for more than 5 hrs before posting this issue in this alias.
Itwill be 
really great if you can advise on how to proceed from here. Does the below information points to any issue with my
LinuxBox 
configuration is it an issue with POSTGRES:

The O/P of >netstat -plunt | grep 5432

 (Not all processes could be identified, non-owned process info  will
 not be shown, you would have to be root to see it all.)
 tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
 udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -

 And O/P of netstat -ranv

 Kernel IP routing table
 Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
 10.83.103.0     0.0.0.0         255.255.255.192 U         0 0          0 eth2
 64.102.29.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
 169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
 127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
 0.0.0.0         64.102.29.1     0.0.0.0         UG        0 0          0 eth0

Thanx in advance.

Regards
Sidd

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Thursday, June 03, 2004 9:05 PM
To: sirath@cisco.com
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannot assign requested address


"Siddharth Rath (sirath)" <sirath@cisco.com> writes:
> When I tried to restart the DB/Postmaster it says :

> StreamServerPort: bind() failed: Cannot assign requested address
>         Is another postmaster already running on port 5432?
>         If not, wait a few seconds and retry.
>  cannot create INET stream port

Did you try waiting a while, as suggested by the error message?  Many TCP stacks have a timeout before they will let a
pre-existing
port number be reassigned.  (This is to prevent any risk of packets for old connections getting delivered to the new
ownerof the 
port.)

            regards, tom lane


Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
Rob
Date:
Siddharth Rath (sirath) wrote:
>>
>>The O/P of >netstat -plunt | grep 5432
>>

what about just :
netstat -na | grep 5432

to see if any 5432 stuff is hanging around and if so in
what state...

It may be that you are missing the evidence of the problem because you
filtered -plut (process id, listening, udp, tcp) but the error msg talks
about a StreamServerPort bind problem but those unix domain lines won't
be displayed with that set of filters and so it may be some weirdness
with stream and/or lock files in your /tmp directory? Just a guess.

Rob




Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
"Siddharth Rath (sirath)"
Date:
Hi Rob,
Thanx for the response.
The O/P of netstat -na | grep 5432 is :

tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN
udp        0      0 0.0.0.0:54321           0.0.0.0:*

Surprisingly .s.PGSQL.5432 file is not getting created in /tmp directory ( I believe this should be created).
Details of /tmp is given below:

 />ls -ls | grep tmp
    0 drwxrwxrwt    2 root     root          140 Jun  3 23:14 tmp

 /tmp >ls -al
 total 64
 drwxrwxrwt    2 root     root          140 Jun  3 23:14 .
 drwxr-xr-x   21 root     root         4096 Jun  3 12:20 ..
 -rw-r--r--    1 root     root         2037 Jun  3 12:21 bootinfo
 -rwxr-xr-x    1 root     root          578 Jun  3 23:14 find_perl5
 -rw-r--r--    1 root     root        43732 Jun  3 23:14 mk_accounts_client
 -rw-r--r--    1 root     root         1828 Jun  3 12:21 prtdiag-osaka.2004:06:03:12:21:22
 -rw-r--r--    1 root     root           23 Jun  3 23:14 sendme.osaka

Please let me know how to proceed from here.

Thanx and regards
Sidd



-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Rob
Sent: Friday, June 04, 2004 2:47 AM
To: sirath@cisco.com; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannotassign


Siddharth Rath (sirath) wrote:
>>
>>The O/P of >netstat -plunt | grep 5432
>>

what about just :
netstat -na | grep 5432

to see if any 5432 stuff is hanging around and if so in
what state...

It may be that you are missing the evidence of the problem because you
filtered -plut (process id, listening, udp, tcp) but the error msg talks
about a StreamServerPort bind problem but those unix domain lines won't
be displayed with that set of filters and so it may be some weirdness
with stream and/or lock files in your /tmp directory? Just a guess.

Rob




---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
Tom Lane
Date:
"Siddharth Rath (sirath)" <sirath@cisco.com> writes:
> Surprisingly .s.PGSQL.5432 file is not getting created in /tmp directory ( I believe this should be created).

No, it shouldn't, because that is associated with the creation of the
Unix socket file, which happens after creation of the TCP socket.

Given that you're seeing a kernel error on attempt to create the TCP
socket, I'm convinced that you're wasting your time thinking about
Postgres-internal conditions.  This is a kernel-level issue and you
need to be inquiring into what state the kernel is in that is making
it reject the bind().

            regards, tom lane

Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
"Siddharth Rath (sirath)"
Date:
Hi Tom,
I don't understand what you meant by "This is a kernel-level issue and you need to be inquiring ..." . If you please
tellme what 
and how I should enquire and what may be the possible reason for this bind call failure then I can contact our Sysadmin
tohelp me 
out.

Thanx and regards
Sidd


-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Friday, June 04, 2004 10:01 AM
To: sirath@cisco.com
Cc: 'Rob'; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannotassign


"Siddharth Rath (sirath)" <sirath@cisco.com> writes:
> Surprisingly .s.PGSQL.5432 file is not getting created in /tmp
> directory ( I believe this should be created).

No, it shouldn't, because that is associated with the creation of the Unix socket file, which happens after creation of
theTCP 
socket.

Given that you're seeing a kernel error on attempt to create the TCP socket, I'm convinced that you're wasting your
timethinking 
about Postgres-internal conditions.  This is a kernel-level issue and you need to be inquiring into what state the
kernelis in that 
is making it reject the bind().

            regards, tom lane

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


Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
Rob
Date:
Tom Lane wrote:
> "Siddharth Rath (sirath)" <sirath@cisco.com> writes:
>
>>Surprisingly .s.PGSQL.5432 file is not getting created in /tmp directory ( I believe this should be created).
>
>
> No, it shouldn't, because that is associated with the creation of the
> Unix socket file, which happens after creation of the TCP socket.
>
> Given that you're seeing a kernel error on attempt to create the TCP
> socket, I'm convinced that you're wasting your time thinking about
> Postgres-internal conditions.  This is a kernel-level issue and you
> need to be inquiring into what state the kernel is in that is making
> it reject the bind().
>
>             regards, tom lane

You might try to set up a simple web server like thttpd or simpler on
port 5432 and that way you can troubleshoot opening the socket listener
is a more simple environment with possibly some different error
messages. Also you can run a simple perl/python/ruby/java script (like
this http://myclass.missouri.edu/~atb6x2/NETSERV/NS_serverpl.html) to
(try to) open a socket listener on 5432 and have it just sit there.

If you do that the output from strace would be shorter than trying to
start up pg and you might get an idea where the socket problem is.

Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
"Siddharth Rath (sirath)"
Date:
Hi Rob,
I did run the script from http://myclass.missouri.edu/~atb6x2/NETSERV/NS_serverpl.html and it didn't give any error and
theO/P of 
netstat -plunta | grep 5432
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      9481/perl
udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -

But I don't understand why I cant bind to the same port thru POSTGRES. Please let me know what to do now to resolve
this.

Thanx and regards
Sidd


-----Original Message-----
From: Rob [mailto:pgadmin@itsbeen.sent.com]
Sent: Friday, June 04, 2004 11:11 AM
To: sirath@cisco.com; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannotassign


Tom Lane wrote:
> "Siddharth Rath (sirath)" <sirath@cisco.com> writes:
>
>>Surprisingly .s.PGSQL.5432 file is not getting created in /tmp
>>directory ( I believe this should be created).
>
>
> No, it shouldn't, because that is associated with the creation of the
> Unix socket file, which happens after creation of the TCP socket.
>
> Given that you're seeing a kernel error on attempt to create the TCP
> socket, I'm convinced that you're wasting your time thinking about
> Postgres-internal conditions.  This is a kernel-level issue and you
> need to be inquiring into what state the kernel is in that is making
> it reject the bind().
>
>             regards, tom lane

You might try to set up a simple web server like thttpd or simpler on
port 5432 and that way you can troubleshoot opening the socket listener
is a more simple environment with possibly some different error
messages. Also you can run a simple perl/python/ruby/java script (like
this http://myclass.missouri.edu/~atb6x2/NETSERV/NS_serverpl.html) to
(try to) open a socket listener on 5432 and have it just sit there.

If you do that the output from strace would be shorter than trying to
start up pg and you might get an idea where the socket problem is.


Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
Rob
Date:
Siddharth Rath (sirath) wrote:
> Hi Rob,
> I did run the script from http://myclass.missouri.edu/~atb6x2/NETSERV/NS_serverpl.html and it didn't give any error
andthe O/P of 
> netstat -plunta | grep 5432
> (Not all processes could be identified, non-owned process info
>  will not be shown, you would have to be root to see it all.)
> tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
> tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      9481/perl
> udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -
>
> But I don't understand why I cant bind to the same port thru POSTGRES. Please let me know what to do now to resolve
this.
>
> Thanx and regards
> Sidd

OK, well given that that starts up (you ran it under the same user id
that you are running pg with, right?), you should (kill that perl
script) then try to start up pg under strace, that will give the
clearest indication of what is going wrong. If you use :

strace -f -e trace=network /usr/local/pgsql/bin... > s.out 2> s.err

it might reduce the amount of output from strace but try :
strace -f /usr/local/pgsql/bin... > s.out 2> s.err

also. If you have a web site where you can post the files and then
include the URL in your replies that might be better than trying cut &
paste parts of the output to the mailing list if the output is long (the
network one might be nice and short and contain the troublesome system
calls and responses if you are lucky).

Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
"Siddharth Rath (sirath)"
Date:
Hi Rob,
Please find the output of "strace -f /apps/systran/postgresql/bin/pg_ctl start -D /apps/systran/postgresql/data-linux >
s.out2> 
s.err"  in the below provided URLs:

http://us.f2.yahoofs.com/bc/40c0ea30_116c8/bc/My+Documents/s.err.err?bfd6OwABBgQwEsbt

http://us.f2.yahoofs.com/bc/40c0ea30_116c8/bc/My+Documents/s.out.out?bfd6OwABCrTeXvUl

I couldnot understand much of the s.err messages. It will be great if you please spare some time to go thru the same
andadvise me 
how to proceed from here.

Thanx and regards
Sidd


-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Rob
Sent: Friday, June 04, 2004 1:37 PM
To: sirath@cisco.com
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannotassign


Siddharth Rath (sirath) wrote:
> Hi Rob,
> I did run the script from
> http://myclass.missouri.edu/~atb6x2/NETSERV/NS_serverpl.html and it
> didn't give any error and the O/P of netstat -plunta | grep 5432 (Not
> all processes could be identified, non-owned process info  will not be shown, you would have to be root to see it
all.)
> tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
> tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      9481/perl
> udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -
>
> But I don't understand why I cant bind to the same port thru POSTGRES.
> Please let me know what to do now to resolve this.
>
> Thanx and regards
> Sidd

OK, well given that that starts up (you ran it under the same user id
that you are running pg with, right?), you should (kill that perl
script) then try to start up pg under strace, that will give the
clearest indication of what is going wrong. If you use :

strace -f -e trace=network /usr/local/pgsql/bin... > s.out 2> s.err

it might reduce the amount of output from strace but try : strace -f /usr/local/pgsql/bin... > s.out 2> s.err

also. If you have a web site where you can post the files and then
include the URL in your replies that might be better than trying cut &
paste parts of the output to the mailing list if the output is long (the
network one might be nice and short and contain the troublesome system
calls and responses if you are lucky).

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
Rob
Date:
Siddharth Rath (sirath) wrote:

> Hi Rob,
> Please find the output of "strace -f /apps/systran/postgresql/bin/pg_ctl start -D /apps/systran/postgresql/data-linux
>s.out 2> 
> s.err"  in the below provided URLs:
>
> http://us.f2.yahoofs.com/bc/40c0ea30_116c8/bc/My+Documents/s.err.err?bfd6OwABBgQwEsbt
>
> http://us.f2.yahoofs.com/bc/40c0ea30_116c8/bc/My+Documents/s.out.out?bfd6OwABCrTeXvUl
>
> I couldnot understand much of the s.err messages. It will be great if you please spare some time to go thru the same
andadvise me 
> how to proceed from here.
>
> Thanx and regards
> Sidd
>
>
> -----Original Message-----
> From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Rob
> Sent: Friday, June 04, 2004 1:37 PM
> To: sirath@cisco.com
> Cc: pgsql-admin@postgresql.org
> Subject: Re: [ADMIN] URGENT : StreamServerPort: bind() failed: Cannotassign
>
>
> Siddharth Rath (sirath) wrote:
>
>>Hi Rob,
>>I did run the script from
>>http://myclass.missouri.edu/~atb6x2/NETSERV/NS_serverpl.html and it
>>didn't give any error and the O/P of netstat -plunta | grep 5432 (Not
>>all processes could be identified, non-owned process info  will not be shown, you would have to be root to see it
all.)
>>tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
>>tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      9481/perl
>>udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -
>>
>>But I don't understand why I cant bind to the same port thru POSTGRES.
>>Please let me know what to do now to resolve this.
>>
>>Thanx and regards
>>Sidd
>
>
> OK, well given that that starts up (you ran it under the same user id
> that you are running pg with, right?), you should (kill that perl
> script) then try to start up pg under strace, that will give the
> clearest indication of what is going wrong. If you use :
>
> strace -f -e trace=network /usr/local/pgsql/bin... > s.out 2> s.err
>
> it might reduce the amount of output from strace but try : strace -f /usr/local/pgsql/bin... > s.out 2> s.err
>
> also. If you have a web site where you can post the files and then
> include the URL in your replies that might be better than trying cut &
> paste parts of the output to the mailing list if the output is long (the
> network one might be nice and short and contain the troublesome system
> calls and responses if you are lucky).

Looks like it could be an IP address issues:

bind(3, {sa_family=AF_INET, sin_port=htons(5432),
sin_addr=inet_addr("64.102.22.156")}, 16) = -1 EADDRNOTAVAIL (Cannot
assign requested address)
write(2, "LOG:  StreamServerPort: bind() f"..., 163) = 163
write(2, "/apps/systran/postgresql/bin/pos"..., 41) = 41
write(2, "cannot create INET stream port", 30) = 30
write(2, "\n", 1)                       = 1
unlink("/apps/systran/postgresql/data-linux/postmaster.pid") = 0
exit_group(1)                           = ?
Process 9912 detached

try just having the tcp socket run on 127.0.0.1 starters and see if you
get the same msg...

What does your ifconfig -a look like?

Re: URGENT : StreamServerPort: bind() failed: Cannotassign

From
Erwan Arzur
Date:
Rob said:
> bind(3, {sa_family=AF_INET, sin_port=htons(5432),
> sin_addr=inet_addr("64.102.22.156")}, 16) = -1 EADDRNOTAVAIL (Cannot

Looks like you're trying to tell postgres to listen on an IP address
your computer is not configured for :

Siddharth said:

> The O/P of >netstat -plunt | grep 5432
>
>  (Not all processes could be identified, non-owned process info  will
>  not be shown, you would have to be root to see it all.)
>  tcp        0      0 0.0.0.0:54320           0.0.0.0:*               LISTEN      -
>  udp        0      0 0.0.0.0:54321           0.0.0.0:*                           -
>
>  And O/P of netstat -ranv
>
>  Kernel IP routing table
>  Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
>  10.83.103.0     0.0.0.0         255.255.255.192 U         0 0          0 eth2
>  64.102.29.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
>  169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth2
>  127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
>  0.0.0.0         64.102.29.1     0.0.0.0         UG        0 0          0 eth0
>

There's no network matching 64.102.22.156 in your routing table ...

Check your configuration file.