• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/site/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/site/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/site/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

flask-socketio 400 (BAD REQUEST) & Invalid session

i use example app(https://github.com/miguelgrinberg/Flask-SocketIO/tree/master/example) statrt on local windows ok, but on server centos failed error 400, i use gunicorn + nginx + eventlet.

logs:

2019-12-19 16:20:41,694 - INFO: 30bd9dce92f245698ae73dfec9fc0197: Sending packet MESSAGE data 0 - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:95] 2019-12-19 16:20:41,730 - INFO: 30bd9dce92f245698ae73dfec9fc0197: Received packet MESSAGE data 0/test, - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:52] 2019-12-19 16:20:41,731 - INFO: 30bd9dce92f245698ae73dfec9fc0197: Sending packet MESSAGE data 2/test,["my_response",{"data":"Connected","count":0}] - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:95] 2019-12-19 16:20:41,731 - INFO: 30bd9dce92f245698ae73dfec9fc0197: Sending packet MESSAGE data 0/test - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:95] 2019-12-19 16:20:41,732 - INFO: 30bd9dce92f245698ae73dfec9fc0197: Received request to upgrade to websocket - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:105] 2019-12-19 16:21:12,524 - WARNING: Invalid session 30bd9dce92f245698ae73dfec9fc0197 - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/server.py:370] 2019-12-19 16:21:13,708 - INFO: 64aaa335d03e48adbca4d6db461ba372: Sending packet OPEN data {'sid': '64aaa335d03e48adbca4d6db461ba372', 'upgrades': ['websocket'], 'pingTimeout': 60000, 'pingInterval': 25000} - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:95] 2019-12-19 16:21:13,709 - INFO: 64aaa335d03e48adbca4d6db461ba372: Sending packet MESSAGE data 0 - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:95] 2019-12-19 16:21:13,744 - INFO: 64aaa335d03e48adbca4d6db461ba372: Received request to upgrade to websocket - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:105] 2019-12-19 16:21:44,711 - WARNING: Invalid session 64aaa335d03e48adbca4d6db461ba372 - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/server.py:390] 2019-12-19 16:21:44,712 - WARNING: Invalid session 64aaa335d03e48adbca4d6db461ba372 - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/server.py:370] 2019-12-19 16:21:46,801 - INFO: da4cbf9a20ba4bfc9cd731644bd4bf6f: Sending packet OPEN data {'sid': 'da4cbf9a20ba4bfc9cd731644bd4bf6f', 'upgrades': ['websocket'], 'pingTimeout': 60000, 'pingInterval': 25000} - [in /home/venv/py37sio/lib/python3.7/site-packages/engineio/socket.py:95] 

Then i dont use nginx+gunicorn, run python3 app.py is ok.

But just use gunicorn gunicorn -w 1 -b 127.0.0.1:5000 app:app, also details as above logs...

So I guess the problem is gunicorn, but I don't know how to solve it ~.~

Download script demo [LINK]
Download script demo [LINK 2] Download script demo [LINK 2]