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
Expand all | Collapse all

DNF Issue

  • 1.  DNF Issue

    Posted Thu November 23, 2023 05:09 PM

    Hi Ayappan,

    I got following error when trying to launch DNF. It was fine after Python 3.9 upgrade. The file /opt/freeware/lib64/python3.9/site-packages/libcomps/_libpycomps.so was there. Should I reinstall libcomps? But giving the situation dnf itself doesn't work, how can I reinstall it?

    Thanks

    Mi

    root: dnf
    Traceback (most recent call last):
      File "/opt/freeware/bin/dnf", line 57, in <module>
        from dnf.cli import main
      File "/opt/freeware/lib/python3.9/site-packages/dnf/__init__.py", line 32, in <module>
        import dnf.base
      File "/opt/freeware/lib/python3.9/site-packages/dnf/base.py", line 31, in <module>
        from dnf.comps import CompsQuery
      File "/opt/freeware/lib/python3.9/site-packages/dnf/comps.py", line 36, in <module>
        import libcomps
      File "/opt/freeware/lib64/python3.9/site-packages/libcomps/__init__.py", line 1, in <module>
        from ._libpycomps import *
    ImportError: Could not load module /opt/freeware/lib64/python3.9/site-packages/libcomps/_libpycomps.so.
    System error: Exec format error



    ------------------------------
    Mi Wang
    ------------------------------


  • 2.  RE: DNF Issue

    Posted Fri November 24, 2023 01:40 AM

    Generally "System error: Exec format error" comes when a 32bit application is trying to load a 64bit shared lib or the vice versa. There looks to be some mix up of 32bit & 64bit here which is causing the issue. 
    What is the AIX level here? 7.3 or 7.2/7.1 ? 
    In AIX 7.3, the whole dnf ecosystem is 64bit based as rpm itself( coming from rpm.rte) is 64bit. In AIX 7.1/7.2, it is 32bit as rpm itself is 32bit. 



    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: DNF Issue

    Posted Fri November 24, 2023 06:09 AM

    Hi Ayappan and Mi Wang,

    same issue here:

    root@sap1nim:/opt/freeware/packages: dnf list installed
    Traceback (most recent call last):
      File "/opt/freeware/bin/dnf", line 58, in <module>
        from dnf.cli import main
      File "/opt/freeware/lib/python3.9/site-packages/dnf/__init__.py", line 30, in <module>
        import dnf.base
      File "/opt/freeware/lib/python3.9/site-packages/dnf/base.py", line 29, in <module>
        import libdnf.transaction
      File "/opt/freeware/lib64/python3.9/site-packages/libdnf/__init__.py", line 3, in <module>
        from . import common_types
      File "/opt/freeware/lib64/python3.9/site-packages/libdnf/common_types.py", line 13, in <module>
        from . import _common_types
    ImportError: Symbol resolution failed for /opt/freeware/lib64/libkrb5support.so because:
            Symbol _GLOBAL__AIXI_libintl_so (number 57) is not exported from dependent
              module /usr/opt/rpm/lib/libintl.a[libintl.so.8].
            Symbol _GLOBAL__AIXD_libintl_so (number 58) is not exported from dependent
              module /usr/opt/rpm/lib/libintl.a[libintl.so.8].
    Could not load module /opt/freeware/lib64/python3.9/site-packages/libdnf/_common_types.so.
    System error: Exec format error
    Examine .loader section symbols with the 'dump -Tv' command.
    root@sap1nim:/opt/freeware/packages:


    I checked the libint wether its 32 or 64bit:

    /opt/freeware/packages: dump -ov /usr/opt/rpm/lib/libintl.a | grep -i agic
    Magic = 0x1df  (32-bit XCOFF)
    maxSTACK    maxDATA     SNbss       magic       modtype
    Magic = 0x1df  (32-bit XCOFF)
    maxSTACK    maxDATA     SNbss       magic       modtype

    so we have a 32-bit libintl.a - probably explains failing ImportError: Symbol resolution failed for /opt/freeware/lib64/libkrb5support.so

    Now try to find out where libintl.a comes from:

    root@sap1nim:/opt/freeware/packages: lslpp -w /usr/opt/rpm/lib/libintl.a
      File                                        Fileset               Type
      ----------------------------------------------------------------------------
      /usr/opt/rpm/lib/libintl.a                  rpm.rte               File

    seems I need a 64-bit rpm - any suggestions how to deal with that?

    Regards Stefan



    ------------------------------
    Stefan Lehmann
    ------------------------------



  • 4.  RE: DNF Issue

    Posted Fri November 24, 2023 09:22 AM

    Hi Stefan,

    libintl.a ship both 32 & 64-bit libintl.so.8 and rpm is 64-bit by default 

    # file /usr/opt/rpm/bin/rpm
    /usr/opt/rpm/bin/rpm: 64-bit XCOFF executable or object module not stripped

    # ar -X32_64 -tv /usr/opt/rpm/lib/libintl.a
    rwxr-xr-x     0/0      93228 Jun 19 12:55 2023 libintl.so.8
    rwxr-xr-x     0/0     101713 Jun 19 13:02 2023 libintl.so.8
    rw-r-----     0/0     114582 Jun 19 13:02 2023 libintl.so.1
    rw-r-----     0/0     130986 Jun 19 13:02 2023 libintl.so.1

    Do you have any LIBPATH set still ?



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



  • 5.  RE: DNF Issue

    Posted Mon November 27, 2023 09:27 AM

    Hi SANGAMESH / Ayappan,

    We have AIX 7.2 installed. But even I set LIBPATH to have only one folder /opt/freeware/lib, running dnf still gave the same error (it tried to access the library under /opt/freeware/lib64). Some setup issue?

    Thanks

    Mi

    $: export LIBPATH=/opt/freeware/lib
    $: dnf
    Traceback (most recent call last):
      File "/opt/freeware/bin/dnf", line 57, in <module>
        from dnf.cli import main
      File "/opt/freeware/lib/python3.9/site-packages/dnf/__init__.py", line 32, in <module>
        import dnf.base
      File "/opt/freeware/lib/python3.9/site-packages/dnf/base.py", line 31, in <module>
        from dnf.comps import CompsQuery
      File "/opt/freeware/lib/python3.9/site-packages/dnf/comps.py", line 36, in <module>
        import libcomps
      File "/opt/freeware/lib64/python3.9/site-packages/libcomps/__init__.py", line 1, in <module>
        from ._libpycomps import *
    ImportError: Could not load module /opt/freeware/lib64/python3.9/site-packages/libcomps/_libpycomps.so.
    System error: Exec format error



    ------------------------------
    Mi Wang
    ------------------------------



  • 6.  RE: DNF Issue

    Posted Tue November 28, 2023 04:55 AM

    AIX 7.2 dnf should be invoking 32bit python3. Can you verify that ? 
    what is the output of "head -1 $(which dnf)" ?



    ------------------------------
    Ayappan P
    ------------------------------



  • 7.  RE: DNF Issue

    Posted Tue November 28, 2023 02:49 PM

    Hi Ayappan,

    Please find the command run result:

    $ head -1 $(which dnf)
    #!/opt/freeware/libexec/python3.9_32

    Thanks

    Mi



    ------------------------------
    Mi Wang
    ------------------------------



  • 8.  RE: DNF Issue

    Posted Wed November 29, 2023 03:43 PM

    Hello Ayappan,

    Can you please provide steps to fix this? By the way, this is FYI - we have this issue only with our DEV servers which have Python 3.9.17. Meantime, our PAT servers have the exact same Python installation (just different version: Python 3.9.18) and they don't have this type issue.

    Thanks

    Mi  



    ------------------------------
    Mi Wang
    ------------------------------



  • 9.  RE: DNF Issue

    Posted Thu November 30, 2023 01:29 AM

    /opt/freeware/libexec/python3.9_32 is a 32bit python which will not search in /opt/freeware/lib64/python3.9/site-packages. Can you verify that it is indeed 32bit binary ?

    # file /opt/freeware/libexec/python3.9_32
    /opt/freeware/libexec/python3.9_32: executable (RISC System/6000 V3.1) or obj module not stripped



    ------------------------------
    Ayappan P
    ------------------------------



  • 10.  RE: DNF Issue

    Posted Thu November 30, 2023 11:43 AM

    Hi Ayappan,

    Please find the command output:
    $ file /opt/freeware/libexec/python3.9_32
    /opt/freeware/libexec/python3.9_32: executable (RISC System/6000) or object module not stripped

    Thanks

    Mi



    ------------------------------
    Mi Wang
    ------------------------------



  • 11.  RE: DNF Issue

    Posted Fri December 01, 2023 03:03 AM

    I don't see any reason why 32bit python is trying to load the 64bit libcomps module. Do you have PYTHONPATH set ? If so, unset it and try again 



    ------------------------------
    Ayappan P
    ------------------------------