IRC bot with sockets connection timeout causes broken pipe

This is the place for queries that don't fit in any of the other categories.

IRC bot with sockets connection timeout causes broken pipe

Postby metulburr » Thu Mar 28, 2013 1:34 am

The bot will run for days and days. But sometimes i will forget about the bot and have it running on my server in an IRC channel, go to use it, and this traceback is present.

So it looks like it timeout and attempted to rejoin, and was not able to, but not sure why? (it rejoins other times on numerous occasions, just not on timeouts) Then it looks like it tried to send the error string to the channel giving it a broken pipe error, which that makes sense. So i guess it all goes back to why it was not able to rejoin the channel. I have a few different channels it is in, (on separate instances) and they all do the same thing eventually over time.



Code: Select all
Traceback (most recent call last):
  File "metulbot.py", line 322, in wait_event
    self.rejoin()
  File "metulbot.py", line 309, in rejoin
    self.sock.send(str.encode('JOIN '+self.channel+'\n'))
socket.error: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "metulbot.py", line 142, in __init__
    self.wait_event()
  File "metulbot.py", line 332, in wait_event
    self.say('{} {}'.format(sys.exc_info()[0],sys.exc_info()[1]))
  File "metulbot.py", line 185, in say
    self.sock.send('PRIVMSG {0} :{1}\r\n'.format(self.channel, string).encode())
socket.error: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "metulbot.py", line 1256, in <module>
    connect = cmd_arg()
  File "metulbot.py", line 38, in cmd_arg
    connect = IrcBot()
  File "metulbot.py", line 145, in __init__
    self.say('{} {}'.format(sys.exc_info()[0],sys.exc_info()[1]))
  File "metulbot.py", line 185, in say
    self.sock.send('PRIVMSG {0} :{1}\r\n'.format(self.channel, string).encode())
socket.error: [Errno 32] Broken pipe



in the history of the IRC chat..there waas a net split, which it rejoined 6 minutes later. Then it looks like it was last preset via:
metulbot has quit (Ping timeout: 272 seconds)


So how can i get around a fix for this?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1300
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: IRC bot with sockets connection timeout causes broken pi

Postby setrofim » Thu Mar 28, 2013 12:44 pm

metulburr wrote:So how can i get around a fix for this?

Just re-establish the connection (create a new socket, re-connect and re-join).
setrofim
 
Posts: 288
Joined: Mon Mar 04, 2013 7:52 pm

Re: IRC bot with sockets connection timeout causes broken pi

Postby metulburr » Thu Mar 28, 2013 4:18 pm

Just re-establish the connection (create a new socket, re-connect and re-join

omg. Now i feel stupid.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1300
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 2 guests