Ramon Ribes
Ramon Ribes

Reputation: 1

Why Flask-SocketIO ends with 'Invalid session error'?

I'm testing the Flask-SocketIO package. My config is:

When I connect to the server, this returns the index.html as expected (so the server script is doing it right), but no further responses from server are received, even if I use the interface buttons of the webpage.

The Python error log shows this errors continuously:

2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: d4PXlWixzGEEkGSDAAAA: Sending packet OPEN data {'sid': 'd4PXlWixzGEEkGSDAAAA', 'upgrades': ['websocket'], 'pingTimeout': 60000, 'pingInterval': 60000}
2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: [pid: 9999|app: 0|req: 2/2] 192.168.0.163 () {42 vars in 744 bytes} [Wed Nov 13 11:09:48 2024] GET /socket.io/?EIO=4&transport=polling&t=PCb01mX => generated 97 bytes in 4 msecs (HTTP/1.1 200) 3 headers in 149 bytes (2 switches on core 1)
2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: Invalid session d4PXlWixzGEEkGSDAAAA (further occurrences of this error will be logged with level INFO)
2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: Invalid session d4PXlWixzGEEkGSDAAAA (further occurrences of this error will be logged with level INFO)
2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: [pid: 10000|app: 0|req: 1/3] 192.168.0.163 () {46 vars in 889 bytes} [Wed Nov 13 11:09:48 2024] POST /socket.io/?EIO=4&transport=polling&t=PCb01mj&sid=d4PXlWixzGEEkGSDAAAA => generated 17 bytes in 7 msecs (HTTP/1.1 400) 3 headers in 143 bytes (1 switches on core 0)
2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: Invalid session d4PXlWixzGEEkGSDAAAA
2024-11-13T11:09:48+01:00 DS218J python3.9-uwsgi[9810]: [pid: 10004|app: 0|req: 2/4] 192.168.0.163 () {42 vars in 794 bytes} [Wed Nov 13 11:09:48 2024] GET /socket.io/?EIO=4&transport=polling&t=PCb01mk&sid=d4PXlWixzGEEkGSDAAAA => generated 17 bytes in 1 msecs (HTTP/1.1 400) 3 headers in 143 bytes (1 switches on core 1)

I've read other posts related with the same problem, but none solved the problem. I've also tryed executing the script on the single windows PC (127.0.0.1), and all worked OK, as expected. The problem is that I need the python script being executed on the server... So please, can someone help on this? Thanks in advance.

Upvotes: 0

Views: 46

Answers (0)

Related Questions