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
ERROR! Unexpected Exception, this is probably a bug: Could not load "is": 'is' #80762
Comments
Files identified in the description:
If these files are incorrect, please update the |
This error indicates that you are attempting to use a An example that causes this:
The
So you would likely need to grep or otherwise search for something to the effect of:
|
@sivel Thank you for your fast response! However, grepping for that in my role comes up dry: ❯ grep -PHRn '\|\s*is' roles/netbox_update
❌1 02:01pm 05/10 [jmccoy-netbox] (M8) jmccoy@fedora:…/configMgmt/ansible
❯ To the best of my knowledge, I have not used the ❯ grep -PHRn '\sis\s' roles/netbox_update
roles/netbox_update/tasks/address.yml:2:## This is required because the netbox module cannot fix incorrect netmasks
roles/netbox_update/tasks/address.yml:61:## This is required because the netbox module cannot fix incorrect netmasks
roles/netbox_update/tasks/address.yml:134:## This is required because the netbox module cannot fix incorrect netmasks
roles/netbox_update/tasks/interface.yml:30: or ('Virtual' if item.module is defined and 'virtio' in item.module)
roles/netbox_update/tasks/interface.yml:53: when: ansible_facts.ansible_local.bz_ipmi is defined
roles/netbox_update/tasks/main.yml:4:# the device update step sometimes fails with an error about not being able to resolve the id of a primary ip. this is due to the prefix update drifting due to unknown reasons. re-running this role multiple times will eventually fix it. this keeps happening, and needs to be resolved somehow.
roles/netbox_update/tasks/netbox_query.yml:76: ignore_errors: true # otherwise fails if host is not existing
roles/netbox_update/tasks/add_host.yml:2:- name: Ensure host is not a VM Replacing |
The issue seems to be with this task:
Looking at the traceback, it indicates the error is happening in the process of templating the Traceback (most recent call last):
File "/home/jmccoy/.local/lib/python3.11/site-packages/ansible/executor/task_executor.py", line 111, in run
items = self._get_loop_items()
^^^^^^^^^^^^^^^^^^^^^^
File "/home/jmccoy/.local/lib/python3.11/site-packages/ansible/executor/task_executor.py", line 249, in _get_loop_items
items = templar.template(self._task.loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Can you please provide us with that task definition including the I've played around with this a bit more, and something like this must be in there:
Maybe something like this:
|
@sivel Thank you for identifying that the error came from that loop. I was able to find the unmatched Although this allows me to proceed, I find the matter perplexing. The Jinja2 docs for |
Can you point to the docs that suggest you can use From the upstream jinja2 docs:
If our docs are misleading, we should correct that. |
My understanding came from: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tests.html#test-syntax
The usage of |
Summary
When I attempt to run my playbook that updates host information in Netbox, I receive the following error:
This appears while running different tasks, depending on the tags I run with. Sometimes it appears when running
netbox.netbox.netbox_device
, and other times withansible.builtin.uri
. Current playbook/role and log with-vvv
is attached.ansible.log.gz
Issue Type
Bug Report
Component Name
jinja2
Ansible Version
Configuration
OS / Environment
Fedora 38 (dnf) and OpenSUSE Tumbleweed (distrobox/pip).
Steps to Reproduce
netbox_update.tar.gz
Expected Results
I expect this to either work or produce an actionable error message as opposed to a cryptic stack trace.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: