AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
  • 1.  Lost perl XML library ?

    Posted Fri November 27, 2020 05:09 AM
    Edited by christophe derouet Fri November 27, 2020 05:10 AM
    Hello,

    We are working on an AIX 7.1 LPAR.

    Suddenly we had troubles with an    XML   script.
    It is not a new installation of perl.

    I had a look on google and it seems that we are missing     perl XML libraries.

    We are using    perl    available threw the   AIX fileset    perl.rte.
    We do not have any   perl rpm package.   

    What you would suggest to me ?   I have heard about   pearl-cleaner ? What is it ?
    How can i check that our    perl XML libraries  are fully available  ?

    I  thank you very much for your help,


    admmi007:/opt/controlm/ctmagp1/ctm/sysout# grep -i perl DORAJ_XSU513_L01.LOG_057s5h_00001
    commande : /usr/bin/perl /usr/local/Commvault/launch_job_CV.pl csm-prd csm-prd admmi007 xsu513_AL . /oraarch/xsu513/,/oraarch/save/xsu513 2 FULL
    Can't locate object method "new" via package "XML::LibXML::SAX" at /usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX/ParserFactory.pm line 43.
    admmi007:/opt/controlm/ctmagp1/ctm/sysout#



    ############################################################################################
    And we can see that the AIX fileset that owns /usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX is :

    admmi007:/usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX#
    admmi007:/usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX# lslpp -w /usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX
    File Fileset Type
    ----------------------------------------------------------------------------
    /usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX
    perl.rte Directory
    admmi007:/usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX#

    ############################################################################################
    admmi007:/opt/controlm/ctmagr1# perl -v

    This is perl, v5.10.1 (*) built for aix-thread-multi

    Copyright 1987-2009, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl". If you have access to the
    Internet, point your browser at http://www.perl.org/, the Perl Home Page.

    admmi007:/opt/controlm/ctmagr1#

    ------------------------------
    christophe derouet
    ------------------------------


  • 2.  RE: Lost perl XML library ?

    Posted Fri November 27, 2020 10:17 AM
    Today we don't have no perl package installed on our AIX 7.1 LPAR.

    But do you know if    perl   needs  some other open source rpm   packages  to work ?

    Or do we only need the AIX   perl.rte    fileset ?

    Today here is the list of our installed rpm packages.

    admmi007:/usr/opt/perl5/lib/site_perl# rpm -qa
    tcl-8.4.7-3
    tk-8.4.7-3
    expect-5.42.1-3
    lpar2rrd-agent-6.11-4
    AIX-rpm-7.1.3.45-3
    admmi007:/usr/opt/perl5/lib/site_perl#

    ------------------------------
    christophe derouet
    ------------------------------



  • 3.  RE: Lost perl XML library ?

    Posted Mon November 30, 2020 12:57 AM
    No extra package is required to use perl.rte XML::SAX module.
    Please check if the script is compatible with perl-5.10.1 and also check if the file /usr/opt/perl5/lib/site_perl/5.10.1/XML/SAX/ParserFactory.pm has not been modified.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 4.  RE: Lost perl XML library ?

    Posted Wed December 02, 2020 03:36 PM

    Following up on our findings during case analysis.
    The following resulted in some libxml files.

    ls -R /opt/freeware | grep -i libxml | while read file;do find /opt/freeware -name $file;done

    /opt/freeware/doc/libxml2-2.9.9

    /opt/freeware/lib/libxml2.a

    /opt/freeware/lib/libxml2.so.2

    /opt/freeware/lib64/libxml2.so.2

    /opt/freeware/lib/libxml2.so.2

    /opt/freeware/lib64/libxml2.so.2


    If you had issues when you updated, you probably removed packages that were converted to 4.13 but when you went back down, you may not have actually removed the *files*, just the data about the packages. These are not provided by rpm.rte, so we needed to get those out of the path.

    1) First, try to unset LIBPATH (although I think the perl will still go down /opt/freeware/lib anyway...)

    unset LIBPATH;perl -e 'use XML::Simple; use Data::Dumper; $XML::Simple::PREFERRED_PARSER = XML::LibXML::SAX ; $xml = q{<?xml version="1.0" encoding="ISO-8859-1"?><opt><action>actiontest</action><params><foo>bar</foo></params></opt>}; print Dumper(XMLin($xml, keyattr => [], suppressempty => undef));'



    RESULT:  This worked!

    2) If #1 still fails, let's move the most suspicious files

    Based on your earlier rpm -qa output I don't expect this to return any owning packages, but let's check to be sure.

    rpm -qf /opt/freeware/lib/libxml2.a rpm -qf /opt/freeware/lib/libxml2.so.2 rpm -qf /opt/freeware/lib64/libxml2.so.2

    Next, move these out of the way:

    mv /opt/freeware/lib/libxml2.a /opt/freeware/lib/libxml2.a.save mv /opt/freeware/lib/libxml2.so.2 /opt/freeware/lib/libxml2.so.2.save mv /opt/freeware/lib64/libxml2.so.2 /opt/freeware/lib64/libxml2.so.2.save



    3) Try again

    perl -e 'use XML::Simple; use Data::Dumper; $XML::Simple::PREFERRED_PARSER = XML::LibXML::SAX ; $xml = q{<?xml version="1.0" encoding="ISO-8859-1"?><opt><action>actiontest</action><params><foo>bar</foo></params></opt>}; print Dumper(XMLin($xml, keyattr => [], suppressempty => undef));'


    RESULT:  This worked!

    Waiting to find out if you can still use /opt/freeware/lib in LIBPATH now that these files are moved.

    As for other errors, and these un-owned files in general, I suspect you have several files in place that do not have any owning packages. Considering the migration issues, I would consider doing a complete RPM cleanup on your system. There is a way to remove all packages so you can start from scratch. 



    ------------------------------
    Jan Harris
    ------------------------------



  • 5.  RE: Lost perl XML library ?

    Posted Fri December 04, 2020 03:54 AM
    Hello Jan,

    I would like to thank you very very much for your help.
    The problem is solved now.
    And it is not a miracle !
    Thanks to you, thanks to your patience and thanks to your perseverance !


    I do not know if we are ready to do a complete RPM cleanup on our system !
    But i understand that we have to make sure that our   open source environment   is as clean as possible.

    Can you give us some details about the   RPM cleanup   ?
    I will talk with my colleagues about this operation.

    Have a nice day,





    ------------------------------
    christophe derouet
    ------------------------------