# Troubleshoot ansible\_terminal\_stderr\_re (network/cisco.ios)

**URL:** <https://forum.ansible.com/t/troubleshoot-ansible-terminal-stderr-re-network-cisco-ios/44756>\
**Category:** Get Help\
**Tags:** ios, cisco, network\
**Created:** [October 28, 2025, 8:57pm UTC](https://forum.ansible.com/t/troubleshoot-ansible-terminal-stderr-re-network-cisco-ios/44756 "2025-10-28T20:57:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![th-kbr-703](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/th-kbr-703/32/7514_2.png) [@th-kbr-703](https://forum.ansible.com/u/th-kbr-703)\
**Post date:** [October 28, 2025, 8:57pm UTC](https://forum.ansible.com/t/troubleshoot-ansible-terminal-stderr-re-network-cisco-ios/44756/1 "2025-10-28T20:57:01Z")

</div>

**Troubleshooting `ansible_terminal_stderr_re` for cisco.ios**

- I’m running a command on a `cisco.ios` network device which returns output matching to the default `terminal_stderr_re` patterns causing a failure for `ios_command`
- According to [Network Debug and Troubleshooting Guide](https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html) in Ansible 2.9+ this can be overridden using the `ansible_terminal_stderr_re` variable.
- If I set `ansible_terminal_stderr_re` to `[]` (empty list) or `null`, then Ansible falls back silently to the default error patterns defined for `cisco.ios` configuration `terminal_stderr_re`. This results in a command failure for me (my command output matches the default error pattern list for cisco.ios).
- If I set `ansible_terminal_stderr_re` to contain **at least one Real Non-Matching Error Pattern String, then it replaces/overrides the existing list or error patterns. This is my current workaround** (as suggested in the linked debug/troubleshoot document).

**How can I view the default value of `terminal_stderr_re` from within my playbook?**

- I tried using ansible.builtin.debug to output `msg: "{{ansible_terminal_stderr_re}}"` or `msg: "{{terminal_stderr_re}}"` but it says those variables are undefined. Maybe they are not exposed as variables to the playbook tasks?

**I would like to be able to do one of the following:**

- Keep the default values of cisco.ios terminal\_stderr\_re patterns, and just remove the offending items from the list (using jinja filters)
  - This would be workable if the existing/default value of `terminal_stderr_re` was exposed as some type of variable - I didn’t see it listed in hostvars[inventory\_hostname].

- Set ansible\_terminal\_stderr\_re at the task-level to an empty list or null.
  - The values `[]` and `null` can be set, but they Seem to be Ignored when the `terminal_stderr_re` Error Patterns are checked against `cisco.ios` device output. This seems to apply to other device types as well, cisco.ios is just the device type I’m testing against.

Let me know if there is some workaround to override the pattern list setting it to empty or null, or to view the default settings of the pattern list from within a playbook as some kind of variable compatible with things like builtin.debug and jinja template strings. My test environments have Ansible versions 2.14 and 2.16. I have not tested with other versions.
