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

[BUG] some servicemon checker runs crash with a UnboundLocalError #2065

Closed
lunkwill42 opened this issue Dec 18, 2019 · 0 comments
Closed

[BUG] some servicemon checker runs crash with a UnboundLocalError #2065

lunkwill42 opened this issue Dec 18, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@lunkwill42
Copy link
Member

Describe the bug

Once #2057 has been applied, some servicemon checker runs crash with a strange UnboundLocalError

Expected behavior

No unhandled exceptions should leak through plugin runs.

Environment (please complete the following information):

  • NAV version installed: 5.0.2

Traceback

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/opt/venvs/nav/lib/python3.5/site-packages/nav/statemon/RunQueue.py", line 67, in run
    self.execute(checker)
  File "/opt/venvs/nav/lib/python3.5/site-packages/nav/statemon/RunQueue.py", line 80, in execute
    checker.run()
  File "/opt/venvs/nav/lib/python3.5/site-packages/nav/statemon/abstractchecker.py", line 109, in run
    status, info = self.execute_test()
  File "/opt/venvs/nav/lib/python3.5/site-packages/nav/statemon/abstractchecker.py", line 194, in execute_test
    return status, info
UnboundLocalError: local variable 'info' referenced before assignment

Additional context

The problem appears to stem from a change in the way except clauses are handled in Python 3 vs Python 2. The exception handler in the affected code reuses the exception variable in the outer scope, but this no longer works in Python 3.

@lunkwill42 lunkwill42 added the bug label Dec 18, 2019
@lunkwill42 lunkwill42 added this to the 5.0.3 milestone Dec 18, 2019
@lunkwill42 lunkwill42 self-assigned this Dec 18, 2019
@lunkwill42 lunkwill42 changed the title [BUG] some servicemon c hecker runs crash with a UnboundLocalError [BUG] some servicemon checker runs crash with a UnboundLocalError Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant