R
RunPod6mo ago
Jan

Getting bind on address error in serverless

I'm always getting the following error on my serverless container:
[Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
[Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
What am I doing wrong?
18 Replies
Madiator2011 (Work)
May I know what are you trying to run?
Jan
JanOP6mo ago
I'm running a custom model using the handler function
Madiator2011 (Work)
What model what function? Usually you do not need to bind any ports as serverless cant expose ports
Jan
JanOP6mo ago
i'm not binding any ports, it is the handler that binds the port
Madiator2011 (Work)
Mind showing full log?
Jan
JanOP6mo ago
it's basically this: ERROR: [Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
Madiator2011 (Work)
though it's not full log
Jan
JanOP6mo ago
2024-07-31 11:27:43.662
[]
[info]
INFO: Application shutdown complete.
2024-07-31 11:27:43.662
[]
[info]
INFO: Waiting for application shutdown.
2024-07-31 11:27:43.662
[]
[error]
ERROR: [Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
2024-07-31 11:27:43.661
[]
[info]
INFO: Application startup complete.
2024-07-31 11:27:43.661
[]
[info]
INFO: Waiting for application startup.
2024-07-31 11:27:43.661
[]
[info]
INFO: Started server process [7]
2024-07-31 11:27:43.608
[]
[info]
Starting API server.
2024-07-31 11:27:43.608
[]
[info]
--- Starting Serverless Worker | Version 1.6.2 ---
2024-07-31 11:27:43.608
[]
[info]
Using device cuda:0
2024-07-31 11:27:43.608
[]
[info]
Using device cuda:0
2024-07-31 11:27:43.608
[]
[info]
Using device cuda:0
2024-07-31 11:27:37.175
[]
[info]
Loading checkpoint shards: 0%| | 0/4 [00:00<?, ?it/s] Loading checkpoint shards: 25%|██▌ | 1/4 [00:01<00:03, 1.23s/it] Loading checkpoint shards: 50%|█████ | 2/4 [00:02<00:02, 1.21s/it] Loading checkpoint shards: 75%|███████▌ | 3/4 [00:03<00:01, 1.14s/it] Loading checkpoint shards: 100%|██████████| 4/4 [00:04<00:00, 1.01s/it] Loading checkpoint shards: 100%|██████████| 4/4 [00:04<00:00, 1.08s/it]
2024-07-31 11:27:18.790
[]
[info]
INFO: Application shutdown complete.
2024-07-31 11:27:18.789
[]
[info]
INFO: Waiting for application shutdown.
2024-07-31 11:27:18.789
[]
[error]
ERROR: [Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
2024-07-31 11:27:18.788
[]
[info]
INFO: Application startup complete.
2024-07-31 11:27:18.788
[]
[info]
INFO: Waiting for application startup.
2024-07-31 11:27:18.788
[]
[info]
INFO: Started server process [7]
2024-07-31 11:27:43.662
[]
[info]
INFO: Application shutdown complete.
2024-07-31 11:27:43.662
[]
[info]
INFO: Waiting for application shutdown.
2024-07-31 11:27:43.662
[]
[error]
ERROR: [Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
2024-07-31 11:27:43.661
[]
[info]
INFO: Application startup complete.
2024-07-31 11:27:43.661
[]
[info]
INFO: Waiting for application startup.
2024-07-31 11:27:43.661
[]
[info]
INFO: Started server process [7]
2024-07-31 11:27:43.608
[]
[info]
Starting API server.
2024-07-31 11:27:43.608
[]
[info]
--- Starting Serverless Worker | Version 1.6.2 ---
2024-07-31 11:27:43.608
[]
[info]
Using device cuda:0
2024-07-31 11:27:43.608
[]
[info]
Using device cuda:0
2024-07-31 11:27:43.608
[]
[info]
Using device cuda:0
2024-07-31 11:27:37.175
[]
[info]
Loading checkpoint shards: 0%| | 0/4 [00:00<?, ?it/s] Loading checkpoint shards: 25%|██▌ | 1/4 [00:01<00:03, 1.23s/it] Loading checkpoint shards: 50%|█████ | 2/4 [00:02<00:02, 1.21s/it] Loading checkpoint shards: 75%|███████▌ | 3/4 [00:03<00:01, 1.14s/it] Loading checkpoint shards: 100%|██████████| 4/4 [00:04<00:00, 1.01s/it] Loading checkpoint shards: 100%|██████████| 4/4 [00:04<00:00, 1.08s/it]
2024-07-31 11:27:18.790
[]
[info]
INFO: Application shutdown complete.
2024-07-31 11:27:18.789
[]
[info]
INFO: Waiting for application shutdown.
2024-07-31 11:27:18.789
[]
[error]
ERROR: [Errno 99] error while attempting to bind on address ('::1', 8000, 0, 0): cannot assign requested address
2024-07-31 11:27:18.788
[]
[info]
INFO: Application startup complete.
2024-07-31 11:27:18.788
[]
[info]
INFO: Waiting for application startup.
2024-07-31 11:27:18.788
[]
[info]
INFO: Started server process [7]
and repeating...
Madiator2011 (Work)
I think something is wrong with your code causing it to loop and fail cause one process starts take port then like fails but api is still listning on that port causing issues
Jan
JanOP6mo ago
is there a way to start the worker without the handler and ssh into it? I’m running it locally (m1) but there might be sth missing for cuda then
Marcus
Marcus6mo ago
Can you share your code?
Encyrption
Encyrption6mo ago
It sounds like there is something already bound to port 8000. '::1' indicates you are trying to bind to IPV6 localhost. You might get further with '127.0.0.1' or '0.0.0.0'. '0.0.0.0' means "all IPv4 addresses on the local machine." If after that you still get similar message you can change 8000 to another # i.e. 8043. 8000 is the default port so is more suspectable to conflict.
Marcus
Marcus6mo ago
Code is doing something wrong
Jan
JanOP6mo ago
I ran my code on a scaleway vm with an L4 and it works without problems there. I noticed that when I change my docker command to
python -m myprogram.handler --rp_serve_api --rp_api_host="0.0.0.0"
python -m myprogram.handler --rp_serve_api --rp_api_host="0.0.0.0"
it starts up correctly, but doesn't seem to process the queue item. any other arguments I need to pass to the handler in the docker CMD section?
Marcus
Marcus6mo ago
What are you doing? That is for local testing not to run within Docker For docker you just call the handler, no args eg.
python3 -u /rp_handler.py
python3 -u /rp_handler.py
Best to use -u for unbuffered output as well.
Jan
JanOP6mo ago
so no rp_serve_api?
Marcus
Marcus6mo ago
No thats only for local testing as I mentioned above None of this stuff:
--rp_serve_api --rp_api_host="0.0.0.0"
--rp_serve_api --rp_api_host="0.0.0.0"
Jan
JanOP6mo ago
awesome, seems to work now. thanks for your help!

Did you find this page helpful?