-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
JMESPathError in json_query filter plugin in v2.9.23 #2856
Comments
Files identified in the description: If these files are inaccurate, please update the |
The workaround presented in the original issue still works btw: Broken: {{ local_config_files | json_query('[? state == `file` && ends_with(path, `.j2`)]') }} Working: {{ local_config_files | to_json | from_json | json_query('[? state == `file` && ends_with(path, `.j2`)]') }} |
You are apparently using the filter included in Ansible 2.9, and not the one from this repository. In any case, the filter itself in Ansible 2.9 did not change (https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/plugins/filter/json_query.py was last changed in 2017). Please note that Ansible 2.9 is in maintenance mode and only receives security fixes, so you likely will have to install community.general and use the filter from there. |
Interesting that security fixes introduce regressions. I'd be happy to report the issue there if the bot would let me: ansible/ansible#75091 Also pretty sure I have it installed, not sure what exactly changed that it suddely broke. And the reason for me using this version is simply that that's the version being shipped on Debian 10. |
Are you actually sure that it worked with 2.9.21? I did run your reproducer with Ansible 2.9.20, 2.9.21, 2.9.22 and 2.9.23, and it always resulted in |
Debian 10 comes with Ansible 2.7.7, btw (https://packages.debian.org/buster/ansible). |
Your reproducer works fine with the version of json_query included in this repo, btw. (Which is not surprising, since it has been fixed in #320.) |
Right. Now that you mention it. I actually use the version on # apt-cache policy ansible
ansible:
Installed: 2.9.23-1ppa~trusty
Candidate: 2.9.23-1ppa~trusty
Version table:
*** 2.9.23-1ppa~trusty 500
500 http://ppa.launchpad.net/ansible/ansible/ubuntu trusty/main amd64 Packages
100 /var/lib/dpkg/status
2.9.16+dfsg-1~bpo10+2 100
100 http://deb.debian.org/debian buster-backports/main amd64 Packages
2.7.7+dfsg-1 500
500 http://deb.debian.org/debian buster/main amd64 Packages |
@BrainStone Can you confirm issue has been fixed using needs_info |
Yes the So as it seems that this issue doesn't belong here it would be very much aprechiated if my issue (ansible/ansible#75091) over on the Ansible repo could be reopened after it has been closed by a bot (and I can't reopen it) |
Summary
When using a
json_query
filter after updating to 2.9.23 from 2.9.21 (can't 100% pinpoint this but I believe the critical change happened when updating from v2.9.22 to v2.9.23) I get this error:Seems to be a recurrance of ansible/ansible#27299
Issue Type
Bug Report
Component Name
json_query
Ansible Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Debian 10
Steps to Reproduce
Expression that triggers it:
{{ local_config_files | json_query('[? state == `file` && ends_with(path, `.j2`)]') }}
Example object for local_config_files:
Expected Results
To work like it did in v2.9.21, aka that json_query call working as expected with the given input.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: