Percona toolkit execution failure

The attempts to run Percona toolkit programs are failing with following error, for example:
$ pt-heartbeat …

install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
Compilation failed in require at (eval 37) line 3, line 1.

at /usr/bin/pt-heartbeat line 2964.
$

That happens on:
OS: AlmaLinux 9
Perl: This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-thread-multi
DBM: perl-DBD-MySQL.x86_64 1:4.050-4.el9 @pdps-8.0.36-release-x86_64
Percona toolkit: pt-heartbeat 3.6.0

Can anybody please advise on this matter?
With regards
Leszek Kotzian

Hello @Leszek_Kotzian,
AlmaLinux is not one of our supported operating systems. However, it looks like you need to install perl DBD::mysql from our repo, and update dbd::mysql to the latest versions. This is not an issue with pt-heartbeat, but an issue with your perl install.

I’m having the same issue with Alma 9, and using the version of the perl module from the pt release repository: perl-DBD-MySQL-1:4.050-5.el9.x86_64

I’m also having the same issue with Alma 9. If I use the version of the module from the Percona-Toolkit repository, it fails. If I use the stock alma 9 appstream version, it works.

]# yum install https://repo.almalinux.org/almalinux/9/AppStream/x86_64/os/Packages/perl-DBD-MySQL-4.050-13.el9.x86_64.rpm
Repository 'Percona-Toolkit' is missing name in configuration, using id.
Last metadata expiration check: 1:25:29 ago on Fri 06 Dec 2024 08:25:07 AM EST.
perl-DBD-MySQL-4.050-13.el9.x86_64.rpm                                                             2.2 MB/s | 145 kB     00:00
Dependencies resolved.
===================================================================================================================================
 Package                           Architecture              Version                         Repository                       Size
===================================================================================================================================
Downgrading:
 perl-DBD-MySQL                    x86_64                    4.050-13.el9                    @commandline                    145 k

Transaction Summary
===================================================================================================================================
Downgrade  1 Package

# pt-show-grants
-- Grants dumped by pt-show-grants
-- Dumped from server Localhost via UNIX socket, MySQL 11.4.4-MariaDB-log at 2024-12-06 09:51:11

I have the same issue with 3.7 in my case we were using the docker configuration
https://raw.githubusercontent.com/percona/percona-docker/main/percona-toolkit/Dockerfile

The issue is likely related to the MariaDB client library that is installed by default instead of MySQL’s. Please install percona-server-client package from Percona repository.

Please also ensure you have DBD::MySQL installed. Better to install the latest version from the Percona repository too.

The reason for the issue was an outdated DBD::MySQL package in Percona repositories, thus broken Docker images. It has been fixed as part of Jira Please try again and let us know if you hit any issue with updated images.

Thank you very much for reporting this issue!

I’m getting this problem since I pulled the latest percona/percona-toolkit docker image.

Whatever last version I had, it was able to connect to the current percona:8.0 MySQL instance, using a .sock file.

The output was saying there was a new version, so I pulled the latest version (of the toolkit), and now I get this:

install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
Compilation failed in require at (eval 36) line 3.

at /usr/bin/pt-variable-advisor line 2092.

The host is AlmaLinux, but I’d think it doesn’t make any difference, since it’s on Docker?

Same for pt-online-schema-change:

Cannot connect to MySQL: install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted.
Compilation failed in require at (eval 37) line 3.

at /usr/bin/pt-online-schema-change line 2345.
18 at /usr/bin/pt-online-schema-change line 8918.

Sorry - just read your last reply here better. Yeah, doesn’t seem fixed for me! I’m using the latest version. See my reply above.

perconalab/percona-toolkit doesn’t seem to have this problem.

Which should I be using??

perconalab/percona-toolkit, or percona/percona-toolkit ?

perconalab/percona-toolkit was updated 23 days ago
percona/percona-toolkit was updated 22 days ago

Are they not the same thing?

Thank you.

EDIT - looks like perconalab/percona-toolkit is running 3.5.2, while the other runs 3.7.0. That could explain why the lab one doesn’t crash. The driver error is a regression in recent versions.

Also doesn’t crash in percona/percona-toolkit:3.6

Could you please try with percona/percona-toolkit:3.7.0 and perconalab/percona-toolkit:3.7.0? They work for me:

sveta@s76:~/src/sveta$ docker run -it percona/percona-toolkit:3.7.0 bash
bash-5.1$ pt-align --version
pt-align 3.7.0
bash-5.1$ pt-heartbeat -D test --update h=127.0.0.1,P=12345,u=msandbox,p=msandbox
DBI connect('test;host=127.0.0.1;port=12345;mysql_read_default_group=client','msandbox',...) failed: Can't connect to MySQL server on '127.0.0.1:12345' (111) at /usr/bin/pt-heartbeat line 3043.
bash-5.1$ exit
exit
sveta@s76:~/src/sveta$ docker run -it perconalab/percona-toolkit:3.7.0 bash
bash-5.1$ pt-align --version
pt-align 3.7.0
bash-5.1$ pt-heartbeat -D test --update h=127.0.0.1,P=12345,u=msandbox,p=msandbox
DBI connect('test;host=127.0.0.1;port=12345;mysql_read_default_group=client','msandbox',...) failed: Can't connect to MySQL server on '127.0.0.1:12345' (111) at /usr/bin/pt-heartbeat line 3043.
bash-5.1$ 

Thank you.
percona/percona-toolkit:3.7.0 seems to work.
Something wrong with the default/latest tag, then.