"expected authentication request from server, but received..."

Lists: pgsql-hackers
From: Michał Jęczalik <pgsql-hackers(at)jeczalik(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: "expected authentication request from server, but received..."
Date: 2005-09-26 07:59:53
Message-ID: Pine.LNX.4.61.0509260949170.27020@samotnia.zagle.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello,

I have a very old postgres 6.4 installation. I'm trying to connect to it
from a fresh, up-to-date Debian-host, but I'm constantly getting (from DBI
and PHP as well) this error message:

# ./update_dns.pl
DBI connect('dbname=dns;host=sql;authtype=password','dns',...) failed:
expected authentication request from server, but received U
at ./update_dns.pl line 237

Connection with psql works OK. Connecting from different (older) hosts
with DBI/PHP works perfect as well. Something must have changed in recent
versions of libpq and now it doesn't work. I looked into source code and
found that the server's message at the very start of conversation appears
to be something else than the libpq expects. But how to fix it?! Has the
protocol change or what?

P.S. Don't tell me to upgrade postgres :) It must stay like that for some
reasons which are beyond me.
--
Samotnik Michał Jęczalik, +48.695.64.75.14
www.zagle.org.pl - rejsy morskie


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Micha? J?czalik <pgsql-hackers(at)jeczalik(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "expected authentication request from server, but received..."
Date: 2005-09-26 08:16:06
Message-ID: 20050926081601.GB25578@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Sep 26, 2005 at 09:59:53AM +0200, Micha? J?czalik wrote:
> Connection with psql works OK. Connecting from different (older) hosts
> with DBI/PHP works perfect as well. Something must have changed in recent
> versions of libpq and now it doesn't work. I looked into source code and
> found that the server's message at the very start of conversation appears
> to be something else than the libpq expects. But how to fix it?! Has the
> protocol change or what?

Umm, I think the protocol version is up to 3 or 4 now. I think libpq
supports all the way back to 7.0, I don't know if anyone tests earlier
than that.

If you really need this to work, I suggest pulling the libpq from that
release (CVS or tarball) or slightly later and installing that on the
new machines.

But you should upgrade, 6.4 hasn't had support for year, who know how
many bugs...
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


From: Michal Jeczalik <pgsql-hackers(at)jeczalik(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "expected authentication request from server, but
Date: 2005-09-26 08:28:48
Message-ID: Pine.LNX.4.61.0509261023170.27020@samotnia.zagle.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 26 Sep 2005, Martijn van Oosterhout wrote:

> On Mon, Sep 26, 2005 at 09:59:53AM +0200, Micha? J?czalik wrote:
>> Connection with psql works OK. Connecting from different (older) hosts
>> with DBI/PHP works perfect as well. Something must have changed in recent
>> versions of libpq and now it doesn't work. I looked into source code and
>> found that the server's message at the very start of conversation appears
>> to be something else than the libpq expects. But how to fix it?! Has the
>> protocol change or what?
>
> Umm, I think the protocol version is up to 3 or 4 now. I think libpq
> supports all the way back to 7.0, I don't know if anyone tests earlier
> than that.
>
> If you really need this to work, I suggest pulling the libpq from that
> release (CVS or tarball) or slightly later and installing that on the
> new machines.

Heh, that's what I'm currently doing, but it's not so easy to compile 6.4
on a new system. configure states that the compiler cannot create
executables, but I ripped this check out of it. Anyway, something goes
wrong while generating the Makefile:

sed: file conftest.s1 line 33: unterminated `s' command
creating backend/catalog/genbki.sh
sed: file conftest.s1 line 33: unterminated `s' command
creating backend/utils/Gen_fmgrtab.sh
sed: file conftest.s1 line 33: unterminated `s' command
creating bin/pg_dump/Makefile
sed: file conftest.s1 line 33: unterminated `s' command
creating bin/pg_version/Makefile
sed: file conftest.s1 line 33: unterminated `s' command

:(
--
Samotnik Michał Jęczalik, +48.695.64.75.14
www.zagle.org.pl - rejsy morskie


From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Michal Jeczalik" <pgsql-hackers(at)jeczalik(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: "expected authentication request from server, but
Date: 2005-09-26 08:50:16
Message-ID: 006501c5c277$518e8a80$d801a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Michal Jeczalik wrote:

> On Mon, 26 Sep 2005, Martijn van Oosterhout wrote:
>
>> On Mon, Sep 26, 2005 at 09:59:53AM +0200, Micha? J?czalik wrote:
>>> Connection with psql works OK. Connecting from different (older) hosts
>>> with DBI/PHP works perfect as well. Something must have changed in
>>> recent
>>> versions of libpq and now it doesn't work. I looked into source code and
>>> found that the server's message at the very start of conversation
>>> appears
>>> to be something else than the libpq expects. But how to fix it?! Has the
>>> protocol change or what?
>>
>> Umm, I think the protocol version is up to 3 or 4 now. I think libpq
>> supports all the way back to 7.0, I don't know if anyone tests earlier
>> than that.
>>
>> If you really need this to work, I suggest pulling the libpq from that
>> release (CVS or tarball) or slightly later and installing that on the
>> new machines.
>
> Heh, that's what I'm currently doing, but it's not so easy to compile 6.4
> on a new system. configure states that the compiler cannot create
> executables, but I ripped this check out of it. Anyway, something goes
> wrong while generating the Makefile:

Try to compile 7.0 or 7.1, those versions will probably still support the
6.4 wire protocol. I am sure someone with more historical knowledge (or
reading the release notes back to 6.4) can exactly tell you the latest
version compatible with 6.4.

It was already said, but please -- upgrade. Any version before 7.2 is going
to eat your data after a certain amount of transactions.

Best Regards,
Michael Paesold


From: Michal Jeczalik <psql-hackers(at)jeczalik(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "expected authentication request from server, but
Date: 2005-09-26 09:34:40
Message-ID: Pine.LNX.4.61.0509261132510.27020@samotnia.zagle.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 26 Sep 2005, Michael Paesold wrote:

>>>> to be something else than the libpq expects. But how to fix it?! Has the
>>>> protocol change or what?
>>>
>>> Umm, I think the protocol version is up to 3 or 4 now. I think libpq
>>> supports all the way back to 7.0, I don't know if anyone tests earlier
>>> than that.
>>>
>>> If you really need this to work, I suggest pulling the libpq from that
>>> release (CVS or tarball) or slightly later and installing that on the
>>> new machines.
>>
>> Heh, that's what I'm currently doing, but it's not so easy to compile 6.4
>> on a new system. configure states that the compiler cannot create
>> executables, but I ripped this check out of it. Anyway, something goes
>> wrong while generating the Makefile:
>
> Try to compile 7.0 or 7.1, those versions will probably still support the 6.4
> wire protocol. I am sure someone with more historical knowledge (or reading
> the release notes back to 6.4) can exactly tell you the latest version
> compatible with 6.4.

OK. It worked with 7.4 + DBD not newer than 1.22 - more recent versions
simply make perl to dump core while connecting to postgres. ;)
--
Samotnik Michał Jęczalik, +48.695.64.75.14
www.zagle.org.pl - rejsy morskie


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michał Jęczalik <pgsql-hackers(at)jeczalik(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "expected authentication request from server, but received..."
Date: 2005-09-26 13:32:26
Message-ID: 23882.1127741546@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

=?iso-8859-2?Q?Micha=B3_J=EAczalik?= <pgsql-hackers(at)jeczalik(dot)com> writes:
> I have a very old postgres 6.4 installation. I'm trying to connect to it
> from a fresh, up-to-date Debian-host, but I'm constantly getting (from DBI
> and PHP as well) this error message:

> # ./update_dns.pl
> DBI connect('dbname=dns;host=sql;authtype=password','dns',...) failed:
> expected authentication request from server, but received U
> at ./update_dns.pl line 237

You certain it's 6.4, and not even older? A look in the CVS logs says
that we were using protocol 2.0 starting in 6.4, so current libpq should
still talk to it.

> P.S. Don't tell me to upgrade postgres :) It must stay like that for some
> reasons which are beyond me.

6.4 *will* eat your data eventually. Don't say you weren't warned.

regards, tom lane


From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Michal Jeczalik <pgsql-hackers(at)jeczalik(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "expected authentication request from server, but
Date: 2005-09-26 14:08:35
Message-ID: 20050926140835.GB5408@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Sep 26, 2005 at 10:28:48AM +0200, Michal Jeczalik wrote:

> Heh, that's what I'm currently doing, but it's not so easy to compile 6.4
> on a new system. configure states that the compiler cannot create
> executables, but I ripped this check out of it. Anyway, something goes
> wrong while generating the Makefile:
>
> sed: file conftest.s1 line 33: unterminated `s' command

I bet this is the multiline gcc --version. You could try wrapping gcc
with a script that returns a single line --version. (Or maybe using an
older gcc release.)

--
Alvaro Herrera http://www.PlanetPostgreSQL.org
"World domination is proceeding according to plan" (Andrew Morton)


From: Michal Jeczalik <pgsql-hackers(at)jeczalik(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "expected authentication request from server, but
Date: 2005-09-26 15:32:54
Message-ID: Pine.LNX.4.61.0509261728350.1932@samotnia.zagle.org.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 26 Sep 2005, Tom Lane wrote:

> =?iso-8859-2?Q?Micha=B3_J=EAczalik?= <pgsql-hackers(at)jeczalik(dot)com> writes:
>> I have a very old postgres 6.4 installation. I'm trying to connect to it
>> from a fresh, up-to-date Debian-host, but I'm constantly getting (from DBI
>> and PHP as well) this error message:
>
>> # ./update_dns.pl
>> DBI connect('dbname=dns;host=sql;authtype=password','dns',...) failed:
>> expected authentication request from server, but received U
>> at ./update_dns.pl line 237
>
> I went back and built the 6.4 branch just to confirm that current libpq
> and psql would still talk to a 6.4 server. They do (modulo most of
> psql's \d commands not working). So there's something more here than a
> simple version mismatch. Is it possible that DBI is using some private
> all-Perl client library rather than libpq to talk to the server?

Quite possible. I managed to compile 7.4 and that error message
disappeared. Anyway, perl dumped core at the very start of the connection.
;) I downgraded DBD::Pg to 1.22 and... it worked! I did not try to upgrade
libpq back to 8.x, but... PHP didn't worked as well with recent version of
libs... After downgrading to 7.4 it worked fine. So there must be
something about libpq anyway.

Regards,
--
Samotnik Michał Jęczalik, +48.695.64.75.14
www.zagle.org.pl - rejsy morskie