Problem handling nickname changes in NickServ

Bug #316540 reported by Jeremy Thurgood
4
Affects Status Importance Assigned to Milestone
Kali
Fix Released
High
Jeremy Thurgood

Bug Description

It looks like we assume we'll get a valid User object back from getUser(), but sometimes we don't:

2009-01-12 23:32:38+0200 [InspircdServices,client] Unhandled Error
 Traceback (most recent call last):
   File "/usr/lib/python2.4/site-packages/Axiom-0.5.30-py2.4.egg/axiom/store.py", line 1640, in transact
     result = f(*a, **k)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/protocol.py", line 159, in handle
     method(prefix, *params)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/protocol.py", line 248, in irc_NICK
     self.services.event('nickchange', oldnick, newnick)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/controller.py", line 336, in event
     self.sendEvent(p, event, *params)
 --- <exception caught here> ---
   File "/home/jerith/python/kali/branches/nickserv-register/kali/controller.py", line 347, in sendEvent
     method(*params)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/nickserv.py", line 191, in event_nickchange
     self.logout(old)
   File "/home/jerith/python/kali/branches/nickserv-register/kali/nickserv.py", line 159, in logout
     self.ctrl.getUser(nick).registered = False
 exceptions.AttributeError: 'NoneType' object has no attribute 'registered'

Related branches

Jeremy Thurgood (jerith)
Changed in kali:
importance: Undecided → High
Jeremy Thurgood (jerith)
description: updated
Revision history for this message
Tristan Seligmann (mithrandi) wrote :

There definitely seems to be a problem here, but I think your diagnosis is incorrect. The code in the traceback is invoking ServicesController.getUser(nick), which should return the User object that is associated with any user on the network. I believe the problem is that the code in question is trying to look up the User record by the old nickname, but this fails since the User object has already had the nick change applied; I think the solution is to look it up by the new nickname instead, but I only really glanced at the code, so don't take my word for it.

Revision history for this message
Jeremy Thurgood (jerith) wrote :

I'll take a better look when I have a few moments. If anyone else gets to it first, feel free to reassign. (Ping me first if it's In Progress, though.)

Changed in kali:
assignee: nobody → jerith
status: New → Confirmed
Jeremy Thurgood (jerith)
Changed in kali:
status: Confirmed → In Progress
Jeremy Thurgood (jerith)
Changed in kali:
status: In Progress → Fix Committed
Jeremy Thurgood (jerith)
Changed in kali:
status: Fix Committed → Fix Released
Changed in kali:
milestone: none → 1.0.0
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.