EditDB crashes when updating existing box
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Network Administration Visualized |
Fix Released
|
Medium
|
Morten Brekkevold |
Bug Description
When PostgreSQL is configured not to add missing "FROM" clauses, Edit
Database crashes when attempting to edit an existing netbox. Traceback is
as following:
---
Mod_python error: "PythonHandler editdb"
Traceback (most recent call last):
File "/usr/lib/
in HandlerDispatch
result = object(req)
File "/usr/local/
handler
output = editPage(
File "/usr/local/
editPage
selected)
File "/usr/local/
update
if oldBox.ip != ip and (not error):
File "/usr/lib/
__getattr__
self.load()
File "/usr/lib/
self._loadDB()
File "/usr/lib/
_loadDB
curs.
ProgrammingError: ERROR: missing FROM-clause entry for table "device"
SELECT
snmp_version, netboxid, subcat, roomid, catid, sysname, snmp_agent, ip,
up, catid, prefixid, rw, orgid, typeid, deviceid, orgid, device.serial, ro,
roomid
FROM
netbox
WHERE
(deviceid=
(netboxid=
[http://
Originator: YES
It appears that the file editTables.py extends the forgetSQL forgetters
defined in nav.db.manage, and attempts to create something akin to database
views (it looks like a "clever" hack, though).
The problem in this case is that the class editdbNetbox defines fields
that come from the device table, but forgetSQL does not support adding more
tables to an SQL FROM-clause when this hack is employed.
The error is most likely present for even more of the types that are
editable by the Edit Database tool.