Servicemon crashes when service checker init fails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
High
|
Morten Brekkevold |
Bug Description
On several of our clients' installations, servicemon will invariably crash just after startup. This must have been introduced witht he bugfixes in NAV 3.5.1. Traceback is as follows:
[2009-03-12 08:31:50] abstractChecker
Traceback (most recent call last):
File "/usr/lib/
start(fork)
File "/usr/lib/
myControlle
File "/usr/lib/
self.
File "/usr/lib/
newcheckers = self.db.
File "/usr/lib/
newChecker = checker(service, status=up)
TypeError: __init__() got an unexpected keyword argument 'status'
Changed in nav: | |
assignee: | nobody → mvold |
Changed in nav: | |
status: | Confirmed → In Progress |
Changed in nav: | |
status: | Fix Committed → Fix Released |
It appears that this is caused by two separate problems.
The DummyChecker was fixed in NAV 3.5.1, so that it now can actually be imported by servicemon. The DummyChecker __init__ method, however, is not up to spec and does not accept keyword arguments, so it raises an exception.
Unfortunately, servicemon does not have any robustness against checker failure, it seems, so it crashes completely when the exception is raised.
So, in conclusion: Servicemon should catch exceptions from checker instantiation (in nav/statemon/ db.py), log a big fat informative error when it happens, and then continue as normal. The DummyChecker should accept the correct set of arguments (adding a **kwargs argument is probably enough).
Updating the report title to be more accurate.