skoczen / will

Will is a simple, beautiful-to-code bot for slack, hipchat, and a whole lot more.
https://heywill.io
MIT License
406 stars 171 forks source link

Will throwing exception & exiting chat - missing user information #75

Closed rustyrazorblade closed 9 years ago

rustyrazorblade commented 9 years ago

I've seen this issue since I first started using Will about 3 months ago.

KeyError: u'1344989'
ERROR    Error processing event handler: <bound method WillBot.join_rooms of <will.main.WillBot object at 0x7fba76674c50>>
Traceback (most recent call last):
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1699, in _event_runner
    func(*args)
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/will/listener.py", line 55, in join_rooms
    self.update_will_roster_and_rooms()
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/will/listener.py", line 85, in update_will_roster_and_rooms
    user_data = self.full_hipchat_user_list[hipchat_id]
KeyError: u'1344989'
ERROR    Error handling {jabber:client}iq stanza
Traceback (most recent call last):
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1699, in _event_runner
    func(*args)
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/will/listener.py", line 55, in join_rooms
    self.update_will_roster_and_rooms()
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/will/listener.py", line 85, in update_will_roster_and_rooms
    user_data = self.full_hipchat_user_list[hipchat_id]
KeyError: u'1344989'
ERROR    u'1344989'
Traceback (most recent call last):
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1699, in _event_runner
    func(*args)
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/will/listener.py", line 55, in join_rooms
    self.update_will_roster_and_rooms()
  File "/home/meatbot/.virtualenvs/meatbot/local/lib/python2.7/site-packages/will/listener.py", line 85, in update_will_roster_and_rooms
    user_data = self.full_hipchat_user_list[hipchat_id]
KeyError: u'1344989'
skoczen commented 9 years ago

This looks like will has outdated roster info - did you have any weird shared database states, or oddnesses around users joining or leaving?

rustyrazorblade commented 9 years ago

Nope, not that I know of. Running will==0.6.2 btw.

skoczen commented 9 years ago

Hm. You can clear out the user list, and restart will by doing:

@will SERIOUSLY. Clear will_roster

Then doing a manual restart - that will clear out the roster, and fetch a new one on restart. Shouldn't have any side effects other than downtime between running that command and the restart.

rustyrazorblade commented 9 years ago

Well, the downside is that it errors and signs out of chat. I usually realize it after it's been away for a number of hours, and log into the server & restart it manually. It doesn't actually quit, so I can't put it under a supervisor process.

skoczen commented 9 years ago

Interesting. This may be related to a really rare dropout issue I've seen after 0.5.7, that despite weeks of bisecting, I can't isolate. Does this happen to you in say, 0.6 or 0.5.7?

rustyrazorblade commented 9 years ago

Hmmm... I'm not sure what version I was running at the time. My requirements file was just "will", no version pinned. The date was Tue Jul 29, and the problem existed at the time then as well.

skoczen commented 9 years ago

Wow, July 29th would be 0.5.4, well before I thought this dropout thing showed up. I'm more likely to suspect a weird user list state. Have you tried the clear roster?

rustyrazorblade commented 9 years ago

Once Will gets into that state, it leaves the chat and is unreachable.

mikn commented 9 years ago

I also have this issue, but I have not spent any time debugging it. Just thought I'd let you know. Every other week or so, Will disappears from all chats and I have to restart him.

skoczen commented 9 years ago

@mikn - what version of will are you using?

mikn commented 9 years ago

0.6.2! Sorry, forgot to mention. On 14 Nov 2014 15:53, "Steven Skoczen" notifications@github.com wrote:

@mikn https://github.com/mikn - what version of will are you using?

— Reply to this email directly or view it on GitHub https://github.com/skoczen/will/issues/75#issuecomment-63074764.

skoczen commented 9 years ago

@mikn - could you try downgrading to < 0.5.7 and see if it still happens? Alternatively, if it's easier, there's a feature/test-revert-thread branch with my best guess as to the bug, but otherwise current. I haven't seen it on that branch (but then again, I haven't seen it since going back to trunk three weeks ago either. Darn intermittent bugs.)

skoczen commented 9 years ago

Haven't seen this in a few months - closing this up. Please reopen if folks are still seeing this!

camilian commented 8 years ago

I am seeing this using latest version. Errors out every other day or so.