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

Bugfix weak object has gone away #205

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

indy-independence
Copy link
Member

Disable jinja cache to prevent intermittent issues with TypeErrors:
'TypeError: weak object has gone away'
Error has only occured at SU so far, but this seemed to fix the issue.

Example traceback:
File "/opt/cnaas/venv/lib/python3.7/site-packages/nornir_jinja2/plugins/tasks/template_file.py", line 42, in template_file
t = env.get_template(template)
File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/environment.py", line 883, in get_template
return self._load_template(name, self.make_globals(globals))
File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/environment.py", line 852, in _load_template
template = self.cache.get(cache_key)
File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/utils.py", line 386, in get
return self[key]
File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/utils.py", line 428, in getitem
rv = self._mapping[key]
TypeError: weak object has gone away

'TypeError: weak object has gone away'
Error has only occured at SU so far, but this seemed to fix the issue.

Example traceback:
  File "/opt/cnaas/venv/lib/python3.7/site-packages/nornir_jinja2/plugins/tasks/template_file.py", line 42, in template_file
    t = env.get_template(template)
  File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/environment.py", line 883, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/environment.py", line 852, in _load_template
    template = self.cache.get(cache_key)
  File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/utils.py", line 386, in get
    return self[key]
  File "/opt/cnaas/venv/lib/python3.7/site-packages/jinja2/utils.py", line 428, in __getitem__
    rv = self._mapping[key]
TypeError: weak object has gone away
@codecov
Copy link

codecov bot commented Sep 24, 2021

Codecov Report

Merging #205 (f781b81) into develop (6fe5810) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #205   +/-   ##
========================================
  Coverage    59.71%   59.71%           
========================================
  Files           60       60           
  Lines         6139     6139           
========================================
  Hits          3666     3666           
  Misses        2473     2473           
Impacted Files Coverage Δ
src/cnaas_nms/confpush/nornir_helper.py 93.54% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fe5810...f781b81. Read the comment docs.

@indy-independence indy-independence merged commit 64ef03e into develop Sep 28, 2021
@indy-independence indy-independence deleted the bugfix.jinjacache_weakref_went_away branch September 28, 2021 08:34
@indy-independence indy-independence added this to the v1.3.0 milestone Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant