Replies: 13 comments 4 replies
-
What client are you using? This error would appear when a connection request is received for a namespace that is already connected, at least that's the only reason I can think of. If you can provide a small client and server that I can use to reproduce the error I can investigate more. |
Beta Was this translation helpful? Give feedback.
-
The client is VueJS frontend. socket.io-client": "4.0.0" We are running in Openshift which uses HA proxy to manage load balancing. With multiple frontend containers with NGINX and python containers using redis to sync the python containers together. Our repo is: https://github.com/bcgov/queue-management I will see if I can provide a small client/server - not sure how to do this. |
Beta Was this translation helpful? Give feedback.
-
You may want to enable detailed logs for Socket.IO, maybe that will give us more clues. See the troubleshooting section of the docs if you don't know how to do this. |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg thank.. I have attached a log that has some more detailed logs. I still don't understand it but I believe that this error only happens when we have more than one instance of the python that sync use Redis (or RabbitMQ) to sync with each other. Yes, I tried both. In the logs, please search: bidict.ValueDuplicationError: koOnrpN0-Cf29cF9AAAC Any help is appreciated, thank you.. |
Beta Was this translation helpful? Give feedback.
-
Do you have sticky sessions on your load balancer? That is required if you use long-polling. |
Beta Was this translation helpful? Give feedback.
-
Yes, Openshift builds their routes by default with sticky sessions via cookies. |
Beta Was this translation helpful? Give feedback.
-
Okay, so this is what is strange:
The |
Beta Was this translation helpful? Give feedback.
-
I am not sure but I will get a couple of dev's to see if they can find the code could be doing that. Thank you. |
Beta Was this translation helpful? Give feedback.
-
My problem is that is not consistent. It only happens sometimes so it's hard to trace back as I can't replicate this in localhost. Maybe network issue?? |
Beta Was this translation helpful? Give feedback.
-
In any case, the server should not crash because of this, so I'll add code to handle this as a bad request. The client will receive an |
Beta Was this translation helpful? Give feedback.
-
Thank you. I will try to trace it down. On another topic, you mentioned I was using long-polling. I thought I was setup for web-sockets and not long-polling. Where do I set that? Do I need to move to gevent for that? Thanks |
Beta Was this translation helpful? Give feedback.
-
That was a generic comment. Looking at your logs it does look like your clients are connecting directly over WebSocket. My comment comes from the fact that by default Socket.IO clients initiate the connection over long-polling, and then upgrade to WebSocket. |
Beta Was this translation helpful? Give feedback.
-
@miguelgrinberg Out of curiousity, when do you think it will make it into pypi as a new version release? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am not sure why this is occurring and there are a large number of these exceptions and I was hoping you can help. I am waiting to upgrade to the latest version of Flask-SocketIO to see if it resolves it but we need to either wait for a fix you have to be implemented or change our room to text instead of int.
Using Flask-SocketIO, Redis, Gunicorn, Eventlet
Logs
I can try to get more detailed logs if needed..
[2021-06-10 01:02:48,926] ERROR (engineio.server) <server.py>._trigger_event: message handler error
Traceback (most recent call last):
File "/opt/app-root/lib64/python3.8/site-packages/engineio/server.py", line 596, in _trigger_event
return self.handlersevent
File "/opt/app-root/lib64/python3.8/site-packages/socketio/server.py", line 740, in _handle_eio_message
self._handle_connect(eio_sid, pkt.namespace, pkt.data)
File "/opt/app-root/lib64/python3.8/site-packages/socketio/server.py", line 625, in _handle_connect
sid = self.manager.connect(eio_sid, namespace)
File "/opt/app-root/lib64/python3.8/site-packages/socketio/base_manager.py", line 47, in connect
self.enter_room(sid, namespace, None, eio_sid=eio_sid)
File "/opt/app-root/lib64/python3.8/site-packages/socketio/base_manager.py", line 112, in enter_room
self.rooms[namespace][room][sid] = eio_sid
File "/opt/app-root/lib64/python3.8/site-packages/bidict/_mut.py", line 78, in setitem
self._put(key, val, self.on_dup)
File "/opt/app-root/lib64/python3.8/site-packages/bidict/_base.py", line 209, in _put
dedup_result = self._dedup_item(key, val, on_dup)
File "/opt/app-root/lib64/python3.8/site-packages/bidict/_base.py", line 258, in _dedup_item
raise ValueDuplicationError(val)
bidict.ValueDuplicationError: WwsK4Dk147yY9y-TAATu
Any help would be appreciated..
Beta Was this translation helpful? Give feedback.
All reactions