question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The 'environ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1.

See original GitHub issue

Hi. First let me thank you for this amazing library! It’s been really useful for me. I just wanted to let you know that I’m getting this warning when using jupyter_dash on Python 3.8. Not sure what it means.

/opt/conda/lib/python3.8/site-packages/jupyter_dash/jupyter_app.py:139: UserWarning:

The 'environ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
RobertJN64commented, Nov 6, 2021

I did some digging into the werkzeug code, and noticed that if you run with make_server instead of flask you can call a server shutdown command. This worked much better for me than the recommended solution of killing processes, which is very janky.

I replaced super_run_server with a custom function based on dash’s run server function, but used make_server instead. He is the core part:

if host + ":" + str(port) in activeservers:
    activeservers[host + ":" + str(port)].shutdown()
s = make_server(host, port, dashapp.server, threaded=True)
t = threading.Thread(target=s.serve_forever)
t.start()
activeservers[host + ":" + str(port)] = s

The full code is in my fork: https://github.com/RobertJN64/jupyter-dash/blob/master/jupyter_dash/server_tools.py

If this is an acceptable fix, I can make a pull request.

0reactions
helmutcartercommented, Jun 29, 2022

Having the same issue:

    del environ['werkzeug.server.shutdown']
KeyError: 'werkzeug.server.shutdown'
Read more comments on GitHub >

github_iconTop Results From Across the Web

python - wait for value then stop server, after 'werkzeug.server ...
The 'environ ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1. Many Stack Overflow answers suggest ...
Read more >
Changes — Werkzeug Documentation (2.2.x)
Remove previously deprecated code. #2276. Remove the non-standard shutdown function from the WSGI environ when running the development server.
Read more >
Large simulation stopped unexpectedly - MFiX - NETL Flow Science ...
... The 'environ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1. shutdown() # will finish current request, ...
Read more >
Werkzeug Changelog — Werkzeug 0.9.4 文档
The builtin server now adds a function named 'werkzeug.server.shutdown' into the WSGI env to initiate a shutdown. This currently only works in Python...
Read more >
R3-M8/IBM/Seismic DDMS oVDS Test Results ... - GitLab
... UserWarning: The 'environ['werkzeug.server.shutdown']' function is deprecated and will be removed in Werkzeug 2.1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found