jupyter-dash icon indicating copy to clipboard operation
jupyter-dash copied to clipboard

Cannot stop server in JupyterLab using CTRL+C

Open msbuckas opened this issue 4 years ago • 5 comments

I'm running the following code:

Cell [2]

app = JupyterDash(__name__)
app.layout = html.Div('Minimal')

app.run_server(mode="external", debug=False)

Cel[2] Output


 * Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
127.0.0.1 - - [10/Jun/2020 14:17:49] "GET /_alive_a6195403-4d44-472b-8ea6-99427edf92c3 HTTP/1.1" 200 -
Dash app running on http://127.0.0.1:8050/
127.0.0.1 - - [10/Jun/2020 14:18:07] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [10/Jun/2020 14:18:08] "GET /_dash-dependencies HTTP/1.1" 200 -
127.0.0.1 - - [10/Jun/2020 14:18:08] "GET /_dash-layout HTTP/1.1" 200 -

I cannot stop the server using (Press CTRL+C to quit) as indicated in the output log. This message is probably only applicable to execution in the terminal? Is there an alternate way of stopping the server in JupyterLab?

Environment setup:

  • conda install
  • Windows 10
  • JupyterLab 2.1
  • localhost

msbuckas avatar Jun 10 '20 13:06 msbuckas

i think i'm having the same issue:

  • windows 10
  • jupyterlab

when i try to run the cell:

app.run_server(mode="jupyterlab")

i get the error:

OSError: Address 'http://127.0.0.1:8050' already in use. Try passing a different port to run_server.

Is windows 10 supported? I've seen mixed comments online.

cammclean182 avatar Jul 02 '20 23:07 cammclean182

@cammclean182 I was getting the same error as you!

I played around a bit with killing processes manually as a workaround. But this workaround was too much of a nuisance so I decided to put my jupyter-dash adventures on hold!

msbuckas avatar Jul 04 '20 16:07 msbuckas

FWIW, I'm seeing the same on OSX, but if I navigate to the 'http://localhost:8889' the app is running. Repro

app = JupyterDash(__name__)
app.layout = html.Div('Minimal')

app.run_server(mode="jupyterlab", host="127.0.0.1", port=8889)

JupyterLab version - 2.1.5 JupyterDash version - 0.2.1.post1 installed using pip. Conda doesn't find the package on conda-forge.

Happy to provide any other details.

jseabold avatar Jul 08 '20 15:07 jseabold

Eh, doing some debugging I'm getting a 504 gateway timeout. This has to do with my work machine proxy, so it's a local issue.

Instead of raising an OSError and saying the port is in use, it may be more informative to call raise_for_status on the requests response? This would have pointed me in the right direction for this issue more quickly, at least.

Quick workaround is

import os
os.environ['NO_PROXY'] = '127.0.0.1'

jseabold avatar Jul 08 '20 15:07 jseabold

So how to shutdown it manually?

GF-Huang avatar Jul 31 '22 03:07 GF-Huang