1

Hi stack overflow folks!

I'm currently getting this error every once and awhile in my Flask/Socketio app and I haven't a clue where to begin debugging or what it means:

Traceback (most recent call last):
  File "/lib/python2.7/site-packages/gevent/greenlet.py", line 536, in run
  File "/lib/python2.7/site-packages/engineio/socket.py", line 167, in writer
  File "/lib/python2.7/site-packages/engineio/socket.py", line 37, in poll
  File "/lib/python2.7/site-packages/gevent/queue.py", line 470, in task_done
ValueError: task_done() called too many times

There seems to be no rhyme or reason to when it happens either.

Charlie
  • 1,646
  • 5
  • 22
  • 40
  • 1
    It will be better if you show us your code. – orvi May 06 '17 at 04:17
  • That's the thing, I don't know where in my code this is happening since the traceback doesn't reference my code. It references modules I'm using. – Charlie May 06 '17 at 06:25
  • can you share your `main.py` ? it's not easy to understand till we get the enough information. or you may share with us which module you used and how do you use that – orvi May 06 '17 at 06:45
  • 1
    This is a pretty odd error to get, it may be caused by a concurrency bug in the gevent `JoinableQueue` class. If you can, I suggest you switch to eventlet and see if you get it there too. If eventlet works reliably, then a bug in gevent's implementation of the queue is a good theory. If you also get it with eventlet, then I guess I'll have to look harder at my code, as that would point to something on my side that is wrong. – Miguel Grinberg May 06 '17 at 15:32
  • I'll try converting over to eventlet someday. Awesome to have a response directly from you though! – Charlie May 06 '17 at 18:21
  • I am currently with the same error with using gevent on flask/socketio. When using eventlet (with or without monkey_patch()) communication over sockets do not work, only http requests. Did you found the solution? – Ricardo Goncalves Mar 08 '19 at 09:24

0 Answers0