Skip to content

Server message: Session expired. Please refresh this webpage. #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mikoim opened this issue Apr 27, 2018 · 4 comments
Closed

Server message: Session expired. Please refresh this webpage. #190

mikoim opened this issue Apr 27, 2018 · 4 comments

Comments

@mikoim
Copy link

mikoim commented Apr 27, 2018

Describe the issue

Once upgrade to 0.11.3.0, gdbgui always says "Server message: Session expired. Please refresh this webpage.". even if refresh browser, it repeated again and gdbgui does not accept any commands. I tried to recreate the virtual environment and install gdbgui again, but the issue has still happened.

  • Browser
Server message: Session expired. Please refresh this webpage.
  • Console
gdbgui --debug
failed to initialize socketio app with async mode "eventlet". Continuing with async mode "threading".
View gdbgui at http://127.0.0.1:5000
exit gdbgui by pressing CTRL+C
WebSocket transport not available. Install eventlet or gevent and gevent-websocket for improved performance.
 * Serving Flask app "gdbgui.backend" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
failed to initialize socketio app with async mode "eventlet". Continuing with async mode "threading".
View gdbgui at http://127.0.0.1:5000
exit gdbgui by pressing CTRL+C
WebSocket transport not available. Install eventlet or gevent and gevent-websocket for improved performance.
 * Debugger is active!
 * Debugger PIN: 178-458-305
127.0.0.1 - - [28/Apr/2018 00:50:27] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:27] "GET /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7p6rG HTTP/1.1" 200 -
gdbgui.backend - WARNING - Recieved invalid csrf token 99b7f9757c6f56ae283ef86b38327357881aa74c (expected None)
127.0.0.1 - - [28/Apr/2018 00:50:28] "POST /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7p6ts&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:28] "GET /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7p6tu&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:33] "POST /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7p895&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:33] "GET /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7p6vD&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:33] "GET /get_last_modified_unix_sec?path=%2FSaturn%2FBitZeny%2Fbitzeny%2Fsrc%2Fqt%2Fbitzeny-qt&_=1524844227848 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:53] "POST /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7pD5X&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:50:53] "GET /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7p89A&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:51:19] "POST /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7pJRl&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:51:19] "GET /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7pD5a&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:51:45] "POST /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7pPo0&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
127.0.0.1 - - [28/Apr/2018 00:51:45] "GET /socket.io/?csrf_token=99b7f9757c6f56ae283ef86b38327357881aa74c&gdbpid=0&EIO=3&transport=polling&t=MC7pJRp&sid=b6e29f80914f4cfc9ba9154a9700e902 HTTP/1.1" 200 -
Steps to replicate
  1. Run gdbgui --debug
  2. The browser is opened automatically.
  3. Server message: Session expired. Please refresh this webpage. is printed on console_container.
Describe your environment
  • Operating system and version: Linux x.local 4.15.17-300.fc27.x86_64 Dev/cs01/general improvements #1 SMP Thu Apr 12 18:19:17 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • gdbgui version (gdbgui -v): 0.11.3.0
  • gdb version (gdb -v): 8.0.1-36.fc27
  • browser: Google Chrome 66.0.3359.117 (Official Build) (64-bit), Firefox 60.0b15
  • python packages (pip freeze):
certifi==2018.4.16
click==6.7
Flask==1.0
Flask-Compress==1.4.0
Flask-SocketIO==2.9.6
gdbgui==0.11.3.0
gevent==1.2.2
greenlet==0.4.13
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
pygdbmi==0.8.2.0
Pygments==2.2.0
python-engineio==2.1.0
python-socketio==1.9.0
six==1.11.0
Werkzeug==0.14.1
cs01 added a commit that referenced this issue Apr 27, 2018
@cs01
Copy link
Owner

cs01 commented Apr 27, 2018

Thanks for reporting. I was able to reproduce and I believe I have this fixed in gdbgui version 0.11.3.1.

Try running

pip install gdbgui --upgrade

and let me know if it works (or just close this issue).

What happened was Flask, a dependency of gdbgui, was upgraded with breaking changes. pip uses the latest version unless told to do otherwise, so I limited the version gdbgui uses to the last known good version of Flask (0.12.2).

cs01 added a commit that referenced this issue Apr 27, 2018
@cs01 cs01 closed this as completed Apr 28, 2018
@kriscory
Copy link

kriscory commented Apr 8, 2019

I think this actually is caused by SocketIO. It added the ability to manage its own session by making a copy of the one managed by Flask. The copy didn't inherit from dict properly and caused get to fail. SocketIO made a fix for this in miguelgrinberg/Flask-SocketIO@39649c8.

Installing the latest version of flask_socketio and flask seem work.
pip install flask==1.0.2 flask_socketio==3.3.2

However, it doesn't look like you modify the session within the SocketIO context, so you may want to disable SocketIO managed sessions all together by adding manage_session=False to the SocketIO instantiation.

@cs01
Copy link
Owner

cs01 commented Apr 10, 2019

@kriscory thanks for the info! I created a new issue to see if this helps: #271

@kb2ma
Copy link

kb2ma commented May 15, 2020

I also was experiencing this issue with Python 3. I had these Flask versions installed:

Package Version
Flask 1.1.1
Flask-SocketIO 2.9.6

I upgraded Flask-SocketIO via pip3 to the latest, v4.3.0. gdbgui worked after that.

cs01 added a commit that referenced this issue Jul 14, 2020
cs01 added a commit that referenced this issue Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants