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

Inventory file dropdown adds slash to filename #9701

Closed
lukasertl opened this issue Mar 25, 2021 · 5 comments
Closed

Inventory file dropdown adds slash to filename #9701

lukasertl opened this issue Mar 25, 2021 · 5 comments

Comments

@lukasertl
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

Creating an inventory - Sourced from a project. The dropdown for the inventory file actually shows the correct file (and others), but if I choose it there's a slash added to the end of the filename. The same thing happens if I freely type a filename into the textbox.

ENVIRONMENT
  • AWX version: 18.0.0
  • AWX install method: openshift (using AWX operator)
@kladiv
Copy link

kladiv commented Mar 25, 2021

+1 same issue

softwarefactory-project-zuul bot added a commit that referenced this issue Mar 26, 2021
Don't append a slash to file paths

for #9701

Reviewed-by: Jake McDermott <[email protected]>
Reviewed-by: Shane McDonald <[email protected]>
Reviewed-by: Alex Corey <[email protected]>
@larueli
Copy link

larueli commented Mar 28, 2021

I had the same issue on a fresh AWX 18.

The fact is the "runner" is choosig the wrong folder.

When i ran into the issue desribed above, I used the api to edit manually the value and remove the trailing slash.
You can do it easily by opening the dev perspective in firefox and the network tab before hitting the save button while editing a inventory source, click the save button, check the put operation in the network tab, right-click on it and edit, then edit the request parameters (source_path) and set it to the correct value and resend it.

But... it didn't work either (maybe it's a different issue ? - edit, it is : #9704). Here is my log :

Logs
ansible-inventory [core 2.11.0b3.post0] 
  config file = /tmp/pdd_wrapper_37_xa9qdvcg/awx_37_o4gmbvbm/project/ansible.cfg
  configured module search path = ['/tmp/pdd_wrapper_37_xa9qdvcg/awx_37_o4gmbvbm/project/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /runner/requirements_collections:/tmp/pdd_wrapper_37_xa9qdvcg/awx_37_o4gmbvbm/project/collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-inventory
  python version = 3.8.3 (default, Aug 31 2020, 16:03:14) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
  jinja version = 2.10.3
  libyaml = True
Using /tmp/pdd_wrapper_37_xa9qdvcg/awx_37_o4gmbvbm/project/ansible.cfg as config file
[WARNING]: Ignoring invalid path provided to plugin path:
'/runner/project/inventory' is not a directory
host_list declined parsing /runner/project/inventory/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /runner/project/inventory/hosts as it did not pass its verify_file() method
auto declined parsing /runner/project/inventory/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /runner/project/inventory/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /runner/project/inventory/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /runner/project/inventory/hosts as it did not pass its verify_file() method
[WARNING]: Unable to parse /runner/project/inventory/hosts as an inventory
source
ERROR! No inventory was parsed, please check your configuration and options.

I came back to the project view in AWX and saw that my projects are stored under : /var/lib/awx/projects, and folder of my project name is written in the Playbook Directory which is something like _number_project.

I went back to my network tab and set /var/lib/awx/projects/_number_project/inventory/hosts as my source_path and it worked !

Hope it can help till there is a bug fix released.

@shanemcd
Copy link
Member

@larueli Nice hacking. Another tip for you... if you just visit /api/v2 in your browser, you can do all of this much easier than working in the network tab.

@unlikelyzero
Copy link

This has been updated in our tests

@maveleo
Copy link

maveleo commented Jan 7, 2022

I am experiencing the same issue with AWX 19.4.0
I run AWX within a Kubernetes cluster using the AWX operator
looks like this is also tracked in #10878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants