Bug 2104822 - unable to load imagemagick-perl module after upgrade
Summary: unable to load imagemagick-perl module after upgrade
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: ImageMagick
Version: epel8
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Luya Tshimbalanga
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-07 08:41 UTC by Sergio
Modified: 2022-07-12 18:28 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-12 18:28:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FC-507 0 None None None 2022-07-12 14:46:24 UTC

Description Sergio 2022-07-07 08:41:54 UTC
Description of problem:
unable to load imagemagick-perl module after upgrade. Previous to the update, it was possible to load the module.

Version-Release number of selected component (if applicable):
perl: 5.26
ImageMagick: 6.9.12.50-2
ImageMagick-libs: 6.9.12.50-2
ImageMagick-perl: 6.9.12.50-2

How reproducible:
always

Steps to Reproduce:
1.perl -MImage::Magick -le 'print Image::Magick->QuantumDepth'


Actual results:
The module is not loaded

Expected results:
the module is loaded

Additional info:

Relevant output of dnf history info LAST_UPGRADE_NUMBER:
Upgrade  ImageMagick-6.9.12.50-2.el8.x86_64                                @epel
Upgraded ImageMagick-6.9.10.86-1.el8.x86_64                                @@System
Upgrade  ImageMagick-libs-6.9.12.50-2.el8.x86_64                           @epel
Upgraded ImageMagick-libs-6.9.10.86-1.el8.x86_64                           @@System
Upgrade  ImageMagick-perl-6.9.12.50-2.el8.x86_64                           @epel
Upgraded ImageMagick-perl-6.9.10.86-1.el8.x86_64                           @@System

Error obtained when trying to load the module:
root@localhost:perl -MImage::Magick -le 'print Image::Magick->QuantumDepth'
Can't load '/usr/local/lib64/perl5/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore-6.Q16.so.6: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 194.
 at -e line 0.
Compilation failed in require.
BEGIN failed--compilation aborted.
&Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly.
END failed--call queue aborted.
root@localhost:ll /usr/local/lib64/perl5/auto/Image/Magick/Magick.so
-r-xr-xr-x. 1 root root 1.1M Nov 28  2020 /usr/local/lib64/perl5/auto/Image/Magick/Magick.so*
root@localhost:ll -d /usr/local/lib64/perl5/auto/Image/Magick
drwxr-xr-x. 3 root root 75 Nov 28  2020 /usr/local/lib64/perl5/auto/Image/Magick/
root@localhost:ll -d /usr/local/lib64/perl5/auto/Image
drwxr-xr-x. 4 root root 32 Nov 29  2020 /usr/local/lib64/perl5/auto/Image/
root@localhost:ll -d /usr/local/lib64/perl5/auto
drwxr-xr-x. 84 root root 4.0K May 31 17:20 /usr/local/lib64/perl5/auto/
root@localhost:ll -d /usr/local/lib64/perl5
drwxr-xr-x. 26 root root 4.0K May 12 23:59 /usr/local/lib64/perl5/
root@localhost:ll -d /usr/local/lib64
drwxr-xr-x. 4 root root 30 Jun 21  2021 /usr/local/lib64/
root@localhost:ll -d /usr/local
drwxr-xr-x. 15 root root 170 Jun 28 22:15 /usr/local/
root@localhost:ll -d /usr
drwxr-xr-x. 14 root root 169 Nov 18  2021 /usr/

Comment 1 Michal Josef Spacek 2022-07-07 14:30:16 UTC
This issue is not related to RHEL, moved to right project.

Comment 2 Sergio Basto 2022-07-12 14:56:23 UTC
Hello 

In resume, it was a configuration mix up that pulled in ALL the modules instead of just the default ones.
It lasted for 72 hours, and we missed the ImageMagick needing a rebuild.
It was just bad timing, nothing I could have done to prevent, or fix it.

Comment 3 Sergio 2022-07-12 15:39:02 UTC
Hello,
after:
dnf clean all
dnf upgrade
dnf reinstall ImageMagick ImageMagick-libs ImageMagick-perl

i keep on getting the same error

Comment 4 Sergio Basto 2022-07-12 16:11:04 UTC
dnf reinstall is to reinstall the same packages 
please use 

dnf distro-sync ImageMagick ImageMagick-libs ImageMagick-perl


and paste the result if fails  


Thank you

Comment 5 Sergio 2022-07-12 16:17:53 UTC
root@localhost:dnf distro-sync ImageMagick ImageMagick-libs ImageMagick-perl
Updating Subscription Management repositories.
Last metadata expiration check: 0:39:51 ago on Tue 12 Jul 2022 05:36:15 PM CEST.
Dependencies resolved.
Nothing to do.
Complete!
root@localhost:perl -MImage::Magick -le 'print Image::Magick->QuantumDepth'
Can't load '/usr/local/lib64/perl5/auto/Image/Magick/Magick.so' for module Image::Magick: libMagickCore-6.Q16.so.6: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 194.
 at -e line 0.
Compilation failed in require.
BEGIN failed--compilation aborted.
&Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly.
END failed--call queue aborted.

Comment 6 Sergio Basto 2022-07-12 16:30:29 UTC
rm /usr/local/lib64/perl5/auto/Image/Magick/Magick.so 

rpm -ql ImageMagick-perl | grep so
/usr/lib64/perl5/vendor_perl/auto/Image/Magick/Q16/Q16.so


/usr without local !

Comment 7 Sergio 2022-07-12 16:34:47 UTC
root@localhost:rm /usr/local/lib64/perl5/auto/Image/Magick/Magick.so
root@localhost:rpm -ql ImageMagick-perl | grep so
/usr/lib64/perl5/vendor_perl/auto/Image/Magick/Q16/Q16.so
root@localhost:perl -MImage::Magick -le 'print Image::Magick->QuantumDepth'
Can't locate loadable object for module Image::Magick in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at -e line 0.
Compilation failed in require.
BEGIN failed--compilation aborted.
&Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly.
END failed--call queue aborted.

Comment 8 Sergio Basto 2022-07-12 16:39:36 UTC
rpm -ql ImageMagick-perl | grep /usr/lib64/perl5
/usr/lib64/perl5/vendor_perl/Image
/usr/lib64/perl5/vendor_perl/Image/Magick
/usr/lib64/perl5/vendor_perl/Image/Magick.pm
/usr/lib64/perl5/vendor_perl/Image/Magick/Q16.pm
/usr/lib64/perl5/vendor_perl/auto/Image
/usr/lib64/perl5/vendor_perl/auto/Image/Magick
/usr/lib64/perl5/vendor_perl/auto/Image/Magick/Q16
/usr/lib64/perl5/vendor_perl/auto/Image/Magick/Q16/Q16.so
/usr/lib64/perl5/vendor_perl/auto/Image/Magick/Q16/autosplit.ix

you need remove or uninstall Image/Magick on /usr/local 

rm -rf /usr/local/lib64/perl5/auto/Image/Magick /usr/lib64/perl5/vendor_perl/Image/Magick.pm /usr/lib64/perl5/vendor_perl/Image/Magick/Q16.pm

Comment 9 Sergio 2022-07-12 16:46:43 UTC
i just removed the files, still not working. The files listed with rmp | grep are not there. i.e.:
root@localhost:ls /usr/lib64/perl5/vendor_perl/Image/Magick.pm
ls: cannot access '/usr/lib64/perl5/vendor_perl/Image/Magick.pm': No such file or directory


what do i do now? reinstall the packages?

Comment 10 Stephen John Smoogen 2022-07-12 17:00:49 UTC
OK so looking at this ticket there seems to have been two versions of the Image Magick installed on the box somehow. One of them is from the RPMS and was in /usr/lib64/perl5 and the other was in /usr/local/lib tree. I think that in comment 8, Sergio MB meant for you to look in the /usr/local/lib tree and remove any of the Image/Magick.pm files. He accidently said to remove the /usr/lib64 ones instead. So to clean up:

1. Look in /usr/local/lib64/perl5/ and see what is installed there and try to figure out when it was and what might have done so. This is the root cause of the problems because these were built against a different set of libraries which aren't working on your system now.
2. Reinstall the ImageMagick packages. 
3. See if you had specific extra ImageMagick perl items installed in perl5 and rebuild them. If this was some other perl library it probably was done via cpan commands from root or a similar priviledged user.

Comment 11 Sergio Basto 2022-07-12 17:22:21 UTC
(In reply to Sergio from comment #9)
> i just removed the files, still not working. The files listed with rmp |
> grep are not there. i.e.:
> root@localhost:ls /usr/lib64/perl5/vendor_perl/Image/Magick.pm
> ls: cannot access '/usr/lib64/perl5/vendor_perl/Image/Magick.pm': No such
> file or directory
> 
> 
> what do i do now? reinstall the packages?

I got a typo in my rm !!!! 

you need remove only on /usr/local , rm -rf /usr/local/lib64/perl5/auto/Image/Magick /usr/local/lib64/perl5/vendor_perl/Image/Magick.pm /usr/local/lib64/perl5/vendor_perl/Image/Magick/Q16.pm

and yes,  dnf reinstall ImageMagick-perl

Comment 12 Sergio 2022-07-12 18:28:22 UTC
as you both said, the problem was that I have 2 versions of Image Magick installed on the same box. Checking out the history of root, I found "cpanm  IMAGE:Magick" just 2 hours after last "dnf upgrade" in 28th June. No idea why I did that...

I did remove the files you told me (in my case they were at perl5 instead of perl5/vendor_perl), reinstall the package and now it is working.

Sorry for the trouble and thank you for your help,

best wishes,

sergio


Note You need to log in before you can comment on or make changes to this bug.