IntegrityError when posting chassis events from ipdevpoll
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
Medium
|
Morten Brekkevold |
Bug Description
Under NAV 4.3.0, we have observed on some installations a crash in the ipdevpoll statuscheck job, as ipdevpoll prepares to dispatch a chassis event. This means the job stops, and the event is not (fully) posted.
Traceback looks like this:
2015-08-19 00:04:21,910 [ERROR jobs.jobhandler] [statuscheck example-
epository'(...))
Traceback (most recent call last):
File "/usr/lib/
manager.
File "/usr/lib/
self.
File "/usr/lib/
chassis_
File "/usr/lib/
self.varmap = self.varmap
File "/usr/lib/
self.
File "/usr/lib/
variable.save()
File "/usr/lib/
self.
File "/usr/lib/
result = manager.
File "/usr/lib/
return insert_
File "/usr/lib/
return query.get_
File "/usr/lib/
cursor.
File "/usr/lib/
return self.cursor.
IntegrityError: insert or update on table "eventqvar" violates foreign key constraint "eventqvar_
DETAIL: Key (eventqid)
Changed in nav: | |
status: | Fix Committed → Fix Released |
The problem seems to be that the event data is not stored inside a transaction, but using autocommit. The event record is being culled from the eventq table by eventengine before ipdevpoll has a chance to completely store all the associated eventqvar records.
The event generating code should be surrounded by a transactional decorator.