Address in use (os error 98)

I usually run dfx start in the foreground in a dedicated terminal, on Ubuntu Linux. When I stop the process and try to start it up again relatively soon after stopping (sometimes multiple seconds) I often get this error: Address in use (os error 98).

It would be nice if it could clean itself up more quickly, just for a better developer experience.

6 Likes

Try sudo dfx stop, and it cleans the process clearly

1 Like

Hi, flyq,
I try the command, it said the sudo: dfx command not found

1 Like

the same happens to me!

We’re aware of the issue but have not found a way to reproduce this. If someone has a way to do it reliably we’d appreciate it a lot

1 Like

Try running dfx start and then immediately cancel the process with Ctrl+c or the equivalent on your machine (I’m using Ubuntu). After that try dfx stop. I think that’s often when dfx stop can’t stop all processes.

That being said, now dfx gives me the ids of the processes that it couldn’t stop. So I just do a sudo kill -9 process_id and I believe that fixes it every time and allows me to dodfx start again.

2 Likes