Use Fact Cache in templates throws IOError (see log)
Create a new template, use Demo Project, tick "Use Fact Cache"
Hosts with facts
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'
Running the template without "Use Fact Cache" works without error.
This is a fresh install, installed 2018-06-07
@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!