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

Issue with dnf and python and ansible

  • 1.  Issue with dnf and python and ansible

    Posted Thu July 27, 2023 03:04 PM

    Hello

    I've a weird problem with dnf and ansible.

    Playbook :

    hosts: all
      gather_facts: false
      become_flags: -H -S
      become: true

      vars:
        ansible_python_interpreter: /opt/freeware/libexec/python3

      tasks:

        - name: install python3-dnf
          dnf:
            name: jq
            state: present
    I get that error : 
    fatal: [stha20090]: FAILED! => {"changed": false, "failures": ["No package jq available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
    If I execute the same with a command line on my server : 

    root@stha20090:/ # dnf install jq
    timer: config: 2 ms
    DNF version: 4.2.17
    Command: dnf install jq 
    Installroot: /
    Releasever: 7.2.5.203
    cachedir: /var/cache/dnf
    Base command: install
    Extra commands: ['install', 'jq']
    os-release file not found
    os-release: falling back to basic User-Agent: missing NAME or VERSION_ID
    repo: using cache for: AIX_Toolbox
    AIX_Toolbox: using metadata from Fri Jul 21 13:39:49 EDT 2023.
    repo: using cache for: AIX_Toolbox_noarch
    AIX_Toolbox_noarch: using metadata from Fri Jul 21 13:40:57 EDT 2023.
    repo: using cache for: AIX_Toolbox_72
    AIX_Toolbox_72: using metadata from Fri Jul 21 13:40:09 EDT 2023.
    Last metadata expiration check: 3:32:37 ago on Wed Jul 26 10:50:07 EDT 2023.
    No module defaults found
    timer: sack setup: 156 ms
    --> Starting dependency resolution
    ---> Package jq.ppc 1.6-1 will be installed
    ---> Package oniguruma.ppc 6.9.6-1 will be installed
    --> Finished dependency resolution
    timer: depsolve: 554 ms
    Dependencies resolved.
    ===========================================================================================================================================================================================================
     Package                                           Architecture                                Version                                           Repository                                           Size
    ===========================================================================================================================================================================================================
    Installing:
     jq                                                ppc                                         1.6-1                                             AIX_Toolbox                                         914 k
    Installing dependencies:
     oniguruma                                         ppc                                         6.9.6-1                                           AIX_Toolbox                                         763 k

    Transaction Summary
    ===========================================================================================================================================================================================================
    Install  2 Packages

    Total download size: 1.6 M
    Installed size: 4.6 M
    Is this ok [y/N]: 

    oslevel : 7200-05-06-2320
    RPM version :   rpm.rte                4.15.1.1010  COMMITTED  RPM Package Manager
    RPMs version : 
    root@stha20090:/ # rpm -qa | grep python
    python-deltarpm-3.6-1.ppc
    rpm-python3.9-4.15.1-32_2.ppc
    python3.9-3.9.16-2.ppc
    python3.9-six-1.13.0-2.noarch
    python3.9-librepo-1.11.0-102.ppc
    python3-libcomps-0.1.15-101.ppc
    python3-six-1.13.0-2.noarch
    python3.9-hawkey-0.39.1-32_52.ppc
    python3.9-dnf-4.2.17-32_51.ppc
    python3-libdnf-0.39.1-32_52.ppc
    rpm-python3-4.15.1-32_2.ppc
    python3-3.9.16-2.ppc
    python3.9-gpg-1.13.1-101.ppc
    python3.9-dateutil-2.8.0-2.noarch
    python3.9-libcomps-0.1.15-101.ppc
    python3-librepo-1.11.0-102.ppc
    python3-dateutil-2.8.0-2.noarch
    python3-gpg-1.13.1-101.ppc
    libxml2-python3-2.10.3-2.ppc
    python3.9-libdnf-0.39.1-32_52.ppc
    python3-dnf-4.2.17-32_51.ppc
    python3-hawkey-0.39.1-32_52.ppc
    root@stha20090:/ # rpm -qa | grep dnf
    libdnf-0.39.1-32_52.ppc
    python3.9-dnf-4.2.17-32_51.ppc
    dnf-automatic-4.2.17-32_51.ppc
    python3-libdnf-0.39.1-32_52.ppc
    python3.9-libdnf-0.39.1-32_52.ppc
    dnf-data-4.2.17-32_51.ppc
    python3-dnf-4.2.17-32_51.ppc
    dnf-4.2.17-32_51.ppc
    Do you any suggestion/advice ?
    Thanks you.


    ------------------------------
    Christophe Gehin
    ------------------------------


  • 2.  RE: Issue with dnf and python and ansible

    Posted Fri July 28, 2023 06:35 AM

    I have the exact same issue. I recently installed a new AIX 7.2 TL5 SP5 system, and got this error the first time I tried install Toolbox packages via Ansible. dnf install something works fine, the dnf or package module claims that the package doesn't exist. Since both use the same DNF Python libraries I can only assume that Ansible is somehow passing invalid data.

    I did try setting debug_solver=true in dnf.conf to see what libsolve was being asked to find, but it just makes Python crash with a memory fault.



    ------------------------------
    Peter Stanton
    ------------------------------



  • 3.  RE: Issue with dnf and python and ansible

    Posted Fri July 28, 2023 08:38 AM

    Hello Peter.

    thanks you for confirming me I'm not crazy

    I made some tests with 2 ansible controllers, one with python3.9, the other one with python3.11.

    Both are redhat 8 servers.

    Results : same problem.

    If you run dnf --debugsolver install something, I get a Memory Fault(coredump) too.

    So I think we have 2 problems : debugsolver and dnf from ansible.

    Could someone from IBM have a look one the first problem ? coredump where debugsolver is enable.

    It could help solving the second one.

    Thanks



    ------------------------------
    Christophe Gehin
    ------------------------------



  • 4.  RE: Issue with dnf and python and ansible

    Posted Fri July 28, 2023 09:02 AM

    Thanks for reporting the issues. We are looking into it. 



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



  • 5.  RE: Issue with dnf and python and ansible

    Posted Mon August 21, 2023 01:38 PM

    Hello

    Do you have some news about that problem ?

    Regards



    ------------------------------
    Christophe Gehin
    ------------------------------



  • 6.  RE: Issue with dnf and python and ansible

    Posted Tue August 22, 2023 07:35 AM

    The "--debugsolver" issue is fixed in the recent libsolv rpm. 
    As far as the other main issue is concerned, I think the dnf plugin is somehow tied with the controller's arch or something. So it's not listing the packages for AIX. 



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



  • 7.  RE: Issue with dnf and python and ansible

    Posted Tue August 22, 2023 10:15 AM
    Edited by Christophe Gehin Tue August 22, 2023 10:30 AM

    Hello

    I've updated libsolv and no more "Memory fault". 

    I'm still unable to install a package but I've been able to execute a dnf update by using ansible : 

        - name: dnf update
          dnf:
            name: "*"
            state: latest
    =>
    # dnf history info 12
    timer: config: 2 ms
    DNF version: 4.2.17
    Command: dnf history info 12 
    Installroot: /
    Releasever: 7.2.5.203
    cachedir: /var/cache/dnf
    Base command: history
    Extra commands: ['history', 'info', '12']
    os-release file not found
    os-release: falling back to basic User-Agent: missing NAME or VERSION_ID
    No module defaults found
    timer: sack setup: 60 ms
    Transaction ID : 12
    Begin time     : Tue Aug 22 10:01:12 EDT 2023
    Begin rpmdb    : 136:6718fd917d9efa4f9f679e113e11a5de29d503f1
    End time       : Tue Aug 22 10:01:25 EDT 2023 (13 seconds)
    End rpmdb      : 136:46d6d6b85e248e759deacc7856eaecde0725d6d9
    User           :  <root>
    Return-Code    : Success
    Releasever     : 7.2.5.203
    Command Line   : 
    Packages Altered:
        Upgrade  curl-8.1.2-1.ppc              @AIX_Toolbox
        Upgraded curl-8.0.1-1.ppc              @@System
        Upgrade  glib2-2.72.1-2.ppc            @AIX_Toolbox
        Upgraded glib2-2.72.1-1.ppc            @@System
        Upgrade  libksba-1.6.3-1.ppc           @AIX_Toolbox
        Upgraded libksba-1.6.2-1.ppc           @@System
        Upgrade  libtasn1-4.19.0-1.ppc         @AIX_Toolbox
        Upgraded libtasn1-4.16.0-1.ppc         @@System
        Upgrade  ncurses-6.4-1.ppc             @AIX_Toolbox
        Upgraded ncurses-6.3-1.ppc             @@System
        Upgrade  popt-1.19-1.ppc               @AIX_Toolbox
        Upgraded popt-1.18-1.ppc               @@System
        Upgrade  vim-common-9.0.1649-1.ppc     @AIX_Toolbox
        Upgraded vim-common-9.0.1237-1.ppc     @@System
        Upgrade  vim-enhanced-9.0.1649-1.ppc   @AIX_Toolbox
        Upgraded vim-enhanced-9.0.1237-1.ppc   @@System
        Upgrade  xz-5.4.3-1.ppc                @AIX_Toolbox
        Upgraded xz-5.2.5-1.ppc                @@System
        Upgrade  xz-libs-5.4.3-1.ppc           @AIX_Toolbox
        Upgraded xz-libs-5.2.5-1.ppc           @@System
        Upgrade  libsolv-0.7.9-32_53.ppc       @AIX_Toolbox_72
        Upgraded libsolv-0.7.9-32_52.ppc       @@System
        Upgrade  libsolv-tools-0.7.9-32_53.ppc @AIX_Toolbox_72
        Upgraded libsolv-tools-0.7.9-32_52.ppc @@System
    ...
    ...
    12 packages have been updated on my aix sandbox.
    What do you think about that ?
    Regards



    ------------------------------
    Christophe Gehin
    ------------------------------



  • 8.  RE: Issue with dnf and python and ansible

    Posted Tue August 29, 2023 07:43 AM

    Hello

    Could someone from IBM check my latest post please ?

    Regards



    ------------------------------
    Christophe Gehin
    ------------------------------



  • 9.  RE: Issue with dnf and python and ansible

    Posted Tue August 29, 2023 09:27 AM

    We are looking into it. 



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



  • 10.  RE: Issue with dnf and python and ansible

    Posted Thu September 21, 2023 03:23 PM

    Hello

    Do you have some news about my post ?

    Thanks



    ------------------------------
    Christophe Gehin
    ------------------------------



  • 11.  RE: Issue with dnf and python and ansible

    Posted Fri September 22, 2023 04:11 AM

    It's definitely a problem with ansible dnf builtin. Can you raise a issue in the below community link ? 

    https://github.com/ansible/ansible/issues



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



  • 12.  RE: Issue with dnf and python and ansible

    Posted Wed December 06, 2023 08:37 AM
    Edited by Stephan Dietl Wed December 06, 2023 08:38 AM

    Hello @Ayappan P and @Christophe Gehin !

    I´ve raised https://github.com/ansible/ansible/issues/82365 on this!


    HTH,

    Ciao,

    Steve



    ------------------------------
    Stephan Dietl
    ------------------------------



  • 13.  RE: Issue with dnf and python and ansible

    Posted Wed December 06, 2023 10:06 AM

    Hello!

    Has already been solved by additionally adding "PATH" environment variable into the task:

    https://github.com/ansible/ansible/issues/82365#issuecomment-1842926126

    HTH,

    Ciao,

    Steve



    ------------------------------
    Stephan Dietl
    ------------------------------