Ansible plays fail with "No module named 'psutil'"

When running any Ansible play, I get the following:

1: Enter passphrase for /tmp/d20230518-10651-1k779ry/artifacts/2de0b591-38ad-424f-9e5b-5e5ff4487f56/ssh_key_data:
2: Identity added: /tmp/d20230518-10651-1k779ry/artifacts/2de0b591-38ad-424f-9e5b-5e5ff4487f56/ssh_key_data (
3: ERROR! Unexpected Exception, this is probably a bug: No module named ‘psutil’
4: to see the full traceback, use -vvv
5: Exit status: 250

Expected outcome:
Ansible plays run successfully.

Foreman and Proxy versions:
Foreman 3.4.1
Katello 4.6.2

Foreman and Proxy plugin versions:
Ansible plugin version 9.0.1

Distribution and version:
RHEL 8.8

Other relevant data:
It happens on any host I try, so the issue seems to be on the Foreman server, not the remote hosts. It happens if I try to run a play as a scheduled task. And I get this same error if I go to a host, click the insights tab, then attempt to remediate an issue with Ansible. So pretty much any way I try to kick-off a task with Ansible.

If someone could point me in the right direction, suggest some troubleshooting steps, or request specific logs, I’d really appreciate it.

Thank you for your time


For 8.8 we moved from pstuil to ansible-runner 2, looks like it was not picked into 3.4 and I’m not sure if it will be picked there, maybe @evgeni knows if it’s possible .

Given that Foreman 3.4 is EOL, I don’t think we’re planning on fixing this issue there, no.

You can however downgrade your ansible-core to the version from 8.7, and it should work again.
Or you could upgrade your Foreman to a supported release :wink:

(You can probably also upgrade “just” ansible-runner from the 3.5 plugins repo, but nobody tested this so let’s call it unsupported)

After upgrading to 3.5.3, the issue is resolved. I really appreciate the quick responses!

(And sorry about asking for help with an out-of-support version. :roll_eyes: )

Great that you got it solved!

And no worries about asking about EoL versions, we’ll still try to help, just the help sometimes will be “yeah, please upgrade” :wink:

1 Like