SeedDB crash when updating IP device whose serial has changed to a duplicate

Bug #672444 reported by Jon Skarpeteig
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Medium
Morten Brekkevold

Bug Description

Attempting to change device type does not work.

Using version 3.6.0 installed by following debian install guide.

Tags: seeddb
Revision history for this message
Jon Skarpeteig (jon-skarpeteig) wrote :

* Same behaviour in 3.6.3

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Unable to reproduce this on NAV 3.6.3. Please provide a full traceback of the error, if we're to have any chance of finding out what's going on.

Changed in nav:
status: New → Incomplete
Revision history for this message
Jon Skarpeteig (jon-skarpeteig) wrote :

MOD_PYTHON ERROR

ProcessId: 2336
Interpreter: 'nav'

ServerName: 'nav'
DocumentRoot: '/usr/share/nav/htdocs'

URI: '/seeddb/netbox/edit/predefined'
Location: None
Directory: '/usr/share/nav/htdocs/seeddb/'
Filename: '/usr/share/nav/htdocs/seeddb/netbox'
PathInfo: '/edit/predefined'

Phase: 'PythonHandler'
Handler: 'seeddb'

Traceback (most recent call last):

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/usr/share/nav/htdocs/seeddb/seeddb.py", line 165, in handler
    output = editPage(req,pageList[table](),request,unicodeError)

  File "/usr/share/nav/htdocs/seeddb/seeddb.py", line 456, in editPage
    selected)

  File "/usr/share/nav/htdocs/seeddb/seeddb.py", line 2672, in update
    box = device.netbox_set.all()

AttributeError: 'QuerySet' object has no attribute 'netbox_set'

MODULE CACHE DETAILS

Accessed: Tue Nov 9 09:27:41 2010
Generation: 0

_mp_fee3cb79bb902d1ae2e8fe8693adcb2a {
  FileName: '/usr/share/nav/htdocs/seeddb/initBox.py'
  Instance: 1 [IMPORT]
  Generation: 1
  Modified: Thu Nov 4 17:23:53 2010
  Imported: Tue Nov 9 09:27:41 2010
}

_mp_79759e91aa07f55e2ec9feb06dcdae38 {
  FileName: '/usr/share/nav/htdocs/seeddb/options.py'
  Instance: 1 [IMPORT]
  Generation: 2
  Modified: Thu Nov 4 17:23:53 2010
  Imported: Tue Nov 9 09:27:41 2010
}

_mp_ee36530af65736d4598346489c0aee92 {
  FileName: '/usr/share/nav/htdocs/seeddb/seeddb.py'
  Instance: 1 [IMPORT]
  Generation: 4
  Modified: Thu Nov 4 17:23:53 2010
  Imported: Tue Nov 9 09:27:41 2010
  Children: '/usr/share/nav/htdocs/seeddb/initBox.py',
                '/usr/share/nav/htdocs/seeddb/options.py',
                '/usr/share/nav/htdocs/seeddb/seeddbSQL.py'
}

_mp_6075681fed6c7055dc97214a475ff87e {
  FileName: '/usr/share/nav/htdocs/seeddb/seeddbSQL.py'
  Instance: 1 [IMPORT]
  Generation: 3
  Modified: Thu Nov 4 17:23:53 2010
  Imported: Tue Nov 9 09:27:41 2010
}

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

That helped a lot more, thanks :)

This happens when the serial number that was found is already is associated with another IP Device you are monitoring. You're supposed to get a real error message about this, but a bug causes a crash instead.

tags: added: seeddb
Changed in nav:
importance: Undecided → Medium
milestone: none → 3.6.4
status: Incomplete → Confirmed
assignee: nobody → Morten Brekkevold (mbrekkevold)
status: Confirmed → In Progress
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: In Progress → Fix Committed
summary: - Changing device from EDGE to GSW under Seed Database gives MOD_PYTHON
- ERROR
+ SeedDB crash when updating IP device whose serial has changed to a
+ duplicate
Revision history for this message
Jon Skarpeteig (jon-skarpeteig) wrote :

I noticed that the 'serial' field is filled with hostname when I attempt to update entry (after snmp reply). When I added entry, the serial got stored correctly. I am assuming this is related?

Behaviour on update (I dont' change anything, just hit update):
BayStack470-48T-PWR = Appears to be correct serial - but fails with the stacktrace above (but two others of the same type works)
catalyst37xxStack = Puts hostname in serial field - fails with stacktrace above
catWsCbs3032Del = Puts hostname in serial field - fails with stacktrace above
catalyst2950t24 = Puts hostname in serial field - fails with stacktrace above
However, different switches, of the type catalyst2950t24 works (probably configuration differences on switches, but unknown which)

Adding have worked, with two exceptions: one catalyst2950t24, and one catalyst37xxStack got added with hostname instead of serial - but for these, update works (with hostname detected as serial for update aswell)

None of the above have the same hostname or serial.. so I'm not sure that duplicate entries are the problem here?

Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :

Are you saying that your devices' hostnames are being automatically filled in the serial number box when you update? I am unable to reproduce that on any version of NAV.

I do however see that if SeedDB is unable to retrieve a serial during an update, it will claim that it retrieved the box' existing serial number via SNMP (even though this isn't true). If it can't retrieve a serial number the first time you add a device, you are asked to provide it yourself. Some people type in the hostname as the serial in this case, you're sure you didn't do that?

Revision history for this message
Jon Skarpeteig (jon-skarpeteig) wrote :

I am sure. I have never been able to provide serial myself, as this field has been greyed out for all add and update actions I have performed. I also noticed a strange case where I deleted a valid entry I was unable to update, and added it again. On my new add it retrieved the hostname as serial, while it retrieved correct serial on the first time around.

Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.