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

AWX doesn't like parentheses in json payload when creating smart inventory #3063

Closed
kefiras opened this issue Jan 24, 2019 · 3 comments
Closed

Comments

@kefiras
Copy link

kefiras commented Jan 24, 2019

ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • API
SUMMARY

AWX sending internal server error when trying to create a smart inventory via API.

Using curl to update the API:
curl -u user:password -ksXPOST https://host/api/v2/inventories/ -d @test -H "Content-Type: application/json"
with below payload:
{ "name": "Nonprod15", "description": "Nonprod15", "organization": 92, "kind": "smart", "host_filter": "groups__name=nonprod15-(nonprod15-a-1)master", "variables": "", "insights_credential": null }

Getting the error:
{"host_filter":["Invalid query groups__name=nonprod15-(nonprod15-a-1)master"]}

ENVIRONMENT
  • AWX version: 1.0.4.0
  • AWX install method: docker on linux
  • Ansible version: 2.4.0
  • Operating System: OSX
  • Web Browser: curl
STEPS TO REPRODUCE

Try to update the API as per description above

EXPECTED RESULTS

Expected to create smart inventory as per definition

ACTUAL RESULTS

Server error with error mentioned in the description

ADDITIONAL INFORMATION

I can create smart inventory with any other groups that doesn't contain parentheses.

@kefiras kefiras changed the title AWX doesn't like parentheses in json payload AWX doesn't like parentheses in json payload when creating smart inventory Jan 24, 2019
@ryanpetrello
Copy link
Contributor

ryanpetrello commented Apr 26, 2019

I'm able to reproduce this:

image

image

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Apr 26, 2019

@kefiras,

Does quoting the value like this work for you?

groups__name="nonprod15-(nonprod15-a-1)master"

@gamuniz
Copy link
Contributor

gamuniz commented Apr 11, 2023

The use of smart inventories is deprecated in favor of using the work done in this PR:
#13303

Constructed inventories

@gamuniz gamuniz closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2023
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

5 participants