Unhandled Twisted Error

296 views
Skip to first unread message

Patrick Santora

unread,
Sep 19, 2014, 5:12:43 PM9/19/14
to autob...@googlegroups.com
I know this isn't the Twisted forum, but I've done some research and can't seem to find a good solution. So I'd thought I would try here.

Has anyone ran across these errors before while using Autobahn's websockets through Twisted? I'm using Python 2.7, twisted 13.2.0, and autobahn 0.8.8. The error basically kills any new connections that come through and forces me to have to restart the twisted service. Any help here would be appreciated. Maybe I should use gevent or something else rather than epoll?

2014-09-19 13:41:01-0400 [twisted.web.server.Site] Unhandled Error
Traceback (most recent call last):
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
   return context.call({ILogContext: newCtx}, func, *args, **kw)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
   return self.currentContext().callWithContext(ctx, func, *args, **kw)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
   return func(*args,**kw)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
   why = selectable.doRead()
--- <exception caught here> ---
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/tcp.py", line 1069, in doRead
   transport = self.transport(skt, protocol, addr, self, s, self.reactor)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/tcp.py", line 786, in __init__
   self.startReading()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/abstract.py", line 434, in startReading
   self.reactor.addReader(self)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 271, in addReader
   EPOLLIN, EPOLLOUT)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 255, in _add
   self._poller.modify(fd, flags)
exceptions.IOError: [Errno 2] No such file or directory

2014-09-19 16:53:31-0400 [HTTPChannel,226,192.168.135.156] Unhandled Error
Traceback (most recent call last):
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/log.py", line 88, in callWithLogger
   return callWithContext({"system": lp}, func, *args, **kw)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/log.py", line 73, in callWithContext
   return context.call({ILogContext: newCtx}, func, *args, **kw)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
   return self.currentContext().callWithContext(ctx, func, *args, **kw)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
   return func(*args,**kw)
--- <exception caught here> ---
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
   why = selectable.doRead()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/tcp.py", line 215, in doRead
   return self._dataReceived(data)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/tcp.py", line 221, in _dataReceived
   rval = self.protocol.dataReceived(data)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/twisted/websocket.py", line 88, in dataReceived
   self._dataReceived(data)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1265, in _dataReceived
   self.consumeData()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1281, in consumeData
   while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1440, in processData
   return self.processDataHybi()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1753, in processDataHybi
   fr = self.onFrameEnd()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1853, in onFrameEnd
   self.processControlFrame()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1910, in processControlFrame
   if self.onCloseFrame(code, reasonRaw):
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 853, in onCloseFrame
   self.sendCloseFrame(code = WebSocketProtocol.CLOSE_STATUS_CODE_NORMAL, isReply = True)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 2096, in sendCloseFrame
   self.sendFrame(opcode = 8, payload = payload)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 2025, in sendFrame
   self.sendData(raw, sync, chopsize)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 1406, in sendData
   self.transport.write(data)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/abstract.py", line 355, in write
   self.startWriting()
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/abstract.py", line 442, in startWriting
   self.reactor.addWriter(self)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 288, in addWriter
   EPOLLOUT, EPOLLIN)
 File "/home/ec2-user/local-python/lib/python2.7/site-packages/twisted/internet/epollreactor.py", line 257, in _add
   self._poller.register(fd, flags)
exceptions.IOError: [Errno 17] File exists

Patrick Santora

unread,
Sep 19, 2014, 5:23:13 PM9/19/14
to autob...@googlegroups.com
After doing some additional scanning I found a post that talked about using the select reactor rather than epoll. I'm going to try that. If anyone has any further advice here please feel free to share.

Tobias Oberstein

unread,
Sep 20, 2014, 5:21:13 AM9/20/14
to autob...@googlegroups.com
Am 19.09.2014 23:12, schrieb Patrick Santora:
> I know this isn't the Twisted forum, but I've done some research and
> can't seem to find a good solution. So I'd thought I would try here.

Twisted also has a mailing list;)

Skimming over the error log below, this looks like a low-level
networking issue. E.g. the process running out of memory or file
descriptors.

I guess this is on a Linux machine, in which case you can also try
different reactors (select, poll, epoll)
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to autobahnws+...@googlegroups.com
> <mailto:autobahnws+...@googlegroups.com>.
> To post to this group, send email to autob...@googlegroups.com
> <mailto:autob...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autobahnws/93c222a3-6219-4784-9de5-5f3bbc9fefe4%40googlegroups.com
> <https://groups.google.com/d/msgid/autobahnws/93c222a3-6219-4784-9de5-5f3bbc9fefe4%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Francesco Ballarini

unread,
Mar 18, 2016, 2:36:08 PM3/18/16
to Autobahn
Hi Patrick,

did you solve that error?

'couse today i've see in my logs the same situation


Thank You
Reply all
Reply to author
Forward
0 new messages