dfinity / sdk

IC SDK: a Software Development Kit for creating and managing canister smart contracts on the ICP blockchain.
https://internetcomputer.org/developers
Apache License 2.0
177 stars 85 forks source link

fix: address already in use error in dfx start #4006

Closed mraszyk closed 1 week ago

mraszyk commented 1 week ago

This PR fixes errors of the form

$ dfx start --clean
Running dfx start for version 0.24.2+rev23.dirty-3b68fe37
Using project-specific network 'local' defined in /home/martin/orbit/dfx.json
Error: Failed to get frontend address.
Caused by: Failed to find available socket address
Caused by: Failed to bind socket to 127.0.0.1:4943.
Caused by: Address already in use (os error 98)

observed when restarting dfx shortly after browsing a frontend canister making periodic background requests and stopping dfx.

It has been manually confirmed to fix the issue on Ubuntu 24.04.1 LTS.