Awx: IOError when using Fact Cache in template

Created on 11 Jun 2018  路  5Comments  路  Source: ansible/awx

ISSUE TYPE

  • Bug Report
COMPONENT NAME

  • UI
SUMMARY

Use Fact Cache in templates throws IOError (see log)

ENVIRONMENT
  • AWX version: 1.0.6.14
  • AWX install method: docker on linux
  • Ansible version: 2.5.4
  • Operating System: CentOS Linux release 7.4.1708 (Core)
  • Web Browser: Firefox 60.0.2
  • Docker: 18.03.0-ce, build 0520e24
  • Python: 2.7.5
STEPS TO REPRODUCE

Create a new template, use Demo Project, tick "Use Fact Cache"

EXPECTED RESULTS

Hosts with facts

ACTUAL RESULTS

Error in job:
Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/awx/main/tasks.py", line 905, in run kwargs.setdefault('fact_modification_times', {}) File "/usr/lib/python2.7/site-packages/awx/main/models/jobs.py", line 775, in start_job_fact_cache with codecs.open(filepath, 'w', encoding='utf-8') as f: File "/var/lib/awx/venv/awx/lib64/python2.7/codecs.py", line 881, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 2] No such file or directory: u'/tmp/awx_38_qFe2C8/facts/kcserver01/02'

ADDITIONAL INFORMATION

Running the template without "Use Fact Cache" works without error.
This is a fresh install, installed 2018-06-07

api medium in_progress bug

All 5 comments

@PaulRitzkat do you have a host with a / character in it? How are you importing your inventory?

@PaulRitzkat this is actually a bug in ansible itself: https://github.com/ansible/ansible/issues/41413
I'm going to add some code in awx to detect this scenario and cause awx to fail more gracefully (by skipping fact gathering for hosts that contain an / in their name).

@ryanpetrello interesting. This could be the case, I'll check it tomorrow and get back to you. The inventory is imported via awx-manage.
I did limit the template to one hosts with no / or other special chars in its name and it failed too.

@PaulRitzkat in this case, the limit shouldn't make a difference. I'm going to contribute a change in the near future that will make awx more gracefully handle this scenario, here; I won't be able to fix caching for hosts that contain /, but I _can_ make the _other_ working hosts in the inventory cache properly.

@PaulRitzkat we've just released 1.0.7, which we believe resolves the underlying issue here. You can try it out here: https://github.com/ansible/awx/releases/tag/1.0.7

Let us know if you're still seeing this issue after installing the latest awx - thanks!

Was this page helpful?
0 / 5 - 0 ratings