[debian-mysql] dbconfig autopkgtests fail: Plugin caching_sha2_password could not be loaded: /usr/lib/aarch64-linux-gnu/mariadb19/plugin/caching_sha2_password.so

Robie Basak robie.basak at ubuntu.com
Wed Aug 26 17:37:42 BST 2020


Hi Otto and Paul,

While this might have been revealed by the upload of MySQL 8, there
isn't a bug in MySQL or its packaging here. The problem is on the client
side not being able to speak to a (reasonably default) MySQL 8 server.
The client implementation is libdbd-mysql-perl which depends on
libmariadb3.

On Sun, Aug 23, 2020 at 01:18:47PM +0300, Otto Kekäläinen wrote:
> failed: Plugin caching_sha2_password could not be loaded:
> /usr/lib/aarch64-linux-gnu/mariadb19/plugin/caching_sha2_password.so:
> cannot open shared object file: No such file or directory at
> /usr/share/dbconfig-common/scripts/db-test-mysql-perl/install/mysql
> line 18

This is being emitted by the following code from
/usr/share/dbconfig-common/scripts/db-test-mysql-perl/install/mysql:

    my $dbh = DBI->connect($dsn, $dbuser, $dbpass);

$dsn there doesn't contain anything MySQL or MariaDB specific that I can
see. So I think the bug is either in libmariadb3 or directly in
libdbd-mysql-perl. I think it is likely to be libmariadb3.

The test does fail only against MySQL at the server end. When MariaDB is
at the server end, as you observed the dep8 test passes. But the failure
is at the client end. The difference is that MySQL defaults to the
caching_sha2_password authentication mechanism, which is part of the
MySQL wire protocol. Looks to me that in this case libmariadb3 attempts
to load its own plugin for the mechanism but it does not exist.

It's not clear to me if MariaDB's client library is supposed to still be
able to connect to MySQL. Whether it is or not, I think its inability to
do so is what's failing here. dbconfig-common has no choice but to use
MariaDB's client library because it uses libdbd-mysql-perl and
libdbd-mysql-perl builds against default-libmysqlclient-dev which is
provided by MariaDB packaging.

If MariaDB (as packaged in Debian) can no longer connect[1] to MySQL, or
at least if libdbd-mysql-perl when built against MariaDB cannot, then I
think we have a wider problem here. But before we go into that, please
could you see if you can confirm my conclusion?

Here's a reproducer:

apt update && apt -y install --no-install-recommends mysql-server libdbd-mysql-perl

mysql <<EOT
CREATE DATABASE testdatabase;
CREATE USER 'testuser'@'localhost' identified by 'testpassword';
GRANT ALL ON testdatabase.* TO 'testuser'@'localhost';
EOT

cat > test.pl <<EOT
#!/usr/bin/perl
use DBI;
my \$dbh = DBI->connect("DBI:mysql:database=testdatabase;host=localhost", "testuser", "testpassword");
EOT

perl test.pl

Expected result:

Silent exit with status 0.

Actual result:

DBI connect('database=testdatabase;host=localhost','testuser',...) failed: Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory at test.pl line 4.

Robie

[1] When authenticating against MySQL users created in their default
configuration
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-mysql-maint/attachments/20200826/93c41d98/attachment.sig>


More information about the pkg-mysql-maint mailing list