You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fatal: [my.hostname.net]: FAILED! => {
"msg": "An unhandled exception occurred while running the lookup plugin 'community.general.bitwarden'. Error was a <class 'KeyError'>, original message: 'fields'. 'fields'"
}
With debug:
exception during Jinja2 execution: Traceback (most recent call last): File "/opt/homebrew/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible/template/__init__.py", line 831, in _lookup ran = instance.run(loop_terms, variables=self._available_variables, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible_collections/community/general/plugins/lookup/bitwarden.py", line 159, in run return [_bitwarden.get_field(field, term, search_field, collection_id) for term in terms] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible_collections/community/general/plugins/lookup/bitwarden.py", line 159, in <listcomp> return [_bitwarden.get_field(field, term, search_field, collection_id) for term in terms] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible_collections/community/general/plugins/lookup/bitwarden.py", line 141, in get_field for custom_field in match['fields']: ~~~~~^^^^^^^^^^KeyError: 'fields'fatal: [my.hostname.net]: FAILED! => { "msg": "An unhandled exception occurred while running the lookup plugin 'community.general.bitwarden'. Error was a <class 'KeyError'>, original message: 'fields'. 'fields'"}
Expected the contents of the secure not to be printed to the terminal
Actual Results
fatal: [my.hostname.net]: FAILED! => { "msg": "An unhandled exception occurred while running the lookup plugin 'community.general.bitwarden'. Error was a <class 'KeyError'>, original message: 'fields'. 'fields'"}
Code of Conduct
I agree to follow the Ansible Code of Conduct
The text was updated successfully, but these errors were encountered:
CC @reverendj1 who worked on this in #5694 and might have an idea what happens here. I guess the obvious fix is to check whether 'fields' in match before looping over match['fields'], but maybe there's something more interesting/complex going on.
Playing with this, another branch for some of the main level keys fixes the original issue:
137a136,137
> elif field in ['favorite', 'folderId', 'name', 'notes', 'organizationId', 'reprompt', 'revisionDate']:
> return [match[field] for match in matches]
Summary
When using the community.general.bitwarden lookup there is an error trying to lookup a secure note.
Playbook:
Error:
With debug:
Same thing when trying to do the lookup by id:
Issue Type
Bug Report
Component Name
bitwarden
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
Source: MacOS
Target: CentOS Stream 9
Steps to Reproduce
Expected Results
Expected the contents of the secure not to be printed to the terminal
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: