Error 'Task' object has no attribute 'async_val' after ansible upgrade

Hi Everyone,
I am starting to see the following error since the ansible upgrade to 2.5:

The full traceback is:

Traceback (most recent call last):

File “/usr/local/lib/python2.7/site-packages/ansible/executor/task_executor.py”, line 130, in run

res = self._execute()

File “/usr/local/lib/python2.7/site-packages/ansible/executor/task_executor.py”, line 528, in _execute

result = self._handler.run(task_vars=variables)

File “/usr/local/lib/python2.7/site-packages/ansible/plugins/action/command.py”, line 23, in run

wrap_async = self._task.async_val and not self._connection.has_native_async

AttributeError: ‘Task’ object has no attribute ‘async_val’

fatal: [localhost]: FAILED! => {

“msg”: “Unexpected failure during module execution.”,

“stdout”: “”

}

I tried downgrading the Ansible 2.4.2.0 again but the error still persists. The same script was working fine before the upgrade.
Can anyone provide me any pointers on how to fix this?

Thanks,

Eshan

You seem to be mixing versions, in 2.5 we internally changed all
references to 'aysnc' to 'async_val' due to Python 3.7 compatibility
issues, but you should not get that error unless part of the code is
from a previous version.

I recommend you remove all versions of Ansible and check no stray
*.pyc/pyo files are left, install clean and it should all work.