Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Add ability to change front end port tcp:3000 to something else

Open kmadsen opened this issue 2 years ago • 3 comments

I haven't customized a windows machine much but run into an error when trying to start up the assistant locally. Meaning, Open-Assistant is trying to use a port is in use by a system process.

OS Name	Microsoft Windows 11 Pro
Version	10.0.22621 Build 22621
PS C:\Users\kylem\Development\Open-Assistant> docker compose --profile ci up --build --attach-dependencies
...
Attaching to open-assistant-backend-1, open-assistant-backend-worker-1, open-assistant-backend-worker-beat-1, open-assistant-db-1, open-assistant-maildev-1, open-assistant-redis-1, open-assistant-web-1, open-assistant-webdb-1
Error response from daemon: driver failed programming external connectivity on endpoint open-assistant-web-1 (ccce9108f9ee2bfe52bc2f6a77028b76e2a08935906fbd345164d1f727215a17): listen tcp4 0.0.0.0:3000: bind: address already in use
> netstat -ano
TCP    0.0.0.0:3000           0.0.0.0:0              LISTENING       4788

the 4788 process listening on port 3000 is https://en.wikipedia.org/wiki/Svchost.exe.

My quick work around

I searched the repository and changed any instance of 3000 (that was specific to networks) to 3239. The 3239 number was chosen by random human fingers.

open-assistant-web-1                  | Listening on port 3239 url: http://localhost:3239

It works 👍 . I'm not suggesting this as the solution, but this repository could use an environment variable or some other mechanism to change the number when there is a conflict.

kmadsen avatar Apr 27 '23 13:04 kmadsen

Also sorry if there is another clear work around, feel free to close if there is. The FAQ has some suggestions for other ports but I didn't see another way to change the localhost:3000. Maybe suggestion is to do some kind of port forwarding on the container, but seems like it should be configurable

Docker Port Problems

Oftentimes people already have some Postgres instance running on the dev machine. To avoid port problems, change the ports in the docker-compose.yml to ones excluding 5433, like:

Change db.ports to - 5431:5431.
Add POSTGRES_PORT: 5431 to db.environment
Change webdb.ports to - 5432:5431
Add POSTGRES_PORT: 5431 to db.environment
Add - POSTGRES_PORT=5432 to backend.environment
Change web.environment.DATABASE_URL to postgres://postgres:postgres@webdb:5432/oasst_web

kmadsen avatar Apr 27 '23 14:04 kmadsen

Feel free to make a PR adding this option

olliestanley avatar Apr 29 '23 10:04 olliestanley

Why not localhost port number 8000?

http://127.0.0.1:8000/

If the user are facing some issue with the 8000 port then they can just change it in the some configuration file. Just like Django localhost. What do you think?

Viddesh1 avatar May 02 '23 12:05 Viddesh1

Why not localhost port number 8000?

http://127.0.0.1:8000/

If the user are facing some issue with the 8000 port then they can just change it in the some configuration file. Just like Django localhost. What do you think?

8000 is used by the backend.

olliestanley avatar Jun 12 '23 18:06 olliestanley