Unable to run replica due to main panicked at crypto keystore path

Hello,

I am currently unable to run the replica need to deploy my project.

When running the dfx start command in my terminal it returns this code.

Dec 19 09:50:54.211 INFO Executing “/home/mrpink/.cache/dfinity/versions/0.8.4/replica” “–replica-version” “0.8.0” “–config-file” “/mnt/c/Users/Angel/hello1/.dfx/state/replicated_state/ic.json5”, Application: starter
thread ‘main’ panicked at ‘crypto keystore path /mnt/c/Users/Angel/hello1/.dfx/state/replicated_state/node-100/crypto has permissions 0o40777, allowing reading by others’, crypto/internal/crypto_service_provider/src/secret_key_store/proto_store.rs:250:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
thread ‘replica-actor’ panicked at ‘called Result::unwrap() on an Err value: Cannot start the replica: Timeout’, src/dfx/src/actors/replica.rs:274:78
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

In another window when i try to then use dfx deploy it returns this error.
An error happened during communication with the replica: error sending request for url (http://127.0.0.1:8000/api/v2/status): error trying to connect: tcp connect error: Connection refused (os error 111)

any help is appreciated,
Thank you MrPink

1 Like

It looks like you’re running in WSL on Windows, you’ll need to store your projects in the WSL file system itself eg ~/ic-projects/, not on the mounted windows drives (which causes file permission issues). Once the replica’s running properly the connection refused error in the second terminal should be resolved too.

More tips for using WSL are in this thread here, if they’re useful: https://forum.dfinity.org/t/native-windows-support/1241/2?u=ori

2 Likes

Ori you damn genius thank you. I should just asked in the first place instead of spending 3 hours feeling like the ape from space odyssey.

Thank you,

3 Likes

I have the same issue here on a linux OS (Ubuntu 20.04). @Ori do you have an idea of what it might be?

ac@workstation:~/Dev/pl/pl-ic$ dfx start --background
Version v0.10.0 installed successfully.
binding to: 127.0.0.1:34885
May 22 15:30:28.439 INFO ic-starter. Configuration: ValidatedConfig { replica_path: Some("/home/ac/.cache/dfinity/versions/0.10.0/replica"), replica_version: “0.8.0”, log_level: Warning, cargo_bin: “cargo”, cargo_opts: “”, state_dir: “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state”, http_listen_addr: 127.0.0.1:0, http_port_file: Some("/home/ac/Dev/pl/pl-ic/.dfx/replica-configuration/replica-1.port"), metrics_addr: None, provisional_whitelist: Some(All), artifact_pool_dir: “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state/node-100/ic_consensus_pool”, crypto_root: “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state/node-100/crypto”, state_manager_root: “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state/node-100/state”, registry_local_store_path: “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state/ic_registry_local_store”, unit_delay: None, initial_notary_delay: Some(600ms), dkg_interval_length: None, detect_consensus_starvation: None, consensus_pool_backend: Some(“rocksdb”), subnet_features: SubnetFeatures { ecdsa_signatures: false, canister_sandboxing: false, http_requests: false, bitcoin_testnet_feature: None }, subnet_type: Application, _state_dir_holder: None }, Application: starter
May 22 15:30:28.439 INFO Use existing replica configuration “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state/ic.json5”, Application: starter
May 22 15:30:28.439 INFO Executing “/home/ac/.cache/dfinity/versions/0.10.0/replica” “–replica-version” “0.8.0” “–config-file” “/home/ac/Dev/pl/pl-ic/.dfx/state/replicated_state/ic.json5”, Application: starter
thread ‘main’ panicked at ‘Missing validated block proposal matching finalization Signed { content: FinalizationContent { version: ReplicaVersion { version_id: “0.8.0” }, height: 7178, block: CryptoHash(0x7892e908e3dbb4ff8cc62cc9888c8ea0913dc8b0466b3d1accbd3f62867b2c4b) }, signature: MultiSignature { signature: CombinedMultiSig([185, 65, 72, 227, 240, 104, 211, 204, 153, 53, 184, 30, 96, 8, 215, 96, 91, 116, 178, 234, 175, 69, 139, 252, 4, 198, 81, 138, 236, 177, 131, 168, 215, 62, 171, 183, 171, 187, 185, 208, 18, 35, 232, 174, 31, 174, 243, 143]), signers: [2vali-3mwxr-n5qzn-dmgoi-homcs-4zv4t-n7tqw-no4qd-qpjhr-n5tav-gqe] } }’, artifact_pool/src/consensus_pool_cache.rs:179:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Error: An error happened during communication with the replica: error sending request for url (http://127.0.0.1:8000/api/v2/status): error trying to connect: tcp connect error: Connection refused (os error 111)

ac@workstation:~/Dev/pl/pl-ic$ thread ‘replica-actor’ panicked at ‘called Result::unwrap() on an Err value: Cannot start the replica: Timeout’, src/dfx/src/actors/replica.rs:308:78
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

2 Likes

@amaralc, does it help if you use the --clean flag like this: dfx start --clean?

1 Like

I am also having the same issue but on mac m1. Is there any solution for macOS? Do I need to get wsl for mac? …I am just getting started with this.

Hi Niell, which error did you get, the connection refused one or another?

WSL is a tool that lets you run a Linux VM in Windows (it stands for Windows Subsystem for Linux) which folk are using because there’s no native support for Windows yet.
You could run a virtual machine like this on a Mac too but you shouldn’t need to, dfx and the rest of the sdk is fully supported on Mac.

  1. this is the issue while running “dfx start” in the terminal:
thread 'replica-actor' panicked at 'called `Result::unwrap()` on an `Err` value: Cannot start the replica: Timeout', src/dfx/src/actors/replica.rs:279:78
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

2.This the issue while running “dfx deploy” in the terminal:

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

Found the solution to the problem. I was running the code while it was stored in an external drive. When I created the same folder on my desktop and ran everything the same way, the problem got solved and I no longer have those errors in my terminal. I don’t know how it is happening, but I just discovered it right now.

1 Like

Ok, that is interesting. Thanks for the update Niell, that could help others who run into the same error.

I encountered the same error with wsl directories.
I changed by project directory to root as suggested, resolved the ‘crypto keystore path error’

However I ran into OS error 13, (I ran powershell as admin, should have perms).

james@DESKTOP-MUJL46M:/ic-proj$ dfx new hello Fetching manifest https://sdk.dfinity.org/manifest.json Creating new project "hello"... Error: Failed to unpack archive to hello. Caused by: Failed to unpack archive to hello. Failed to create directory hello. Permission denied (os error 13)

You might need to be in the user directory on wsl, not root, eg ~/ic-proj/ instead of /ic-proj/ , you can change to this directory with:

cd ~

(The full path equivalent to ~/ic-proj/ is /home/yourusername/ic-proj/).

holy moly . it also worked for me . atfer even 1 day to debug this problem !