Обсуждение: BUG #2642: Connection problems without IPv6
The following bug has been logged online: Bug reference: 2642 Logged by: Christoph Zwerschke Email address: cito@online.de PostgreSQL version: 8.1.4 Operating system: Win XP Description: Connection problems without IPv6 Details: I am using PostgreSQL 8.1.4 on Win XP, installed from the official binary. When I start the PostgreSQL service, and I have my LAN network interface activated with TCP/IP installed, but IPv6 deinstalled, I cannot connect to the PostgreSQL database. In the log file, I get the following error message: "LOG: could not receive data from client: An operation was attempted on something that is not a socket." This problem does *not* happen if: - the LAN network interface is deactivated or - the TCP/IP protocol is deactivated or - the TCP/IP protocol is activated, and TCP/IP v6 protocol is installed (must not be activated) It happens only if: - the LAN network interface is activated and - the TCP/IP protocol is activated and - the TCP/IP v6 protocol is not installed If this problem cannot be fixed, it should at least be mentioned in the Windows FAQ (http://pginstaller.projects.postgresql.org/faq/FAQ_windows.html) .
"Christoph Zwerschke" <cito@online.de> writes: > It happens only if: > - the LAN network interface is activated and > - the TCP/IP protocol is activated and > - the TCP/IP v6 protocol is not installed Perhaps you have a name server that is reporting only an IPv6 address for your machine? Turning off the LAN prevents contacting that server? regards, tom lane
Tom Lane wrote: > Perhaps you have a name server that is reporting only an IPv6 > address for your machine? Turning off the LAN prevents contacting > that server? No, and I'm using only localhost as address, i.e. I am contacting localhost, and I have listen_addresses = localhost in postgresql.conf. My name server does not resolve internal names (I'm using LMHOSTS). All other programs do work with that configuration (i.e. IPv6 uninstalled). However, I just noticed that when I stop the DNS client (caching) service, then the problem disappears as well. Strange. -- Christoph
Some more infos: When I start and stop the postgres service, then very rarely it happens that it works, particularly when I start and stop some other services as well, such as the DNS caching client. But it is not reproducible. Maybe a timing issue? Can anybody reproduce this problem on Win XP? When I switched on as much debug info in the log as possible, here is what I got: 2006-09-22 12:39:55 LOG: 00000: transaction ID wrap limit is 2147484148, limited by database "postgres" 2006-09-22 12:39:55 LOCATION: SetTransactionIdLimit, varsup.c:234 2006-09-22 12:39:55 DEBUG: 00000: proc_exit(0) 2006-09-22 12:39:55 LOCATION: proc_exit, ipc.c:95 2006-09-22 12:39:55 DEBUG: 00000: shmem_exit(0) 2006-09-22 12:39:55 LOCATION: shmem_exit, ipc.c:126 2006-09-22 12:39:55 DEBUG: 00000: exit(0) 2006-09-22 12:39:55 LOCATION: proc_exit, ipc.c:113 2006-09-22 12:39:55 DEBUG: 00000: reaping dead processes 2006-09-22 12:39:55 LOCATION: reaper, postmaster.c:2021 2006-09-22 12:39:55 DEBUG: 00000: waiting on 2 children 2006-09-22 12:39:55 LOCATION: win32_waitpid, postmaster.c:4046 2006-09-22 12:39:55 DEBUG: 00000: waiting on 3 children 2006-09-22 12:39:55 LOCATION: win32_waitpid, postmaster.c:4046 2006-09-22 12:39:55 DEBUG: 00000: proc_exit(0) 2006-09-22 12:39:55 LOCATION: proc_exit, ipc.c:95 2006-09-22 12:39:55 DEBUG: 00000: shmem_exit(0) 2006-09-22 12:39:55 LOCATION: shmem_exit, ipc.c:126 2006-09-22 12:39:55 DEBUG: 00000: exit(0) 2006-09-22 12:39:55 LOCATION: proc_exit, ipc.c:113 2006-09-22 12:39:55 DEBUG: 00000: reaping dead processes 2006-09-22 12:39:55 LOCATION: reaper, postmaster.c:2021 2006-09-22 12:39:55 DEBUG: 00000: waiting on 4 children 2006-09-22 12:39:55 LOCATION: win32_waitpid, postmaster.c:4046 2006-09-22 12:39:55 DEBUG: 00000: waiting on 3 children 2006-09-22 12:39:55 LOCATION: win32_waitpid, postmaster.c:4046 2006-09-22 12:39:57 DEBUG: 00000: forked new backend, pid=3476 socket=1348 2006-09-22 12:39:57 LOCATION: BackendStartup, postmaster.c:2520 2006-09-22 12:39:57 LOG: 00000: connection received: host=localhost port=1860 2006-09-22 12:39:57 LOCATION: BackendRun, postmaster.c:2699 2006-09-22 12:39:57 localhost(1860) LOG: XX000: could not receive data from client: An operation was attempted on something that is not a socket. 2006-09-22 12:39:57 localhost(1860) LOCATION: pq_recvbuf, pqcomm.c:712 2006-09-22 12:39:57 localhost(1860) LOG: 08P01: incomplete startup packet 2006-09-22 12:39:57 localhost(1860) LOCATION: ProcessStartupPacket, postmaster.c:1351 2006-09-22 12:39:57 localhost(1860) DEBUG: 00000: proc_exit(0) 2006-09-22 12:39:57 localhost(1860) LOCATION: proc_exit, ipc.c:95 2006-09-22 12:39:57 localhost(1860) DEBUG: 00000: shmem_exit(0) 2006-09-22 12:39:57 localhost(1860) LOCATION: shmem_exit, ipc.c:126 2006-09-22 12:39:57 localhost(1860) DEBUG: 00000: exit(0) 2006-09-22 12:39:57 localhost(1860) LOCATION: proc_exit, ipc.c:113 2006-09-22 12:39:58 DEBUG: 00000: reaping dead processes 2006-09-22 12:39:58 LOCATION: reaper, postmaster.c:2021 2006-09-22 12:39:58 DEBUG: 00000: waiting on 4 children 2006-09-22 12:39:58 LOCATION: win32_waitpid, postmaster.c:4046 2006-09-22 12:39:58 DEBUG: 00000: server process (PID 3476) exited with exit code 0 2006-09-22 12:39:58 LOCATION: LogChildExit, postmaster.c:2419 2006-09-22 12:39:58 DEBUG: 00000: waiting on 3 children 2006-09-22 12:39:58 LOCATION: win32_waitpid, postmaster.c:4046
> The following bug has been logged online: >=20 > Bug reference: 2642 > Logged by: Christoph Zwerschke > Email address: cito@online.de > PostgreSQL version: 8.1.4 > Operating system: Win XP > Description: Connection problems without IPv6 > Details:=20 >=20 > I am using PostgreSQL 8.1.4 on Win XP, installed from the=20 > official binary. >=20 > When I start the PostgreSQL service, and I have my LAN=20 > network interface activated with TCP/IP installed, but IPv6=20 > deinstalled, I cannot connect to the PostgreSQL database. In=20 > the log file, I get the following error > message: >=20 > "LOG: could not receive data from client: An operation was=20 > attempted on something that is not a socket." >=20 > This problem does *not* happen if: >=20 > - the LAN network interface is deactivated or > - the TCP/IP protocol is deactivated or > - the TCP/IP protocol is activated, and TCP/IP v6 protocol is=20 > installed (must not be activated) >=20 > It happens only if: >=20 > - the LAN network interface is activated and > - the TCP/IP protocol is activated and > - the TCP/IP v6 protocol is not installed I've never seen any mention at all about this before. Do you have any antivirus or firewall software on this machine? Especially firewall software has a bad habit of breaking regular winsock operations, as we've seen in many different cases... Also, what is the value of listen_addresses in your postgresql.conf? //Magnus
Magnus Hagander wrote: >> The following bug has been logged online: >> ... >> When I start the PostgreSQL service, and I have my LAN >> network interface activated with TCP/IP installed, but IPv6 >> deinstalled, I cannot connect to the PostgreSQL database. In >> the log file, I get the following error >> message: >> >> "LOG: could not receive data from client: An operation was >> attempted on something that is not a socket." >> >> ... >> It happens only if: >> >> - the LAN network interface is activated and >> - the TCP/IP protocol is activated and >> - the TCP/IP v6 protocol is not installed > > I've never seen any mention at all about this before. Do you have any > antivirus or firewall software on this machine? Especially firewall > software has a bad habit of breaking regular winsock operations, as > we've seen in many different cases... > > Also, what is the value of listen_addresses in your postgresql.conf? No, there is no special software except the Win XP firewall, but it happens even if it switched off. I had all other services and software deactivated, it happened anyway. It tried various values for listen_address including 'localhost' and '127.0.0.1.', but it did not matter. It also happens when listen_address is not set at all (which defaults to localhost I guess). That means if you simply install PostgreSQL on Windows XP under the above conditions (LAN interface active, TCP/IP active, TCP/IP 6 not installed), then in the last phase of the installation where the installer tries to connect to the database to install some extensions, it fails already. netstat -anb shows: TCP 127.0.0.1:5432 0.0.0.0:0 LISTEN [postmaster.exe] Is here anybody with Win XP who can confirm that behavior? -- Christoph