Issue66

Title traceback due to sql violation when updating mirror to prefix = null
Priority bug Status chatting
Superseder Nosy List fukawi2, poeml
Assigned To poeml Keywords

Created on 2010-09-18.03:44:45 by fukawi2, last changed by fukawi2.

Messages
msg252 (view) Author: fukawi2 Date: 2010-09-18.04:15:53
I'm pretty sure it's because I haven't gotten around to installing mod_asn yet, 
but yes, mb should handle it a bit more gracefully.
msg251 (view) Author: poeml Date: 2010-09-18.04:13:51
Good point. The failure probably happens because the lookup is not possible, 
because the database that comes with mod_asn is not there.

I have to admit that I never was in that situation. "mb update" should handle 
that, though.

(To explain: the mb update command originally was meant to fill in only the AS and 
prefix data. Later, I extended it to also be able to fill in geographical 
coordinates, but didn't think about the dependency.)
msg250 (view) Author: fukawi2 Date: 2010-09-18.03:44:45
Failure to find the prefix for a mirror causes an SQL violation, and therefore a 
python traceback.

hydrogen ~ $ mb update -p --all-mirrors
selfnet.de: updating network prefix ( -> None)
Traceback (most recent call last):
  File "/usr/bin/mb", line 1606, in <module>
    r = mirrordoctor.main()
  File "/usr/lib/python2.6/site-packages/cmdln.py", line 257, in main
    return self.cmd(args)
  File "/usr/lib/python2.6/site-packages/cmdln.py", line 280, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib/python2.6/site-packages/cmdln.py", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib/python2.6/site-packages/cmdln.py", line 1100, in _dispatch_cmd
    return handler(argv[0], opts, *args)
  File "/usr/bin/mb", line 432, in do_update
    mirror.prefix = res.prefix
  File "<string>", line 1, in <lambda>
  File "/usr/lib/python2.6/site-packages/sqlobject/main.py", line 1048, in 
_SO_setValue
    dbValue)])
  File "/usr/lib/python2.6/site-packages/sqlobject/dbconnection.py", line 523, 
in _SO_update
    self.sqlrepr(so.id)))
  File "/usr/lib/python2.6/site-packages/sqlobject/dbconnection.py", line 349, 
in query
    return self._runWithConnection(self._query, s)
  File "/usr/lib/python2.6/site-packages/sqlobject/dbconnection.py", line 262, 
in _runWithConnection
    val = meth(conn, *args)
  File "/usr/lib/python2.6/site-packages/sqlobject/dbconnection.py", line 346, 
in _query
    self._executeRetry(conn, conn.cursor(), s)
  File "/usr/lib/python2.6/site-packages/sqlobject/dbconnection.py", line 341, 
in _executeRetry
    return cursor.execute(query)
psycopg2.IntegrityError: null value in column "prefix" violates not-null 
constraint
History
Date User Action Args
2010-09-18 04:15:53fukawi2setmessages: + msg252
2010-09-18 04:13:51poemlsetstatus: unread -> chatting
assignedto: poeml
messages: + msg251
nosy: + poeml
2010-09-18 03:44:45fukawi2create