Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 821C4B5DBC8 for ; Fri, 17 Jun 2011 06:38:11 -0300 (ADT) 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 32826-06 for ; Fri, 17 Jun 2011 09:38:05 +0000 (UTC) X-Greylist: delayed 00:09:35.140691 by SQLgrey-1.7.6 Received: from morework.geizhals.at (morework.geizhals.at [78.142.138.3]) by mail.postgresql.org (Postfix) with ESMTP id EEAAFB5D803 for ; Fri, 17 Jun 2011 06:38:04 -0300 (ADT) Received: from localhost (morework [127.0.0.1]) by morework.geizhals.at (Postfix) with ESMTP id 3BD751248283 for ; Fri, 17 Jun 2011 11:28:28 +0200 (CEST) X-Virus-Scanned: amavisd-new at geizhals.at Received: from morework.geizhals.at ([127.0.0.1]) by localhost (morework.geizhals.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mxBA2IKo-e+C for ; Fri, 17 Jun 2011 11:28:22 +0200 (CEST) Received: from klump-pc (mjyrouter [213.235.209.145]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mjy) by morework.geizhals.at (Postfix) with ESMTPSA for ; Fri, 17 Jun 2011 11:28:22 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "PostgreSQL Bugs" Date: Fri, 17 Jun 2011 11:28:12 +0200 Subject: Ident authentication fails due to bind error on server (8.4.8) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Marinos Yannikos" Organization: Preisvergleich Internet Services AG Message-ID: User-Agent: Opera Mail/11.11 (Win32) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/142 X-Sequence-Number: 30521 Hi, I'm not sure that this is not a configuration or networking issue (so apologies if it is), but we seem to be getting rare (a few times/day) failures with ident authentication because several clients attempt to do it simultaneously over a high-latency connection (capitalized = edited IPs/username etc.): [DB CLIENTADDR(51985) 3173 2011-06-17 10:49:56 CEST] LOG: could not bind to local address "SERVERADDR": Address already in use [DB CLIENTADDR(51985) 3173 2011-06-17 10:49:56 CEST] FATAL: Ident authentication failed for user "USER" [DB CLIENTADDR(51986) 3183 2011-06-17 10:49:56 CEST] FATAL: no pg_hba.conf entry for host "CLIENTADDR", user "USER", database "DB", SSL off on the client side, we had 2 connection attempts, of which 1 failed (apparently): Jun 17 10:49:53 xxx oidentd[12377]: Connection from SERVER (SERVERADDR):0 Jun 17 10:49:53 xxx oidentd[12377]: [SERVER] Successful lookup: 51980 , 5432 : crm (crm) [Fri Jun 17 10:49:53 2011] [error] [client 127.0.0.1] [Fri Jun 17 10:49:53 2011] kv_tpl.pl: DBI connect('dbname=DB;host=SERVER','USER',...) failed: FATAL: Ident authentication failed for user "USER", referer: URL [Fri Jun 17 10:49:53 2011] [error] [client 127.0.0.1] [Fri Jun 17 10:49:53 2011] kv_tpl.pl: FATAL: no pg_hba.conf entry for host "CLIENTADDR", user "USER", database "DB", SSL off at /var/www/crm/kv_tpl.pl line 100, referer: URL Is this a possible race condition in src/backend/libpq/auth.c ? [note: the client/server clocks are 3 seconds apart at this point, I haven't investigated whether that causes issues here] --- /* * Bind to the address which the client originally contacted, otherwise * the ident server won't be able to match up the right connection. This * is necessary if the PostgreSQL server is running on an IP alias. */ rc = bind(sock_fd, la->ai_addr, la->ai_addrlen); if (rc != 0) { ereport(LOG, (errcode_for_socket_access(), errmsg("could not bind to local address \"%s\": %m", local_addr_s))); ident_return = false; goto ident_inet_done; } --- Regards, Marinos