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.

Search for available free ports if default port 8000 is not available

See original GitHub issue

Thanks for the awesome tool! We are starting to use jupyterlab-nvdashboard on a multi-user HPC system. I am trying to figure out what will happen if two user jobs land on the same compute node and both users run the server in their job scripts as follows.

python -m jupyterlab_nvdashboard.server &

Will the first user get the default port 8000 and then the second user get an error or warning? Or will the jupyterlab_nvdashboard.server look for available ports?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
owenlamontcommented, Jul 4, 2020

Can this problem can be reproduced by running nvdashboard from two Python environments on the same system at the same time?

0reactions
davidrpughcommented, Oct 24, 2021

The following will launch the Bash magic that extracts the port number using netstat. Seems brittle though and am not sure how to go about doing this from within Python.

python -m jupyterlab_nvdashboard.server 0 &
NVDASHBOARD_PID=$!
NVDASHBOARD_PORT=$( netstat -pl | grep $NVDASHBOARD_PID | tail -n 1 | awk -F "[ :]+" '{print $6}' )
echo "Your NVDashboard Server is running at $( hostname -f ):$NVDASHBOARD_PORT"
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make sure that a certain Port is not occupied by any ...
Use the netstat -anp | find "port number" command to find whether a port is occupied by an another process or not. If...
Read more >
Troubleshooting "Port 80 in use issue" - Anash's Knowledge ...
Open a command prompt and type netstat –anb. This will give you the list of all processes listening on various ports on your...
Read more >
How to Open Ports in Windows Firewall And Check Open Ports
Answer: Open the Run command and type cmd to open the command prompt. Type: “netstat –na” and hit enter. Find port 445 under...
Read more >
Change listen port for Confluence - Atlassian Documentation
You need to modify both the server port (default is 8000) and the connector port (default is 8090) to ports that are free...
Read more >
Enable ports 80 (HTTP) and 443 (HTTPS) - PaperCut
Port 9191 is also used for server-to-server and client-to-server communication so it's important that this port continue to be made available. Also make...
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