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.

OSError: Address "" already in use.

See original GitHub issue

Hi all!

I’m running into an error when trying to run app.run_server(mode='external')

Even if I kill all ports, and even if I change the port to a random number (for instance: app.run_server(mode='external', port=2000)), the error still persists. I don’t know how to resolve this. Help would be appreciated! Thanks!

Full error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-5-0a3a9f2580ba> in <module>
----> 1 app.run_server(mode='external', port=2000)

/opt/anaconda3/lib/python3.7/site-packages/jupyter_dash/jupyter_app.py in run_server(self, mode, width, height, inline_exceptions, **kwargs)
    317                 )
    318 
--> 319         wait_for_app()
    320 
    321         if JupyterDash._in_colab:

/opt/anaconda3/lib/python3.7/site-packages/retrying.py in wrapped_f(*args, **kw)
     47             @six.wraps(f)
     48             def wrapped_f(*args, **kw):
---> 49                 return Retrying(*dargs, **dkw).call(f, *args, **kw)
     50 
     51             return wrapped_f

/opt/anaconda3/lib/python3.7/site-packages/retrying.py in call(self, fn, *args, **kwargs)
    210                 if not self._wrap_exception and attempt.has_exception:
    211                     # get() on an attempt with an exception should cause it to be raised, but raise just in case
--> 212                     raise attempt.get()
    213                 else:
    214                     raise RetryError(attempt)

/opt/anaconda3/lib/python3.7/site-packages/retrying.py in get(self, wrap_exception)
    245                 raise RetryError(self)
    246             else:
--> 247                 six.reraise(self.value[0], self.value[1], self.value[2])
    248         else:
    249             return self.value

/opt/anaconda3/lib/python3.7/site-packages/six.py in reraise(tp, value, tb)
    701             if value.__traceback__ is not tb:
    702                 raise value.with_traceback(tb)
--> 703             raise value
    704         finally:
    705             value = None

/opt/anaconda3/lib/python3.7/site-packages/retrying.py in call(self, fn, *args, **kwargs)
    198         while True:
    199             try:
--> 200                 attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
    201             except:
    202                 tb = sys.exc_info()

/opt/anaconda3/lib/python3.7/site-packages/jupyter_dash/jupyter_app.py in wait_for_app()
    313                     "Address '{url}' already in use.\n"
    314                     "    Try passing a different port to run_server.".format(
--> 315                         url=url
    316                     )
    317                 )

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

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:27 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
nijatullahmansoorcommented, Apr 24, 2021

app.run_server(mode=“inline”, host=“localhost”,port=8051)

so just pass different parameter port=? port number which is valid and not used I tried this it work for me OSError: Address ‘http://127.0.0.1:8050’ already in use. Try passing a different port to run_server.

5reactions
brentkendrickcommented, Nov 17, 2021

The port busy error can also arise when you have two or more layout components that have the same id assigned. Usually the traceback will indicate a “DuplicateIdError” as well, but if you are importing layouts (e.g. from other python files) the only error that you might see is the “Address … already in use” error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

socket.error: [Errno 48] Address already in use - Stack Overflow
This error is returned because an attempt is made to rerun the project while it is still running. Stop and restart the project....
Read more >
The python flask problem (socket.error: [Errno 48] Address ...
The python flask problem (socket.error: [Errno 48] Address already in use). You already have a process bound to the default port (8000).
Read more >
OSError: [Errno 48] Address already in use - Google Groups
> The error you are experiencing means that the Port you are trying to bind is already taken by another running process. Why...
Read more >
OSError: [Errno 98] Address already in use - Treehouse
I was testing an app on localhost'/0.0.0.0' port:8000 and forgot to ctrl-C out of the app.run() before I closed the workspace and browser ......
Read more >
Fix: Python Socket Error 48: Address already in use
You get the python socket error 48: Address already in use when a process attempts to bind itself to a busy port. Processes...
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