ansible/awx
View on GitHubsourced script inventory failure, no retry or useful info
Open
#5942 opened on Feb 14, 2020
component:apihelp wantedtype:bug
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
- API
- UI
SUMMARY
Update inventory fails for sourced script, without retry and without an useful message.
ENVIRONMENT
- AWX version: 9.1.1
- AWX install method: docker on linux
- Ansible version: 2.8.5
STEPS TO REPRODUCE
- Add a job template with an inventory source that uses a script sourced from a project with the box "Update on launch" ticked
- Run the job template
EXPECTED RESULTS
The inventory should be updated, if not the update should retry for some times and display an useful message about the cause of failure.
ACTUAL RESULTS
- The update inventory job sometimes (1 every 5) fails.
- There is no retry or ignore option, and the job template will fail to start.
- There is no useful indication about the reason of the failure.
- The stdout mentioned is empty or not shown in the web interface, even with the debug verbosity (that is the maximum level of verbosity).
- The useless error message is the following:
Traceback (most recent call last): File
"/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/tasks.py",
line 1243, in run self.pre_run_hook(self.instance, private_data_dir)
File
"/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/tasks.py",
line 2532, in pre_run_hook sync_task.run(local_project_sync.id) File
"/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/tasks.py",
line 683, in _wrapped return f(self, *args, **kwargs) File
"/var/lib/awx/venv/awx/lib/python3.6/site-packages/awx/main/tasks.py",
line 1408, in run raise AwxTaskError.TaskError(self.instance, rc)
Exception: project_update 508 (failed) encountered an error (rc=254),
please see task stdout for details.
ADDITIONAL INFORMATION
The job template and inventory are custom for a project, but I can create a dummy project to reproduce this bug. Please give me some pointer on the best practices for integrating a test case.