# Error during communication with the replica (os error 111)

**URL:** <https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552>\
**Category:** Developers\
**Created:** [May 30, 2021, 1:03pm UTC](https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552 "2021-05-30T13:03:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asr](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@asr](https://forum.dfinity.org/u/asr)\
**Post date:** [May 30, 2021, 1:03pm UTC](https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552/1 "2021-05-30T13:03:26Z")

</div>

**dfx start (or start --clean) not working properly**

# dfx canister call hello greet everyone

An error happened during communication with the replica: error sending request for url ([http://127.0.0.1:8000/api/v2/status](http://127.0.0.1:8000/api/v2/status)): error trying to connect: tcp connect error: Connection refused (os error 111)

**Environment:**  
Docker version 20.10.6, build 370c289  
Distributor ID: Ubuntu  
Description: Ubuntu 20.04.2 LTS  
Release: 20.04  
Codename: focal

**Logs starting local replica:**

# export RUST\_BACKTRACE=full

# dfx startMay 30 12:26:40.540 INFO ic-starter. Configuration: ValidatedConfig { replica\_path: Some(“/root/.cache/dfinity/versions/0.7.0/replica”), replica\_version: “0.1.0”, log\_level: Warning, cargo\_bin: “cargo”, cargo\_opts: “”, state\_dir: “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state”, http\_listen\_addr: V4(127.0.0.1:0), http\_port\_file: Some(“/tmp/tmp.kVFpiY1sCm/hello/.dfx/replica-configuration/replica-1.port”), metrics\_addr: None, provisional\_whitelist: Some(All), artifact\_pool\_dir: “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state/node-100/ic\_consensus\_pool”, artifact\_backup\_dir: None, crypto\_root: “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state/node-100/crypto”, state\_manager\_root: “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state/node-100/state”, registry\_local\_store\_path: “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state/ic\_registry\_local\_store”, unit\_delay: None, initial\_notary\_delay: None, detect\_consensus\_starvation: None, consensus\_pool\_backend: Some(“rocksdb”), state\_dir\_holder: None }, Application: starter

May 30 12:26:40.540 INFO Use existing replica configuration “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state/ic.json5”, Application: starter  
May 30 12:26:40.540 INFO Executing “/root/.cache/dfinity/versions/0.7.0/replica” “–replica-version” “0.1.0” “–config-file” “/tmp/tmp.kVFpiY1sCm/hello/.dfx/state/replicated\_state/ic.json5”, Application: starter  
thread ‘replica-actor’ panicked at ‘called `Result::unwrap()` on an `Err` value: Cannot start the replica: Timeout’, src/dfx/src/actors/replica.rs:297:17  
stack backtrace:  
0: 0x563c49b36a03 - \<std::sys\_common::backtrace::\_print::DisplayBacktrace as core::fmt::Display\>::fmt::h8e44e3bad104136e  
1: 0x563c49b8ed2d - core::fmt::write::he8cb6d64ed166147  
2: 0x563c49b5f077 - std::io::Write::write\_fmt::hf25ce96005919ce6  
3: 0x563c49b50340 - std::panicking::default\_hook::{{closure}}::hf8bcda2c877e2dcc  
4: 0x563c49b50054 - std::panicking::default\_hook::h0602fc6a3744f2c1  
5: 0x563c49b509b7 - std::panicking::rust\_panic\_with\_hook::h7b83b0fe7900eb7a  
6: 0x563c49b505bb - rust\_begin\_unwind  
7: 0x563c49b8ea11 - core::panicking::panic\_fmt::h61e03e91a1a8868a  
8: 0x563c49b8eaa3 - core::result::unwrap\_failed::hfb81d2c162de1956  
9: 0x563c4862e5aa - std::sys\_common::backtrace::\_\_rust\_begin\_short\_backtrace::h94de5a14059097af  
10: 0x563c487fda65 - core::ops::function::FnOnce::call\_once{{vtable.shim}}::h4e69c9dcb6d30a26  
11: 0x563c49b54c6a - std::sys::unix:🧵🧵🆕:thread\_start::h2dd53bf76d714ab0  
12: 0x7f403acca609 - start\_thread  
13: 0x7f403ae11293 - \_\_clone  
14: 0x0 -

**Fortunately, there is a workaround, It works with:**

# dfx start --emulator

_What is the difference between them?_

---

<div class="post-metadata">

**Author:** ![aakh1361](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/aakh1361/32/2495_2.png) [@aakh1361](https://forum.dfinity.org/u/aakh1361)\
**Post date:** [January 29, 2022, 1:20am UTC](https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552/2 "2022-01-29T01:20:19Z")

</div>

> [@asr](#):
>
> # dfx start --emulator

thanks work for me . 😀

---

<div class="post-metadata">

**Author:** ![apotheosis](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/apotheosis/32/24516_2.png) [@apotheosis](https://forum.dfinity.org/u/apotheosis)\
**Post date:** [May 19, 2022, 12:47am UTC](https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552/3 "2022-05-19T00:47:29Z")

</div>

Why does this work??

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [May 19, 2022, 6:26am UTC](https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552/4 "2022-05-19T06:26:11Z")

</div>

From `dfx start --help`:

```
dfx start 
Starts the local replica and a web server for the current project
[...]
--emulator
Runs a dedicated emulator instead of the replica
```

---

<div class="post-metadata">

**Author:** ![Chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@Chris](https://forum.dfinity.org/u/Chris)\
**Post date:** [May 23, 2022, 12:06am UTC](https://forum.dfinity.org/t/error-during-communication-with-the-replica-os-error-111/4552/5 "2022-05-23T00:06:29Z")

</div>

The solution works but would like to understand more about why.

What kind of performance and usability concerns might I run into doing it this way?
