{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/170","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/170/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/170/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/170","id":116853545,"number":170,"title":"Server error on disconnect and reconnect.","user":{"login":"dsoles79","id":984410,"avatar_url":"https://avatars.githubusercontent.com/u/984410?v=3","gravatar_id":"","url":"https://api.github.com/users/dsoles79","html_url":"https://github.com/dsoles79","followers_url":"https://api.github.com/users/dsoles79/followers","following_url":"https://api.github.com/users/dsoles79/following{/other_user}","gists_url":"https://api.github.com/users/dsoles79/gists{/gist_id}","starred_url":"https://api.github.com/users/dsoles79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsoles79/subscriptions","organizations_url":"https://api.github.com/users/dsoles79/orgs","repos_url":"https://api.github.com/users/dsoles79/repos","events_url":"https://api.github.com/users/dsoles79/events{/privacy}","received_events_url":"https://api.github.com/users/dsoles79/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"miguelgrinberg","id":2715854,"avatar_url":"https://avatars.githubusercontent.com/u/2715854?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelgrinberg","html_url":"https://github.com/miguelgrinberg","followers_url":"https://api.github.com/users/miguelgrinberg/followers","following_url":"https://api.github.com/users/miguelgrinberg/following{/other_user}","gists_url":"https://api.github.com/users/miguelgrinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgrinberg/subscriptions","organizations_url":"https://api.github.com/users/miguelgrinberg/orgs","repos_url":"https://api.github.com/users/miguelgrinberg/repos","events_url":"https://api.github.com/users/miguelgrinberg/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgrinberg/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2015-11-13T21:16:18Z","updated_at":"2015-12-04T18:04:38Z","closed_at":null,"body":"Hi Miguel,\r\nI was wondering if have you seen these errors before?\r\nThey appear after a disconnection and reconnection. I am using the recently updated Flask-SocketIO library with eventlet.\r\n\r\nThanks in advance if you can point me in the right direction.\r\n\r\n**The first error, wrote on the client console the following message:**\r\n\"Websocket connection to 'ws:127.0.0.1:5000/socket.io/....... ' failed: Invalid frame header\" socket.io-1.3.7.js:3\r\n========================\r\nFIRST ERROR, SERVER SIDE\r\n========================\r\n127.0.0.1 - - [11/Nov/2015 22:59:51] \"GET /socket.io/?EIO=3&transport=polling&t=1447298991499-4&sid=1978602d3eb1484e8f4e5d389323b424 HTTP/1.1\" 200 216 0.000241\r\nTraceback (most recent call last):\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/eventlet/wsgi.py\", line 454, in handle_one_response\r\n    result = self.application(self.environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask/app.py\", line 1836, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask_socketio/__init__.py\", line 24, in __call__\r\n    start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/middleware.py\", line 47, in __call__\r\n    return self.engineio_app.handle_request(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 301, in handle_request\r\n    return self.eio.handle_request(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/server.py\", line 226, in handle_request\r\n    environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 75, in handle_get_request\r\n    start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 110, in _upgrade_websocket\r\n    return ws(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/eventlet/websocket.py\", line 127, in __call__\r\n    self.handler(ws)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 171, in _websocket_handler\r\n    self.receive(pkt)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 45, in receive\r\n    self.server._trigger_event('message', self.sid, pkt.data)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/server.py\", line 307, in _trigger_event\r\n    return self.handlers[event](*args)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 418, in _handle_eio_message\r\n    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 359, in _handle_event\r\n    r = self._trigger_event(data[0], namespace, sid, *data[1:])\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 386, in _trigger_event\r\n    return self.handlers[namespace][event](*args)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask_socketio/__init__.py\", line 155, in _handler\r\n    self.server.environ[sid]['saved_session'] = {}\r\nKeyError: '1978602d3eb1484e8f4e5d389323b424'\r\n\r\n\r\n**The second error, wrote on the client console the following message:**\r\n\"Websocket connection to 'ws://127.0.0.1:5000/socket.io/....' failed: Compressed bit must be 0 if no negociated deflated-frame extension.\"\r\n===========================\r\nSECOND ERROR, SERVER SIDE\r\n===========================\r\n127.0.0.1 - - [11/Nov/2015 23:49:55] \"GET /socket.io/?EIO=3&transport=polling&t=1447301995065-3&sid=062c30629d43439f91abef8d370472d6 HTTP/1.1\" 200 216 0.000247\r\nTraceback (most recent call last):\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/eventlet/wsgi.py\", line 454, in handle_one_response\r\n    result = self.application(self.environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask/app.py\", line 1836, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask_socketio/__init__.py\", line 24, in __call__\r\n    start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/middleware.py\", line 47, in __call__\r\n    return self.engineio_app.handle_request(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 301, in handle_request\r\n    return self.eio.handle_request(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/server.py\", line 226, in handle_request\r\n    environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 75, in handle_get_request\r\n    start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 110, in _upgrade_websocket\r\n    return ws(environ, start_response)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/eventlet/websocket.py\", line 127, in __call__\r\n    self.handler(ws)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 171, in _websocket_handler\r\n    self.receive(pkt)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/socket.py\", line 45, in receive\r\n    self.server._trigger_event('message', self.sid, pkt.data)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/engineio/server.py\", line 307, in _trigger_event\r\n    return self.handlers[event](*args)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 418, in _handle_eio_message\r\n    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 359, in _handle_event\r\n    r = self._trigger_event(data[0], namespace, sid, *data[1:])\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 386, in _trigger_event\r\n    return self.handlers[namespace][event](*args)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask_socketio/__init__.py\", line 146, in _handler\r\n    ret = handler(*args)\r\n  File \"/Users/dsoles/PycharmProjects/ajedrezados/ajedrezados.py\", line 41, in wrapped\r\n    return f(*args, **kwargs)\r\n  File \"/Users/dsoles/PycharmProjects/ajedrezados/ajedrezados.py\", line 173, in join\r\n    emit('challengeAccepted', game.to_json(), room=game.black_id)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask_socketio/__init__.py\", line 429, in emit\r\n    include_self=include_self, callback=callback)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/flask_socketio/__init__.py\", line 240, in emit\r\n    callback=kwargs.get('callback'))\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/server.py\", line 179, in emit\r\n    self.manager.emit(event, data, namespace, room, skip_sid, callback)\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/base_manager.py\", line 94, in emit\r\n    for sid in self.get_participants(namespace, room):\r\n  File \"/Users/dsoles/VirtualEnv/Ajedrezados/lib/python2.7/site-packages/socketio/base_manager.py\", line 27, in get_participants\r\n    for sid, active in six.iteritems(self.rooms[namespace][room]):\r\nRuntimeError: dictionary changed size during iteration\r\n"},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/162036961","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/170#issuecomment-162036961","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/170","id":162036961,"user":{"login":"jackmullen2","id":11414035,"avatar_url":"https://avatars.githubusercontent.com/u/11414035?v=3","gravatar_id":"","url":"https://api.github.com/users/jackmullen2","html_url":"https://github.com/jackmullen2","followers_url":"https://api.github.com/users/jackmullen2/followers","following_url":"https://api.github.com/users/jackmullen2/following{/other_user}","gists_url":"https://api.github.com/users/jackmullen2/gists{/gist_id}","starred_url":"https://api.github.com/users/jackmullen2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackmullen2/subscriptions","organizations_url":"https://api.github.com/users/jackmullen2/orgs","repos_url":"https://api.github.com/users/jackmullen2/repos","events_url":"https://api.github.com/users/jackmullen2/events{/privacy}","received_events_url":"https://api.github.com/users/jackmullen2/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T18:04:38Z","updated_at":"2015-12-04T18:04:38Z","body":"I have noticed that with small download files it does not fail. I live on the end of a WiFi delivered internet and it has large latency issues at various times of day .. Additionally it is shared bandwidth and often very slow .. "}}