Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 33472133655C for ; Thu, 9 Dec 2010 19:48:58 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 74043-10 for ; Thu, 9 Dec 2010 23:48:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailout2.pacific.net.au (mailout2-11.pacific.net.au [125.255.80.138]) by mail.postgresql.org (Postfix) with ESMTP id 9D0C313364DE for ; Thu, 9 Dec 2010 19:48:49 -0400 (AST) Received: from [187.65.254.157] (unknown [187.65.254.157]) by mailout2.pacific.net.au (Postfix) with ESMTP id 295E72A8F74; Fri, 10 Dec 2010 10:48:41 +1100 (EST) Subject: Re: Connection Problem From: Rob Stone To: =?UTF-8?Q?Rados=C5=82aw?= Smogura Cc: Dave Cramer , Oliver Jowett , pgsql-jdbc@postgresql.org In-Reply-To: <20101209154347.19402ab3a4rxuttv@softperience.eu> References: <1291728544.3489.28.camel@localhost> <4CFE9095.5090702@opencloud.com> <1291900691.3402.7.camel@roblaptop.localdomain> <20101209154347.19402ab3a4rxuttv@softperience.eu> Content-Type: multipart/mixed; boundary="=-Tl5ULeIwQvd1mtdCp9S+" Date: Fri, 10 Dec 2010 10:48:30 +1100 Message-ID: <1291938510.3900.7.camel@roblaptop.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201012/47 X-Sequence-Number: 21285 --=-Tl5ULeIwQvd1mtdCp9S+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Hi Radek, Output from those commands attached. I always completely shutdown my laptop and pull the plug. So, it is doing a complete cold boot each time. When I try connecting to the database with ExecuteQuery, the same error is returned for both "localhost" and 127.0.0.1, when entering those values as the "host" on the connection dialogue. Via a browser, if I access http://localhost it returns the "It Work's!" output from apache. Thanks to everybody for your help. Cheers, Rob On Thu, 2010-12-09 at 15:43 -0500, Radosław Smogura wrote: > Hi, > > Check with netstat -atnp (it shows the process associated with port), > but psql should be there. > > Do route -n to see routing traces, execute ifconfig next. > > But this can be kernel driver problem. Do you "shut down" laptop by > closing it, I mean do you put it in sleep mode? Maybe you need to > restart network interfaces instead. > > On my PC when I put it on sleep mode, SATA controller doesn't wakes up. > > Kind regards, > Radek Smogura > > Rob, > > > > Have you tried 127.0.0.1 instead of localhost ? It's not that it isn't > > listening, the problem is there is no route to localhost which seems > > strange on it's own. > > > > Dave > > > > On Thu, Dec 9, 2010 at 8:18 AM, Rob Stone wrote: > >> Hi Oliver, > >> > >> Thanks for the reply. > >> > >> Output from netstat shows port 5432 as being listened. Don't know what > >> to try next. > >> > >> Sometimes when I shut down my laptop the "stop" messages are displayed. > >> I noticed last night that pg_ctl could not find the postmaster.pid file, > >> even though PGHOST and PGDATA variables are set. I'm starting it with > >> the -i and -D options with -D pointing explicitly to the PGDATA path > >> using the full path name. Could not finding a postmaster.pid file be > >> linked in any way with my problem?? > >> > >> > >> Cheers, > >> Rob > >> > >> rob@roblaptop:~> netstat -ln --tcp > >> Active Internet connections (only servers) > >> Proto Recv-Q Send-Q Local Address Foreign Address > >> State > >> tcp 0 0 0.0.0.0:22 0.0.0.0:* > >> LISTEN > >> tcp 0 0 127.0.0.1:631 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:5432 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:58112 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:2049 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:44739 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:6566 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:60135 0.0.0.0:* > >> LISTEN > >> tcp 0 0 0.0.0.0:111 0.0.0.0:* > >> LISTEN > >> tcp6 0 0 :::22 :::* > >> LISTEN > >> tcp6 0 0 ::1:631 :::* > >> LISTEN > >> tcp6 0 0 :::5432 :::* > >> LISTEN > >> tcp6 0 0 :::6566 :::* > >> LISTEN > >> tcp6 0 0 :::80 :::* > >> LISTEN > >> rob@roblaptop:~> > >> > >> > >> > >> > >> On Wed, 2010-12-08 at 08:52 +1300, Oliver Jowett wrote: > >>> On 08/12/10 02:29, Rob Stone wrote: > >>> > >>> > Wrote a mickey mouse java class (testdbconn) to see if I could access > >>> > the database and read data from a table that has two rows. See attached. > >>> > When it runs it displays the same SQL error code as ExecuteQuery -- > >>> > 08001 -- which is the "can't connect error". > >>> > >>> You have a network configuration problem of some sort: > >>> > >>> > Caused by: java.net.SocketException: Network is unreachable > >>> > >>> (This isn't "connection refused", it's "I have no configured route to > >>> that address") > >>> > >>> Oliver > >> > >> > >> > >> -- > >> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > >> To make changes to your subscription: > >> http://www.postgresql.org/mailpref/pgsql-jdbc > >> > > > > -- > > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgsql-jdbc > > > > --=-Tl5ULeIwQvd1mtdCp9S+ Content-Disposition: attachment; filename="netstatout.txt" Content-Type: text/plain; name="netstatout.txt"; charset="UTF-8" Content-Transfer-Encoding: 7bit roblaptop:/home/rob# netstat -atnp Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1617/sshd tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2217/cupsd tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1707/postmaster tcp 0 0 0.0.0.0:33308 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:52670 0.0.0.0:* LISTEN 1342/rpc.statd tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:6566 0.0.0.0:* LISTEN 1791/saned tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1330/portmap tcp 0 0 0.0.0.0:60496 0.0.0.0:* LISTEN 1763/rpc.mountd tcp6 0 0 :::22 :::* LISTEN 1617/sshd tcp6 0 0 ::1:631 :::* LISTEN 2217/cupsd tcp6 0 0 :::5432 :::* LISTEN 1707/postmaster tcp6 0 0 :::6566 :::* LISTEN 1791/saned tcp6 0 0 :::80 :::* LISTEN 2335/apache2 roblaptop:/home/rob# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 187.65.240.0 0.0.0.0 255.255.240.0 U 1 0 0 eth0 0.0.0.0 187.65.240.1 0.0.0.0 UG 0 0 0 eth0 roblaptop:/home/rob# roblaptop:/home/rob# ifconfig eth0 Link encap:Ethernet HWaddr 00:a0:d1:7b:f4:e9 inet addr:187.65.254.157 Bcast:187.65.255.255 Mask:255.255.240.0 inet6 addr: fe80::2a0:d1ff:fe7b:f4e9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:210220 errors:0 dropped:0 overruns:0 frame:0 TX packets:139047 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:146987784 (140.1 MiB) TX bytes:56897901 (54.2 MiB) Interrupt:16 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:3084 errors:0 dropped:0 overruns:0 frame:0 TX packets:3084 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:794627 (776.0 KiB) TX bytes:794627 (776.0 KiB) wlan0 Link encap:Ethernet HWaddr 00:13:e8:49:73:69 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) roblaptop:/home/rob# --=-Tl5ULeIwQvd1mtdCp9S+--