List Info

Thread: 'prepared statement already exists' bug with postgres & mod_authn_dbd




'prepared statement already exists' bug with postgres & mod_authn_dbd
user name
2007-04-09 07:22:59
I am getting a 'prepared statement "authn_dbd_2" already exists'; error while trying to use mod_authn_dbd with postgres ( works fine with mysql ).

PostgreSQL 8.2 log:
LOG:  connection received: host=127.0.0.1 port=38660
LOG:  connection authorized: user=root database=xxxx
ERROR:  prepared statement "authn_dbd_2" already exists
STATEMENT:  PREPARE authn_dbd_2 (varchar,varchar) AS SELECT pwhash FROM principals INNER JOIN users ON principals.resource_id = users.principal_id WHERE name = $1 and name != $2
LOG:  connection received: host= 127.0.0.1 port=38662
LOG:  connection authorized: user=root database=xxxx
ERROR:  prepared statement "authn_dbd_2" already exists
STATEMENT:  PREPARE authn_dbd_2 (varchar,varchar) AS SELECT pwhash FROM principals INNER JOIN users ON principals.resource_id = users.principal_id WHERE name = $1 and name != $2
LOG:  unexpected EOF on client connection
LOG:  unexpected EOF on client connection

apache error_log:
[Mon Apr 09 15:28:23 2007] [notice] Digest: generating secret for digest authentication ...
[Mon Apr 09 15:28:23 2007] [notice] Digest: done
[Mon Apr 09 15:28:48 2007] [error] [client 127.0.0.1] Error looking up xxxx in database

I tried to find out when mod_authn_dbd returns "Error looking up xxx in database" error. In my case, it is being caused by authn_dbd_acquire_fn returning NULL. A related bug has been filed for mysql: 39329

relevant code snippet from mod_authn_dbd.c:
( function authn_dbd_realm )

 ;   ap_dbd_t *dbd = authn_dbd_acquire_fn(r);
 ;   if (dbd == NULL) {
       ; ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
     ;           ;      "Error looking up %s in database", user);
        return AUTH_GENERAL_ERROR;
    }

Here is my setup :
apache 2.2.3 compiled with following flags :
./configure --with-included-apr --enable-auth-digest --enable-so --enable-dav --enable-dbd --enable-authn-dbd --with-pgsql=/usr/local/pgsql

relevant sections of httpd.conf :

DBDriver pgsql
DBDParams "port=5432 host=localhost dbname=xxxx user=root password=xxxx"

DBDMin     1
DBDKeep    1
DBDMax     10
DBDExptime 0

<Location /xxxx>
  DAV repos
&nbsp; ModMimeUsePathInfo on

  AuthType Digest
&nbsp; AuthName "usersxxxx"
  AuthDigestProvider dbd

&nbsp; Require valid-user

  AuthDBDUserRealmQuery "SELECT pwhash FROM principals INNER JOIN users ON principals.resource_id = users.principal_id WHERE name = %s and name != %s"

</Location>

Re: 'prepared statement already exists' bug with postgres & mod_authn_dbd
user name
2007-04-11 01:59:54
Is this a persistent connections problem ? Or a postgres driver issue ? Has anyone been able to use mod_authn_dbd with postgres 8.2 ?

thanks,
Paritosh

On 4/9/07, Paritosh Shah < shah.paritoshgmail.com">shah.paritoshgmail.com> wrote:
I am getting a 'prepared statement "authn_dbd_2&quot; already exists'; error while trying to use mod_authn_dbd with postgres ( works fine with mysql ).

PostgreSQL 8.2 log:
LOG:  connection received: host=127.0.0.1 port=38660
LOG:  connection authorized: user=root database=xxxx
ERROR:&nbsp; prepared statement "authn_dbd_2&quot; already exists
STATEMENT:  PREPARE authn_dbd_2 (varchar,varchar) AS SELECT pwhash FROM principals INNER JOIN users ON principals.resource_id = users.principal_id WHERE name = $1 and name != $2
LOG:&nbsp; connection received: host= 127.0.0.1 port=38662
LOG:  connection authorized: user=root database=xxxx
ERROR:&nbsp; prepared statement "authn_dbd_2&quot; already exists
STATEMENT:&nbsp; PREPARE authn_dbd_2 (varchar,varchar) AS SELECT pwhash FROM principals INNER JOIN users ON principals.resource_id = users.principal_id WHERE name = $1 and name != $2
LOG:&nbsp; unexpected EOF on client connection
LOG:  unexpected EOF on client connection

apache error_log:
[Mon Apr 09 15:28:23 2007] [notice] Digest: generating secret for digest authentication ...
[Mon Apr 09 15:28:23 2007] [notice] Digest: done
[Mon Apr 09 15:28:48 2007] [error] [client 127.0.0.1] Error looking up xxxx in database

I tried to find out when mod_authn_dbd returns "Error looking up xxx in database&quot; error. In my case, it is being caused by authn_dbd_acquire_fn returning NULL. A related bug has been filed for mysql: 39329

relevant code snippet from mod_authn_dbd.c:
( function authn_dbd_realm )

 ; &nbsp; ap_dbd_t *dbd = authn_dbd_acquire_fn(r);
 ; &nbsp; if (dbd == NULL) {
 &nbsp; &nbsp;   ; ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
 &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  "Error looking up %s in database&quot;, user);
&nbsp; &nbsp; &nbsp;   return AUTH_GENERAL_ERROR;
&nbsp;   }

Here is my setup :
apache 2.2.3 compiled with following flags :
./configure --with-included-apr --enable-auth-digest --enable-so --enable-dav --enable-dbd --enable-authn-dbd --with-pgsql=/usr/local/pgsql

relevant sections of httpd.conf :

DBDriver pgsql
DBDParams "port=5432 host=localhost dbname=xxxx user=root password=xxxx"

DBDMin&nbsp; &nbsp;  1
DBDKeep&nbsp;   1
DBDMax&nbsp; &nbsp;  10
DBDExptime 0

<Location /xxxx>
  DAV repos
&nbsp; ModMimeUsePathInfo on

  AuthType Digest
&nbsp; AuthName "usersxxxx"
  AuthDigestProvider dbd

&nbsp; Require valid-user

  AuthDBDUserRealmQuery "SELECT pwhash FROM principals INNER JOIN users ON principals.resource_id = users.principal_id WHERE name = %s and name != %s"

</Location>


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )