dbiproxy connection failure...
dbiproxy connection failure...
am 12.09.2005 18:14:07 von mason
Hi, all! I'm not finding anything on the web about this, so I'm hoping
someone here can help.
I'm trying to use dbiproxy with PostgreSQL. I'm running Debian Sarge/i386,
and the Perl, DBI, and PostgreSQL that come with it. (Perl 5.8.4, DBI 1.46,
PostgreSQL 7.4.7)
My test script looks like this:
use DBI;
my $dsn = "DBI:Pg:dbname=decks";
my $proxy = "hostname=goliath;port=3333";
my $dbh = DBI->connect("DBI:Proxy:$proxy;dsn=$dsn", 'mason', 'test');
$dbh and $dbh->disconnect();
print "Connecting directly.\n";
$dbh = DBI->connect("$dsn", "mason", "test");
$dbh and $dbh->disconnect();
I can connect to the database using $dsn directly, and I can connect using
psql, but dbiproxy logs this when I try to connect using it:
Sep 9 16:50:27 goliath DBI::ProxyServer[17108]: Error while connecting to DBI:P
g:dbname=decks as mason: DBI::ProxyServer connect('dbname=decks','mason',...)
failed: FATAL: IDENT authentication failed for user "mason" [err=1,state=S1000
] at /usr/bin/dbiproxy line 24
Sep 9 16:50:27 goliath DBI::ProxyServer[17108]: Refusing client
Can someone suggest to me what's happening to cause this?
FWIW, I've got identd running through inetd, in case that's what it wants,
but I'm guessing it's not.
Here's my proxy config:
{
facility => 'daemon',
pidfile => '/tmp/dbiproxy.pid',
user => 'nobody',
group => 'nogroup',
localport => '3333',
mode => 'fork',
clients => [
{
mask => '.*',
accept => 1,
users => [ 'mason' ]
}
]
}
Thanks in advance for clues!
PS: This isn't an issue with the database itself. I can connect to that, and
in fact I get my error message even if the database is not actually running.
--
Mason Loring Bliss mason@blisses.org http://blisses.org/
"I am a brother of jackals, and a companion of ostriches." (Job 30 : 29)
Re: dbiproxy connection failure...
am 12.09.2005 18:40:35 von mason
On Mon, Sep 12, 2005 at 12:14:07PM -0400, Mason Loring Bliss wrote:
> I can connect to the database using $dsn directly, and I can connect using
> psql, but dbiproxy logs this when I try to connect using it:
FWIW, I get more when I log to the terminal, instead of syslog:
Mon Sep 12 12:37:03 2005 err, 1, Error while connecting to DBI:Pg:dbname=oracle as mason: DBI::ProxyServer connect('dbname=oracle','mason',...) failed: FATAL: IDENT authentication failed for user "mason"
[err=1,state=S1000] at /usr/lib/perl5/DBI.pm line 604 thread 1
DBI::__ANON__('undef', 'undef') called at /usr/lib/perl5/DBI.pm line 660 thread 1
DBI::connect('DBI::ProxyServer', 'DBI:Pg:dbname=oracle', 'mason', 'testing', 'HASH(0x85947e8)') called at /usr/lib/perl5/DBI/ProxyServer.pm line 200 thread 1
eval {...} called at /usr/lib/perl5/DBI/ProxyServer.pm line 189 thread 1
DBI::ProxyServer::AcceptUser('DBI::ProxyServer=HASH(0x839f69 c)', 'mason', 'testing') called at /usr/share/perl5/RPC/PlServer.pm line 171 thread 1
RPC::PlServer::Accept('DBI::ProxyServer=HASH(0x839f69c)') called at /usr/share/perl5/Net/Daemon.pm line 506 thread 1
eval {...} called at /usr/share/perl5/Net/Daemon.pm line 505 thread 1
Net::Daemon::HandleChild('DBI::ProxyServer=HASH(0x839f69c)') called at /usr/share/perl5/Net/Daemon.pm line 466 thread 1
Net::Daemon::__ANON__('DBI::ProxyServer=HASH(0x839f69c)', 'HandleChild') called at /usr/share/perl5/Net/Daemon.pm line 468 thread 1
eval {...} called at /usr/share/perl5/Net/Daemon.pm line 468 thread 1
Mon Sep 12 12:37:03 2005 err, 1, Refusing client
Thanks in advance for clues!
--
/\
Mason Loring Bliss /()\ http://blisses.org/
Squeak to me of love! / \ mason@blisses.org
Re: dbiproxy connection failure...
am 12.09.2005 19:11:11 von HMerrill
I'm taking a wild guess here since it's been a long time since I've used
dbiproxy and/or PostgreSQL - going by the error message
failed: FATAL: IDENT authentication failed for user "mason"
I'd say that your connection string user name/password was rejected by
Postgres. I've found PostgreSQL's authentication can be rather tricky
to get working right.
Hardy Merrill
>>> Mason Loring Bliss 9/12/2005 12:40:35 PM >>>
On Mon, Sep 12, 2005 at 12:14:07PM -0400, Mason Loring Bliss wrote:
> I can connect to the database using $dsn directly, and I can connect
using
> psql, but dbiproxy logs this when I try to connect using it:
FWIW, I get more when I log to the terminal, instead of syslog:
Mon Sep 12 12:37:03 2005 err, 1, Error while connecting to
DBI:Pg:dbname=oracle as mason: DBI::ProxyServer
connect('dbname=oracle','mason',...) failed: FATAL: IDENT
authentication failed for user "mason"
[err=1,state=S1000] at /usr/lib/perl5/DBI.pm line 604 thread 1
DBI::__ANON__('undef', 'undef') called at /usr/lib/perl5/DBI.pm
line 660 thread 1
DBI::connect('DBI::ProxyServer', 'DBI:Pg:dbname=oracle',
'mason', 'testing', 'HASH(0x85947e8)') called at
/usr/lib/perl5/DBI/ProxyServer.pm line 200 thread 1
eval {...} called at /usr/lib/perl5/DBI/ProxyServer.pm line 189
thread 1
DBI::ProxyServer::AcceptUser('DBI::ProxyServer=HASH(0x839f69 c)',
'mason', 'testing') called at /usr/share/perl5/RPC/PlServer.pm line 171
thread 1
RPC::PlServer::Accept('DBI::ProxyServer=HASH(0x839f69c)')
called at /usr/share/perl5/Net/Daemon.pm line 506 thread 1
eval {...} called at /usr/share/perl5/Net/Daemon.pm line 505
thread 1
Net::Daemon::HandleChild('DBI::ProxyServer=HASH(0x839f69c)')
called at /usr/share/perl5/Net/Daemon.pm line 466 thread 1
Net::Daemon::__ANON__('DBI::ProxyServer=HASH(0x839f69c)',
'HandleChild') called at /usr/share/perl5/Net/Daemon.pm line 468 thread
1
eval {...} called at /usr/share/perl5/Net/Daemon.pm line 468
thread 1
Mon Sep 12 12:37:03 2005 err, 1, Refusing client
Thanks in advance for clues!
--
/\
Mason Loring Bliss /()\ http://blisses.org/
Squeak to me of love! / \ mason@blisses.org
Re: dbiproxy connection failure...
am 12.09.2005 20:35:01 von mason
On Mon, Sep 12, 2005 at 01:11:11PM -0400, Hardy Merrill wrote:
> I'm taking a wild guess here since it's been a long time since I've used
> dbiproxy and/or PostgreSQL - going by the error message
>
> failed: FATAL: IDENT authentication failed for user "mason"
>
> I'd say that your connection string user name/password was rejected by
> Postgres. I've found PostgreSQL's authentication can be rather tricky
> to get working right.
You are precisely correct. The issue was clouded by DBI::ProxyServer
returning a "user not authenticated" when the database was in fact not
running at all, but it was the case.
FWIW, the issue involved "ident sameuser" in /etc/postgresql/pg_hba.conf
muffing authentication by requiring that the user making the connection
match the database user in question. I think. In any event, trusting
locally-originated connections solved the problem.
Thank you kindly for your assistance!
--
Mason Loring Bliss mason@blisses.org Rot-180: oN hes +snf
http://blisses.org/ awake ? sleep : random() & 2 ? dream : sleep;