MrMEEE / awx-build

144 stars 39 forks source link

inventory import failed #33

Closed Aglidic closed 5 years ago

Aglidic commented 6 years ago

Hello i can't import inventory from UI. But it works when i use the awx-amange command (same parameter as the IU).

I think the issue is comming from the embedded python module

Aglidic commented 6 years ago

to be more precise. create a new credentials for rhevm create a new inventory and create a new source for rhevm based on the rhevm credentials. run sync through webui or tower-cli and i got this error:

HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: text/plain ;utf-8 Vary: Accept X-API-Node: rh754stdc0c.ceti.etat-ge.ch X-API-Time: 0.065s

1.485 INFO     Updating inventory 3: inventory.DEV
1.501 DEBUG    Using system install of ansible-inventory CLI: /bin/ansible-inventory
1.501 INFO     Reading Ansible inventory source: /tmp/awx_inventory_H7AcE3/tmp4AdvjJ

Traceback (most recent call last): File "/opt/awx/bin/awx-manage", line 11, in sys.exit(manage()) File "/opt/awx/embedded/lib/python2.7/site-packages/awx/init.py", line 109, in manage execute_from_command_line(sys.argv) File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line utility.execute() File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/init.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, *cmd_options) File "/opt/awx/embedded/lib64/python2.7/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(args, **options) File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 990, in handle self.is_custom) File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 241, in load_inventory_source is_custom=is_custom).load() File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 176, in load data = self.command_to_json(base_args + ['--list']) File "/opt/awx/embedded/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py", line 159, in command_to_json self.method, proc.returncode, stdout, stderr)) RuntimeError: ansible-inventory failed (rc=1) with stdout:

stderr: [WARNING]: * Failed to parse /tmp/awx_inventory_H7AcE3/tmp4AdvjJ with script plugin: Inventory script (/tmp/awx_inventory_H7AcE3/tmp4AdvjJ) had an execution error:

[WARNING]: Unable to parse /tmp/awx_inventory_H7AcE3/tmp4AdvjJ as an inventory source

ERROR! No inventory was parsed, please check your configuration and options.

now if i give a bash access to the awx user. Su to the awx user and run the command /opt/awx/bin/awx-manage with the parameter i have found on the api for my failed sync job it will success.

So for me the issue is clearly due to python lib

Aglidic commented 6 years ago

so based on the list you furnished here: https://github.com/MrMEEE/awx-build/issues/15

i have remove all "unnecesary" python module. Now if i try to sync again i have the error: ovirt: inventory script require ovirt-engine-sdk-python >= 4.0.0

but this module should be in the embedded no?

MrMEEE commented 6 years ago

Hi..

I'm installing the dependencies from the upstream awx project, so maybe the module is missing there?...

Have you tried installing the module manually?

Aglidic commented 6 years ago

module are in the embedded directory.

it's really weird

Aglidic commented 6 years ago

to install the module you mean pip install --target /opt/awx/embedded ?

Aglidic commented 6 years ago

ok i finally success with that. I don't know why but it doesn't take the module on embedded.

So i have create a virtualenv in /var/lib/awx/venv/awx and install module in there.

Don't forgot to change the user

MrMEEE commented 6 years ago

Hmmm.. Haven't tested the ovirt connection stuff..

Will see if I can get the time to do it...

natman commented 5 years ago

because of the build of teh embedded pycurl 7.43 without nss support. All jobs related to RHV authentications are impacted, included RHV playbooks. All details in this issue: https://github.com/MrMEEE/awx-build/issues/72

MrMEEE commented 5 years ago

Ok.. we'll close this and move to #72