FastChat icon indicating copy to clipboard operation
FastChat copied to clipboard

ERROR: [Errno 99] error while attempting to bind on address ('::1', 21001, 0, 0): cannot assign requested address

Open lucasjinreal opened this issue 2 years ago • 2 comments

ERROR: [Errno 99] error while attempting to bind on address ('::1', 21001, 0, 0): cannot assign requested address

lucasjinreal avatar Jun 16 '23 08:06 lucasjinreal

you shuold change locahost to 0.0.0.0, this can fix it

Ted8000 avatar Jun 16 '23 08:06 Ted8000

@Ted8000 thank u , currently fschat start an openai servce is very cubersome, I need start controller, than start worker, than start runner, is there a way just run a single script and do them all??

lucasjinreal avatar Jun 16 '23 11:06 lucasjinreal

Just create a script that starts off of them!

@Ted8000 thank u , currently fschat start an openai servce is very cubersome, I need start controller, than start worker, than start runner, is there a way just run a single script and do them all??

Just create a shell script which begins all of them for you!

To me, it makes a lot of sense this separation. You can keep the controller running, add and remove models in other machines and in more gpus, and keep the UI running isolated from that. It's the best way of implementing this, to be honest.

surak avatar Jun 17 '23 16:06 surak

@surak Yes, from this aspect of view, it's scalable. But now, I just have one single model to serve, and everytime I ctrl + c to stop the server, controller and model won't stop actually, it need kill -9 the process.

lucasjinreal avatar Jun 19 '23 02:06 lucasjinreal

That's quite trivial to implement in a shell script - make one that launches the three of them in the background, and a callback to kill them when the script itself is killed.

Something like this?

#!/bin/bash

# Launch three processes in the background
process1 &
pids+=($!)
process2 &
pids+=($!)
process3 &
pids+=($!)

# Trap the TERM signal and kill the background processes
trap 'kill ${pids[@]}' TERM

# Wait for any child processes to complete
wait

surak avatar Jun 19 '23 12:06 surak

@surak hi, how can I call this

lucasjinreal avatar Jun 20 '23 02:06 lucasjinreal

It's a shell script. Teaching elementary terminal skills is not in the scope of the bug, but let's go.

Have a look at something like https://towardsdatascience.com/basics-of-bash-for-beginners-92e53a4c117a

surak avatar Jun 22 '23 16:06 surak

@surak I mean, I don't know how to define such process1, how to send it as shell args?

lucasjinreal avatar Jun 23 '23 04:06 lucasjinreal

Replace line process 1 with the call for the controller, process2 with the web server, process 3 with the worker.

Just make sure you keep the ampersand & at the end of the line.

surak avatar Jun 23 '23 10:06 surak

thank u!

lucasjinreal avatar Jun 25 '23 03:06 lucasjinreal

I have the same issue in colab: Screenshot (607) how should this be fixed on colab?

tytung2020 avatar Oct 30 '23 07:10 tytung2020

Google Colab redirects localhost to the VM backend, using 127.0.0.1 solves the issue:

!python3 -m fastchat.serve.controller --host 127.0.0.1 --port 8000

ggcr avatar Jan 20 '24 12:01 ggcr