Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing which #44

Closed
mis4s opened this issue Sep 7, 2017 · 2 comments
Closed

Missing which #44

mis4s opened this issue Sep 7, 2017 · 2 comments
Labels

Comments

@mis4s
Copy link

mis4s commented Sep 7, 2017

Summary

Hi, I wanted to add inventory sourced from a project. When I start sync, it returns the error below.
When I installed which on docker container awx_tasks, synchronization was successful.

Environment

  • AWX version: latest
  • Ansible version: latest from epel
  • Operating System: Centos latest
  • Web Browser: Chrome

Steps To Reproduce:

  1. Build images
  2. Add project
  3. Add inventory sourced from a project
  4. Try sync hosts

Expected Results:

synchronizes inventory

Actual Results:

Synchronize return with status failed

Additional Information:

2017-09-07 20:31:44,578 INFO     awx.main.commands.inventory_import Updating inventory 3: XXX
2017-09-07 20:31:44,591 DEBUG    awx.main.commands.inventory_import Using backported ansible-inventory module: /usr/lib/python2.7/site-packages/awx/plugins/ansible_inventory/backport.py
2017-09-07 20:31:44,591 INFO     awx.main.commands.inventory_import Reading Ansible inventory source: /var/lib/awx/projects/_8__aXXX
Traceback (most recent call last):
  File "/usr/bin/awx-manage", line 9, in <module>
    load_entry_point('awx==1.0.0.280', 'console_scripts', 'awx-manage')()
  File "/usr/lib/python2.7/site-packages/awx/__init__.py", line 107, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py", line 661, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 955, in handle_noargs
    self.is_custom)
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 210, in load_inventory_source
    is_custom=is_custom).load()
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 179, in load
    data = self.command_to_json(base_args + ['--list'])
  File "/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 163, in command_to_json
    self.method, proc.returncode, stdout, stderr))
RuntimeError: ansible-inventory backport failed (rc=1) with stdout:

stderr:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/awx/plugins/ansible_inventory/backport.py", line 323, in <module>
    ansible_path = subprocess.check_output(['which', 'ansible']).strip()
  File "/usr/lib64/python2.7/subprocess.py", line 568, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
@jlmitch5
Copy link
Contributor

jlmitch5 commented Sep 7, 2017

Disregard PR linkage, install.md is about build deps of the tower server, and these seems to be about adding a dependency to hosts Ansible will be ran against (as far as I understand).

CC @AlanCoding, you probably know what the thing to do here would be.

@AlanCoding
Copy link
Member

An upstream exists for the backport code - and here is what we're talking about https://github.com/ansible/ansible-inventory-backport/blob/master/backport.py#L323

We should prefer to use something more durable along the lines of python's disutils.find to find the Ansible location.

Good bug, thanks for raising it.

AlanCoding referenced this issue in AlanCoding/awx Sep 8, 2017
Fixes: #44

Signed-off-by: Patrick Uiterwijk <patrick@puiterwijk.org>
fosterseth added a commit that referenced this issue Aug 10, 2022
Inherit from our own APIView, not rest framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants