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.

Issues with stopping the server on localhost

See original GitHub issue

Hi, thank you for making this cool project!

I’m having issues with actually stopping the server on localhost. Pressing CTRL+C does not seem to actually stop it, at least not immediately. This confused me when I did something like try to run a different file only to have it appear the exact same, or close all instances/terminals that had been running Dash, go to 127.0.0.1:8050 and still see the page happily running. It doesn’t seem to matter if I’m on Firefox or Chrome. This is using Git Bash on a Windows 7.

While this was going, I looked at my Task Manager and saw some stray python.exe’s running even after I had completely closed the terminal. Force closing them through the Task Manager solved the problem. Sometimes they would dissipate on their own after a minute or so; not sure exactly the difference between when it stopped on its own or kept going.

I’m not sure what’d be going on other than maybe a garbage collection issue, but it made for an interesting “Am I crazy what’s going on???” session.

My code is more or less following the Dash tutorials:

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

x = [1,2,3,4,5,6]
y = [7,4,2,1,2,4]

app.layout = html.Div(children = [
                html.H1('Hello World'),
                html.Div('First go at making a framework.'),
                html.H2('A Toy Data Graph'),
                # a simple graph
                dcc.Graph(
                    id = 'toy-graph',
                    figure = {
                        'data': [
                            {'x': x, 'y': y, 'name': 'numbers!'}
                        ],
                        'layout': {
                            'title': 'Random numbers!'
                        }
                    }
                ),
            ])

if __name__ == '__main__':
    app.run_server(debug=True)

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
felixvelariusboscommented, Nov 6, 2017

Hey @Yuminzhou Sorry, I dropped off the face of the planet a bit. 😃

I don’t know if you are still having this problem, but for any newcomers on the thread, the fix for me was to turn debugging OFF

app.run_server(debug=False)

That solved the issue for me. I got that from reading the Flash issue @chriddyp referred to.

2reactions
henrytirlacommented, Sep 8, 2020

I am using a mac i just used the activity monitor search for python and killed it. Then started my other Dash application and it worked fined. It’s not the best method but it saved me time when i had to focus on my project work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
Localhost refused to connect error can be caused by an incorrectly configured port, insufficient permissions, or an inoperative web server.
Read more >
Localhost Refused to Connect - How to Fix the Error
When developing locally the localhost refused to connect is the worst error you can get. See the causes and what solves the error....
Read more >
Localhost just stopped working - apache - Stack Overflow
Check the apache service is running properly or not if apache service is running still it is not working then change the service...
Read more >
How to kill a localhost:8080 - windows - Super User
... trying to kill is one that gets started upon booting the server, ... a lot of IT professionals start their troubleshooting process...
Read more >
How to Resolve MAMP's “Localhost Refused to Connect” Error ...
You can also resolve the “localhost refused to connect” error by restarting the Apache web server. To stop the server, launch your Mac's ......
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