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

maximum recursion depth exceeded while getting the str of an object #71786

Closed
yoctozepto opened this issue Sep 17, 2020 · 7 comments
Closed

maximum recursion depth exceeded while getting the str of an object #71786

yoctozepto opened this issue Sep 17, 2020 · 7 comments
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@yoctozepto
Copy link

SUMMARY

On Ansible 2.10.0rc1 (Ansible base version 2.10.1) we get: "maximum recursion depth exceeded while getting the str of an object" on CentOS 8 (running Python 3.6).
We don't have this error on Ansible before 2.10 and with Ansible 2.10 but on Debian Buster (Python 3.7) or Ubuntu Focal (Python 3.8).

The full error is attached because it includes the variable expansion that failed and that's quite lengthy (but still finite and the dictionary is not that deep).

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.10.1
CONFIGURATION

OS / ENVIRONMENT

CentOS 8 stream

STEPS TO REPRODUCE

Sorry, I haven't had a chance to distill a minimal test-case yet.

EXPECTED RESULTS

Variable expands just fine (like it did and can do but on other platforms).

ACTUAL RESULTS
I got it attached.

expansion_error.txt

@ansibot
Copy link
Contributor

ansibot commented Sep 17, 2020

Files identified in the description:
None

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 17, 2020
@samdoran
Copy link
Contributor

Please create a simple reproducer so we can investigate this further.

needs_info

@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Sep 17, 2020
@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Sep 17, 2020
@yoctozepto
Copy link
Author

Unfortunately it belongs to the 'easier said than done' category.

I did not succeed in isolating the failure.

However, I noticed that different scenarios fail at different tasks, and hence different vars.
One is even very simple. Consider the vars:

network_interface: "eth0"
tunnel_interface: "{{ network_interface }}"
neutron_sriov_physnet_mappings:
  sriovnet1: "{{ tunnel_interface }}"

And the error is:

An unhandled exception occurred while templating '{{ neutron_sriov_physnet_mappings.items() | map('join', ':') | join(',') }}'. Error was a <class 'RecursionError'>, original message: maximum recursion depth exceeded while calling a Python object

It looks as if something destroys some internal state during the execution and it will fail on sufficiently long scenarios.

Please tell me how I can show stack trace of that failure to let us see some details. I could not find a way.

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Sep 19, 2020
@yoctozepto
Copy link
Author

Cross-ref links: https://bugs.launchpad.net/kolla-ansible/+bug/1896594 & https://review.opendev.org/752420

I managed to scope it to our Neutron role. Other tested do not exhibit this behaviour.
Still unable to reproduce in a simple case.

@mdavis-xyz
Copy link
Contributor

This is likely a duplicate of #71920.

(Well, that one is a duplicate of this because this is older, but that one has a MWE and is closer to a solution.)

@mdavis-xyz
Copy link
Contributor

#71920 has just been closed with a PR, so I think this ticket should be closed too.

@mkrizek
Copy link
Contributor

mkrizek commented Sep 30, 2020

Closing per above.

@mkrizek mkrizek closed this as completed Sep 30, 2020
@ansible ansible locked and limited conversation to collaborators Oct 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

5 participants