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] ipdevpoll psuwatch crash with TypeError immediately after upgrade to NAV 5 #2038

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

Comments

@lunkwill42
Copy link
Member

Describe the bug

Shortly after upgrading to NAV 5, the power supply/fan data might not have been updated by the ipdevpoll inventory job, so the data is just what's was migrated with the schema migrations. This may lead to the psuwathc plugin attempting to monitor the status of a PSU or FAN unit whose internal_id has not yet been set.

Expected behavior

We cannot check the status of a unit whose ID is unkown. Their status should just be set to UNKNOWN as well.

Traceback

2019-12-10 11:48:49,968 [ERROR jobs.jobhandler] [statuscheck example-sw.example.org] Plugin nav.ipdevpoll.plugins.psuwatch.PowerSupplyOrFanStateWatcher('example-sw.example.org') reported an unhandled failure
Traceback (most recent call last):
  File "/opt/venvs/nav/lib/python3.5/site-packages/twisted/internet/defer.py", line 1532, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
  File "/opt/venvs/nav/lib/python3.5/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
    result = g.send(result)
  File "/opt/venvs/nav/lib/python3.5/site-packages/nav/ipdevpoll/plugins/psuwatch.py", line 78, in _retrieve_current_unit_state
    state = yield method(unit.internal_id)
  File "/opt/venvs/nav/lib/python3.5/site-packages/twisted/internet/defer.py", line 1532, in unwindGenerator
    return _inlineCallbacks(None, gen, Deferred())
--- <exception caught here> ---
  File "/opt/venvs/nav/lib/python3.5/site-packages/twisted/internet/defer.py", line 1386, in _inlineCallbacks
    result = g.send(result)
  File "/opt/venvs/nav/lib/python3.5/site-packages/nav/mibs/cisco_entity_fru_control_mib.py", line 110, in get_power_supply_status
    "cefcFRUPowerOperStatus", (int(internal_id),)
builtins.TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Environment (please complete the following information):

  • NAV version installed: 5.0.1
@lunkwill42 lunkwill42 added the bug label Dec 10, 2019
@lunkwill42 lunkwill42 added this to the 5.0.2 milestone Dec 10, 2019
@lunkwill42 lunkwill42 self-assigned this Dec 10, 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