SNMP sensor broken in 0.49.1
Home Assistant release (hass --version):
0.49.1
Python release (python3 --version):
3.4.2
Component/platform: SNMP sensor
Description of problem: After upgrading from 0.49 to 0.49.1, none of my SNMP sensors are working and there are errors in the log.
Expected: Working SNMP sensors
Problem-relevant configuration.yaml entries and steps to reproduce:
- platform: snmp
name: "Laptop Mac David office"
host: 192.168.xxx.x
community: yyyy
baseoid: 1.3.6.1.2.1.31.1.1.1.15.5
scan_interval: 20
- platform: snmp
name: "Laptop work David office"
host: 192.168.xxx.x
community: yyyy
baseoid: 1.3.6.1.2.1.31.1.1.1.15.8
scan_interval: 20
- platform: snmp
name: "UPS Battery Charge"
host: !secret UPS_SNMP_HOST
community: !secret UPS_SNMP_COMMUNITY
baseoid: 1.3.6.1.4.1.6574.4.3.1.1.0
unit_of_measurement: "%"
version: 2c
scan_interval: 60
- platform: snmp
name: "UPS Battery Voltage"
host: !secret UPS_SNMP_HOST
community: !secret UPS_SNMP_COMMUNITY
baseoid: 1.3.6.1.4.1.6574.4.3.2.1.0
unit_of_measurement: "V"
version: 2c
scan_interval: 60
- platform: snmp
name: "UPS Input Voltage"
host: !secret UPS_SNMP_HOST
community: !secret UPS_SNMP_COMMUNITY
baseoid: 1.3.6.1.4.1.6574.4.4.1.1.0
unit_of_measurement: "V"
version: 2c
scan_interval: 60
- platform: snmp
name: "UPS Load"
host: !secret UPS_SNMP_HOST
community: !secret UPS_SNMP_COMMUNITY
baseoid: 1.3.6.1.4.1.6574.4.2.12.1.0
unit_of_measurement: "%"
version: 2c
scan_interval: 60
- platform: snmp
name: "UPS Runtime"
host: !secret UPS_SNMP_HOST
community: !secret UPS_SNMP_COMMUNITY
baseoid: 1.3.6.1.4.1.6574.4.3.6.1.0
scan_interval: 60
- platform: snmp
name: "UPS Status"
host: !secret UPS_SNMP_HOST
community: !secret UPS_SNMP_COMMUNITY
baseoid: 1.3.6.1.4.1.6574.4.2.1.0
scan_interval: 30
- set up working SNMP sensors while running Home Assistant 0.49
- upgrade to Home Assistant 0.49.1 while leaving the config for the SNMP sensors untouched
- witness your SNMP sensors now being broken
Traceback (if applicable):
2017-07-27 14:59:08 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 WARNING (MainThread) [homeassistant.setup] Setup of media_player is taking over 10 seconds.
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
2017-07-27 14:59:09 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform snmp
Traceback (most recent call last):
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule
exec (modData, g)
File "<string>", line 24, in <module>
File "<string>", line 71, in clone
TypeError: clone() takes from 1 to 2 positional arguments but 4 were given
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/sensor/snmp.py", line 66, in setup_platform
getCmd(SnmpEngine(),
File "/home/hass/.homeassistant/deps/pysnmp/entity/engine.py", line 90, in __init__
'__SNMP-FRAMEWORK-MIB', 'snmpEngineMaxMessageSize')
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 400, in importSymbols
self.loadModules(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 362, in loadModules
self.loadModule(modName, **userCtx)
File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 330, in loadModule
'MIB module \"%s\" load error: %s' % (modPath, traceback.format_exception(*sys.exc_info()))
pysnmp.smi.error.MibLoadError: MIB module "/home/hass/.homeassistant/deps/pysnmp/smi/mibs/instances/__SNMP-FRAMEWORK-MIB.py" load error: ['Traceback (most recent call last):\n', ' File "/home/hass/.homeassistant/deps/pysnmp/smi/builder.py", line 325, in loadModule\n exec (modData, g)\n', ' File "<string>", line 24, in <module>\n', ' File "<string>", line 71, in clone\n', 'TypeError: clone() takes from 1 to 2 positional arguments but 4 were given\n']
Additional info: #8044 shows pysnmp was upgraded to version 4.3.8 in Home Assistant 0.47, but on my install it may only have been upgraded when going from Home Assistant 0.49 to 0.49.1:
pi@Ra:~ $ cat /var/log/syslog | grep "pysnmp==4.3.8"
Jul 27 14:51:07 Ra hass[10958]: INFO (Thread-3) [homeassistant.util.package] Attempting install of pysnmp==4.3.8
Also, version 4.3.9 of pysnmp is out. I'd love to test if that would fix my issue but I don't know how. If someone could give me instructions, I'll give it a run. My Home Assistant install was installed using the AiO installer back in Q2 of 2016.
I attempted to add a few SNMP sensors to my config (did not have any previously) and ran into this same issue. I updated the pysnmp version requirement in homeassistant/components/device_tracker/snmp.py to 4.3.9 and it has fixed the issue.
@bgehrich Thanks for the suggestion! I did the same and after restarting Home Assistant, the SNMP sensors are working again.
And thanks for the PR, you beat me to it 😉
i got a same error , modify homeassistant/components/device_tracker/snmp.py to 4.3.9 not help :( added: fixed by removing deps and restarting