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

Started by Michał Jęczalikover 20 years ago8 messages
#1Michał Jęczalik
pgsql-hackers@jeczalik.com

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

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: Michał Jęczalik (#1)
Re: "expected authentication request from server, but received..."

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@svana.org> http://svana.org/kleptog/

Show quoted text

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.

#3Michal Jeczalik
pgsql-hackers@jeczalik.com
In reply to: Martijn van Oosterhout (#2)
Re: "expected authentication request from server, but

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

#4Michael Paesold
mpaesold@gmx.at
In reply to: Michał Jęczalik (#1)
Re: "expected authentication request from server, but

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

#5Michal Jeczalik
psql-hackers@jeczalik.com
In reply to: Michael Paesold (#4)
Re: "expected authentication request from server, but

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

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michał Jęczalik (#1)
Re: "expected authentication request from server, but received..."

=?iso-8859-2?Q?Micha=B3_J=EAczalik?= <pgsql-hackers@jeczalik.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

#7Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Michal Jeczalik (#3)
Re: "expected authentication request from server, but

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)

#8Michal Jeczalik
pgsql-hackers@jeczalik.com
In reply to: Michał Jęczalik (#1)
Re: "expected authentication request from server, but

On Mon, 26 Sep 2005, Tom Lane wrote:

=?iso-8859-2?Q?Micha=B3_J=EAczalik?= <pgsql-hackers@jeczalik.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