Percona-toolkit seems incompatible with mac os sonoma

I am using percona-toolkit 3.5.5 but having updated to mac os sonoma, running pt-online-schema-change produces the following error message:

DBI.c: loadable library and perl binaries are mismatched (got handshake key 0xc700080, needed 0xfb80080)

I am using the version of Perl (5.30.3) that is bundled with mac os. I tried the more updated version of perl offered by homebrew (5.38.0) but get the same error message.

Did you also install/update the latest DBD/DBI?

I didn’t actively update DBI but it seems to be the latest:
cpan -D DBI => 1.643

And DBD::mysql? I know there is a newer version in the Percona tools repo that is usually later than most distros.

Thanks matthewb for your help.

DBD::mysql is not installed so that could be the issue. The install fails both on the system version of perl and an perl install from homebrew. I have tried to use perlbrew but running the install of a perl version also fails.

Are you on M1/M2 mac? You might have issues compiling for ARM processors.

I am using an M1. I have another linux box where everything is running smoothly.

You are not the first person who has had issues, in general, with M1/M2 macs and getting software working on them. My co-worker cannot use terraform, for example, because he has an M2 mac and the terraform won’t compile. I’m on an x86 mac and everything works :slight_smile:

I’ve been on an Apple Silicon machine for over a year and just started running into this error over the past week. So it did work.

Attempting to cpan install DBD::mysql gives me the following error which could be the root of the error reported here.

./dbdimp.h:20:10: fatal error: ‘DBIXS.h’ file not found

I am having this issue, but I found a workaround. I’m using homebrew’s perl 5.38, and /usr/bin/perl is 5.30. $ which pt-online-schema-change led me to a file in /opt/homebrew/bin, which calls /opt/homebrew/Cellar/percona-toolkit/3.5.5/libexec/bin/pt-online-schema-change. This file had a shebang of #!/usr/bin/perl5.34; I changed it to #!/usr/bin/perl and now I am able to run pt-online-schema-change successfully.

I’m not an expert on homebrew by any means, but in the formula there is a call to rewrite_shebang that might be misbehaving.

Thank you bassguitarbill. I held off to see if sonoma 14.1 would provide a fix but it did not. Your tweak to the shebang resolved it.

@wwinningham Did you see @bassguitarbill fix above? Does something similar affect you?

Homebrew it outside Percona’s jurisdiction, so any fixes would need to be created and submitted to the Homebrew team.

Thank you bassguitarbill. I held off to see if sonoma 14.1 would provide a fix but it did not. Your tweak to the shebang resolved it.

We do not put #!/usr/bin/perl5.34 into our tools code. Did you install Percona Toolkit from homebrew? Can you try with Percona generic packages (tar.gz) and let us know if tools work?

Worked for me and everyone else at my company, too.

1 Like

I can confirm that the “Generic Linux” version of percona-toolkit works fine; the shebang is #!/usr/bin/env perl. I’m pretty confident that this is an issue with the Homebrew formula, but the code in that formula that mangles the shebang was added intentionally to fix another issue, so I assume it won’t be a trivial fix.

1 Like

Thank you for the test! Please use this workaround for now. We do not officially support MacOS but we will try to figure out what is wrong ourselves too.

1 Like

I believe shebang, specific to Perl version, was introduced as part of fix for Perl upgrade to 5.34.0 breaks cpan: loadable library and perl binaries are mismatched · Issue #77797 · Homebrew/homebrew-core · GitHub. This is kind of generic patch, not related to Percona Toolkit. It should be safe to use the Percona Toolkit with either Perl 5.30 or 5.38, so you can safely change shebang to #!/usr/bin/perl

The issue is fixed. See Percona Toolkit fails on macOS 10.4 due to #!/usr/bin/perl5.34 shebang · Issue #154201 · Homebrew/homebrew-core · GitHub

1 Like