AIX

 View Only

 DNF broken after "dnf update", ansible broken after complete new installation of "dnf" and "ansible"

Thomas Bettray's profile image
Thomas Bettray posted Thu November 20, 2025 08:39 AM

Hi all,

in the last couple of days, we experienced issues with the AIX Toolbox on several different AIX 7.3 systems. Some of them are at 7300-03-01, others at 7300-02-03.

All of them are pretty different and affect different customers of ours, but all of them have similar symptoms and issues with DNF. 

In the test environment of my company, we experienced this issue on a NIM server. It has never seen any other RPM package apart from those from the AIX toolbox. We keep this server quite up to date in terms of AIX, fixes and RPM packages. 

A couple of days ago, I did a "dnf update", and it messed up DNF itself completely, leaving the whole DNF completely unusable with broken python dependencies. As I did not find any other solution, I decided to do a complete reinstall of all RPM packages; so I purged every single RPM package, removed /opt/freeware/libs, reinstalled the rpm.rte LPP-package, reinstalled DNF and reinstalled all the packages that were installed before. One of those packages was ansible. While DNF was working (a bit, at least, see below), Ansible is not:

ansibleadm@nimserver:/ansible $ ansible-playbook -v update_all_systems.yml
Using /etc/ansible/ansible.cfg as config file
[ERROR]: Unexpected Exception, this is probably a bug: function() argument 'code' must be code, not str

Traceback (most recent call last):
  File "/opt/freeware/lib/python3.12/site-packages/ansible/cli/__init__.py", line 660, in cli_executor
    exit_code = cli.run()
                ^^^^^^^^^
  File "/opt/freeware/lib/python3.12/site-packages/ansible/cli/playbook.py", line 153, in run
    results = pbex.run()
              ^^^^^^^^^^
  File "/opt/freeware/lib/python3.12/site-packages/ansible/executor/playbook_executor.py", line 117, in run
    self._tqm.load_callbacks()
  File "/opt/freeware/lib/python3.12/site-packages/ansible/executor/task_queue_manager.py", line 206, in load_callbacks
    stdout_callback = callback_loader.get(self._stdout_callback_name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/freeware/lib/python3.12/site-packages/ansible/plugins/loader.py", line 979, in get
    ctx = self.get_with_context(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/freeware/lib/python3.12/site-packages/ansible/plugins/loader.py", line 1024, in get_with_context
    self._module_cache[path] = self._load_module_source(python_module_name=plugin_load_context._python_module_name, path=path)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/freeware/lib/python3.12/site-packages/ansible/plugins/loader.py", line 943, in _load_module_source
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 999, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/ansible/.ansible/collections/ansible_collections/community/general/plugins/callback/yaml.py", line 46, in <module>
    class MyDumper(AnsibleDumper):
TypeError: function() argument 'code' must be code, not str

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/freeware/lib/python3.12/site-packages/ansible/cli/__init__.py", line 669, in cli_executor
    raise AnsibleError("Unexpected Exception, this is probably a bug.") from ex
ansible.errors.AnsibleError: Unexpected Exception, this is probably a bug: function() argument 'code' must be code, not str

When trying to do another update via DNF, I get this:

# dnf update
Last metadata expiration check: 6:24:11 ago on November 20, 2025, 08:08:49 AM CET.
Error:
 Problem: package python3.9-3.9.24-1.ppc from ppc requires /opt/freeware/libexec/python3.9_32, but none of the providers can be installed
  - cannot install both python3.9-3.9.24-1.ppc from ppc and python3.9-3.9.16-0.ppc from @System
  - cannot install the best update candidate for package python3.9-3.9.16-0.ppc
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

This has been at least the 4th time on this server within the last 2 years that I have to completely reinstall DNF and all packages (and with it, all configurations). And all I need to do to mess up DNF is "dnf update". 

As mentioned earlier, we experienced similar situations at customers like a dozen times in the last two years, and 2 more occurances of this within the last 3 days. 

What is going on here? How can we make the AIX Toolbox work reliably? What is your update strategy to prevent things like this? Is the RPM repository for AIX Toolbox really inconsistent? If so, does it really happen approx. twice a year?

If any more information is needed, please let me know. 

Best regards,

Thomas

Jan Maly's profile image
Jan Maly

Hi Thomas,

I often encounter similar problems with our customers. From my experience, the only best practice in this is to do dnf update often enough - maybe once a month (due to inconsistencies in DNF repositories).

In your situation, I would suggest:
add: /opt/freeware/bin to the $PATH
run: /usr/sbin/updtvpkg,

then run:
dnf update

Then, please send output of dnf update.

Thanks.

Anas AlSaleh's profile image
Anas AlSaleh

Hi ,

DNF is trying to update:

  • python3.9-3.9.24-1.ppc (new version)

But your system already has:

  • python3.9-3.9.16-0.ppc (old version)

And both packages claim the path:

/opt/freeware/libexec/python3.9_32 

Check what python3.9 packages are installed , If you see multiple versions ( 3.9.16 and 3.9.24), that’s maybe the root cause

Lakshmi Surekha Kovvuri's profile image
Lakshmi Surekha Kovvuri

Hi Thomas,

Could you please confirm if the error you are facing during "dnf update" is exactly the one you pasted above?
Also, to help troubleshoot further, could you please share the output of the following commands:

1. rpm -qa

2. cat /opt/freeware/etc/dnf/dnf.conf

Thomas Bettray's profile image
Thomas Bettray

@ All: Thanks for your support and sorry for my late reply, it is a busy time of the year.

@Jan Maly: I did that, but that did not solve the issue. The output above is already the one after running "/usr/sbin/updtvpkg".

@Anas AlSaleh: Yes, I guess that this is exactly the core issue here, but how can this situation even exist, if we just installed DNF and updated on a quite frequent basis of at least once a month? We never installed an additional Python version, only the one with AIX 7.3 operating system (LPP package) and the one that is installed through RPM when DNF is installed. This is a very common setup that we have, nothing specific; just a pure AIX 7.3 with IBM-only packages and a clean DNF installation (+ ansible, httpd, createrepo, rsync, sudo) purely from the AIX toolbox that got updated quite frequently. From my point of view, this is not supposed to happen.

@Lakshmi Surekha Kovvuri: Yes, I can confirm that. As mentioned, I "resolved" / worked around that issue by completely reinstalling each and every single RPM package. This caused everything to run as expected. The dnf.conf - as far as I am aware - is the vanilla version as provided with the package dnf-data*.rpm.


Best regards,

Thomas

Thomas Bettray's profile image
Thomas Bettray

p.s.: I tried to paste the contents of the dnf.conf file, but the website keeps telling me that I am not permitted to access a specific site. When I omitted the dnf.conf, the access was obviously allowed...?

Thomas Bettray's profile image
Thomas Bettray

Good morning all,

today, I tested our installation procedures with the latest AIX 7.2 service pack, 7200-05-11-2546. 

During our postinstall-Script, DNF is installed. Then, ansible, httpd, sshpass, dnf-util and createrepo were installed (including all of their dependencies). 

If I then run a "dnf update", things are already broken again:

root@wi6-nim:/opt/freeware/lib# dnf update
Last metadata expiration check: 1:52:17 ago on Mon Dec  8 09:56:50 CET 2025.
Error:
 Problem 1: cannot install both python3.12-3.12.12-1.ppc from ppc and python3.12-3.12.11-0.ppc from @System
  - package dnf-4.23.0-32_51.ppc from ppc-7.2 requires /opt/freeware/libexec/python3.12_32, but none of the providers can be installed
  - cannot install the best update candidate for package python3.12-3.12.11-0.ppc
  - cannot install the best update candidate for package dnf-4.23.0-32_2.noarch
 Problem 2: cannot install both python3.12-3.12.12-1.ppc from ppc and python3.12-3.12.11-0.ppc from @System
  - package python3-3.12.12-1.ppc from ppc requires python3.12 = 3.12.12, but none of the providers can be installed
  - package dnf-automatic-4.23.0-32_51.ppc from ppc-7.2 requires /opt/freeware/libexec/python3.12_32, but none of the providers can be installed
  - cannot install the best update candidate for package python3-3.12.11-0.ppc
  - cannot install the best update candidate for package dnf-automatic-4.23.0-32_2.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Something is really messed up inside the repositories, but I cannot spot the exact root cause. 

Does someone else experience thison a freshly installed AIX system? 

Thomas

Thomas Bettray's profile image
Thomas Bettray

And another update from my tests: For reasons I do not quite understand, this all seems to be related to the line "optional_metadata_types=filelists", that at some point in time became the new default setting in dnf.conf. However, we roll out an own version of that file that does _not_ include that setting, and that obviously breaks things. 

So I was able to fix and reproduce this behaviour by doing this:

  • clean up dnf cache ("dnf clean all")
  • remove this option from dnf.conf
  • run "dnf update" => does not work.
  • clean up dnf cache ("dnf clean all")
  • add this option to /opt/freeware/etc/dnf/dnf.conf
  • run "dnf update" => this works

I can repeat this many times and the behaviour is always the same: without this option, the update breaks, with this option, the update succeeds. 

root@wi6-nim:/opt/freeware.old/etc/dnf# dnf update
AIX generic repository                                                                                                                                                                                       146 kB/s | 984 kB     00:06
AIX noarch repository                                                                                                                                                                                        115 kB/s | 199 kB     00:01
AIX 7.2 specific repository                                                                                                                                                                                  104 kB/s | 144 kB     00:01
Error:
 Problem 1: cannot install both python3.12-3.12.12-1.ppc from ppc and python3.12-3.12.11-0.ppc from @System
  - package dnf-4.23.0-32_51.ppc from ppc-7.2 requires /opt/freeware/libexec/python3.12_32, but none of the providers can be installed
  - cannot install the best update candidate for package python3.12-3.12.11-0.ppc
  - cannot install the best update candidate for package dnf-4.23.0-32_2.noarch
 Problem 2: cannot install both python3.12-3.12.12-1.ppc from ppc and python3.12-3.12.11-0.ppc from @System
  - package python3-3.12.12-1.ppc from ppc requires python3.12 = 3.12.12, but none of the providers can be installed
  - package dnf-automatic-4.23.0-32_51.ppc from ppc-7.2 requires /opt/freeware/libexec/python3.12_32, but none of the providers can be installed
  - cannot install the best update candidate for package python3-3.12.11-0.ppc
  - cannot install the best update candidate for package dnf-automatic-4.23.0-32_2.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
root@wi6-nim:/opt/freeware.old/etc/dnf# cp /opt/freeware/etc/dnf/dnf.conf /opt/freeware/etc/dnf/dnf.conf.old
root@wi6-nim:/opt/freeware.old/etc/dnf# vi /opt/freeware/etc/dnf/dnf.conf
root@wi6-nim:/opt/freeware.old/etc/dnf# diff /opt/freeware/etc/dnf/dnf.conf /opt/freeware/etc/dnf/dnf.conf.old
13c13
< optional_metadata_types=filelists
---
> #optional_metadata_types=filelists
root@wi6-nim:/opt/freeware.old/etc/dnf# dnf clean all
9 files removed
root@wi6-nim:/opt/freeware.old/etc/dnf# dnf update
AIX generic repository                                                                                                                                                                                       1.6 MB/s | 9.4 MB     00:05
AIX noarch repository                                                                                                                                                                                        1.1 MB/s | 4.2 MB     00:03
AIX 7.2 specific repository                                                                                                                                                                                  739 kB/s | 1.5 MB     00:02
Last metadata expiration check: 0:00:01 ago on Mon Dec  8 13:19:53 CET 2025.
Dependencies resolved.
=============================================================================================================================================================================================================================================
 Package                                                           Architecture                                      Version                                                     Repository                                             Size
=============================================================================================================================================================================================================================================
Upgrading:
 dnf                                                               ppc                                               4.23.0-32_51                                                ppc-7.2                                                15 k
 dnf-automatic                                                     ppc                                               4.23.0-32_51                                                ppc-7.2                                                14 k
 dnf-data                                                          ppc                                               4.23.0-32_51                                                ppc-7.2                                                28 k
 gnupg2                                                            ppc                                               2.4.8-1                                                     ppc                                                    11 M
 libcomps                                                          ppc                                               0.1.22-100                                                  ppc                                                   374 k
 libdnf                                                            ppc                                               0.74.0-32_52                                                ppc-7.2                                               2.8 M

[...]

Can someone confirm that this issue exists in other environments as well?

Does someone have an explanation for this behaviour? 

Thomas

Ayappan P's profile image
Ayappan P

dnf introduced a change (in version 4.19.0)  to not to load the filelists metadata by default. 
https://dnf.readthedocs.io/en/latest/release_notes.html#id11 
So we need to have this setting "optional_metadata_types=filelists" now in dnf.conf for dependencies to get resolved. 

djj d's profile image
djj d

This error is almost always a Python 3.12 compatibility issue with Ansible—AIX Toolbox’s Ansible build likely isn’t fully patched for 3.12’s  code  argument changes. Try downgrading Python to 3.11 (via AIX Toolbox RPMs) and reinstall Ansible; that should fix the  function() argument 'code' must be code, not str  traceback.