Skip to content

Fix: Automatically find available port when default port is in use #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TJ456
Copy link

@TJ456 TJ456 commented Apr 19, 2025

This commit adds functionality to automatically find an available port when the default port (7878) is already in use. This addresses issue #226 where users were experiencing errors when trying to run OpenUI in environments with reverse proxies or when multiple instances were running.

Changes:

  • Added a find_available_port function that tries to find an available port starting from the configured port
  • Modified the server startup code to use this function when the default port is unavailable
  • Added error handling to provide clear error messages when no ports are available
  • Updated the documentation to mention the automatic port selection feature and how to specify a custom port

Fixes #226

This commit adds functionality to automatically find an available port when the default port (7878) is already in use. This addresses issue wandb#226 where users were experiencing errors when trying to run OpenUI in environments with reverse proxies or when multiple instances were running.

Changes:
- Added a find_available_port function that tries to find an available port starting from the configured port
- Modified the server startup code to use this function when the default port is unavailable
- Added error handling to provide clear error messages when no ports are available
- Updated the documentation to mention the automatic port selection feature and how to specify a custom port

Fixes wandb#226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error while attempting to bind on address ('0.0.0.0', 7878): address already in use
2 participants