'dfx start' results in error... where is src/dfx/src/actors/replica.rs file located to troubleshoot?

Following this guide:

after running dfx start

I get this error:

Jun 09 00:01:40.145 INFO ic-starter. Configuration: ValidatedConfig { replica_path: Some("/home/chris/.cache/dfinity/versions/0.7.1/replica"), replica_version: “0.1.0”, log_level: Warning, cargo_bin: “cargo”, cargo_opts: “”, state_dir: “/home/chris/dfinity/hello/.dfx/state/replicated_state”, http_listen_addr: V4(127.0.0.1:0), http_port_file: Some("/home/chris/dfinity/hello/.dfx/replica-configuration/replica-1.port"), metrics_addr: None, provisional_whitelist: Some(All), artifact_pool_dir: “/home/chris/dfinity/hello/.dfx/state/replicated_state/node-100/ic_consensus_pool”, artifact_backup_dir: None, crypto_root: “/home/chris/dfinity/hello/.dfx/state/replicated_state/node-100/crypto”, state_manager_root: “/home/chris/dfinity/hello/.dfx/state/replicated_state/node-100/state”, registry_local_store_path: “/home/chris/dfinity/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
thread ‘replica-actor’ panicked at ‘called Result::unwrap() on an Err value: Cannot start the replica: Timeout’, src/dfx/src/actors/replica.rs:307:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

1 Like

What system are you running on?
Are you able to do dfx start --emulator and is that working?

That works, … Ubuntu 20.04

Are you able to do the following with no issue:

cd ~/.cache/dfinity/versions/0.7.1
./ic-starter --replica-path ./replica

you can ctrl+c to kill both

after running ./ic-starter --replica-path ./replica :

Jun 09 00:33:40.590 INFO ic-starter. Configuration: ValidatedConfig { replica_path: Some("./replica"), replica_version: “0.1.0”, log_level: Warning, cargo_bin: “cargo”, cargo_opts: “”, state_dir: “/tmp/.tmpIBPdOC”, http_listen_addr: V4(127.0.0.1:8080), http_port_file: None, metrics_addr: None, provisional_whitelist: None, artifact_pool_dir: “/tmp/.tmpIBPdOC/node-100/ic_consensus_pool”, artifact_backup_dir: None, crypto_root: “/tmp/.tmpIBPdOC/node-100/crypto”, state_manager_root: “/tmp/.tmpIBPdOC/node-100/state”, registry_local_store_path: “/tmp/.tmpIBPdOC/ic_registry_local_store”, unit_delay: None, initial_notary_delay: None, detect_consensus_starvation: None, consensus_pool_backend: None, state_dir_holder: Some(TempDir { path: “/tmp/.tmpIBPdOC” }) }, Application: starter
Jun 09 00:33:40.590 INFO Initialize replica configuration “/tmp/.tmpIBPdOC/ic.json5”, Application: starter
Illegal instruction (core dumped)

could be trying to execute an instruction that your cpu doesn’t support. It’d be nice to get the core dump or run the replica in gdb, are you able to do that? I’ll forward this to someone on the team who may be more suited to help.

For now, please continue with --emulator to unblock you

Not familiar with that but I can figure it out if this doesn’t give you what you need:

dfx start

With RUST_BACKTRACE=1

thread ‘replica-actor’ panicked at ‘called Result::unwrap() on an Err value: Cannot start the replica: Timeout’, src/dfx/src/actors/replica.rs:307:17
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::result::unwrap_failed
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

… and with RUST_BACKTRACE=full

thread ‘replica-actor’ panicked at ‘called Result::unwrap() on an Err value: Cannot start the replica: Timeout’, src/dfx/src/actors/replica.rs:307:17
stack backtrace:
0: 0x55f6c5023a13 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8e44e3bad104136e
1: 0x55f6c507bd3d - core::fmt::write::he8cb6d64ed166147
2: 0x55f6c504c087 - std::io::Write::write_fmt::hf25ce96005919ce6
3: 0x55f6c503d350 - std::panicking::default_hook::{{closure}}::hf8bcda2c877e2dcc
4: 0x55f6c503d064 - std::panicking::default_hook::h0602fc6a3744f2c1
5: 0x55f6c503d9c7 - std::panicking::rust_panic_with_hook::h7b83b0fe7900eb7a
6: 0x55f6c503d5cb - rust_begin_unwind
7: 0x55f6c507ba21 - core::panicking::panic_fmt::h61e03e91a1a8868a
8: 0x55f6c507bab3 - core::result::unwrap_failed::hfb81d2c162de1956
9: 0x55f6c3b05d7a - std::sys_common::backtrace::__rust_begin_short_backtrace::h868ff280d64dcf65
10: 0x55f6c3ceb2b5 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h3d2d201e7150ee40
11: 0x55f6c5041c7a - std::sys::unix::thread::thread::new::thread_start::h2dd53bf76d714ab0
12: 0x7fd928594609 - start_thread
at /build/glibc-eX1tMB/glibc-2.31/nptl/pthread_create.c:477
13: 0x7fd9286db293 - __clone
14: 0x0 -

… this is all like a different language to me, not sure what any of it means tbh.

I can do the gdb thing next if it would help fix a bug.

The issue is with running the local replica process (invoked by dfx start.) That backtrace doesn’t tell us much since its from dfx. you can try adding the backtrace=full to
RUST_BACKTRACE=full ~/.cache/dfinity/version/0.7.1/ic-starter --replica-path ~/.cache/dfinity/version/0.7.1/replica

1 Like

What are the implications of running in emulator mode and is there thorough documentation of that somewhere? thanks!

… and trying that now.

the emulator is stand-in for the local replica, a “mock” if you will. It should supports much of what you’d need for local development but isn’t as fully featured as the actual replica. It’s a bit slower when installing larger canisters/uploading large assets.

2 Likes

Didn’t turn up anything new, maybe the environment variable only has an effect on dfx?

Can’t seem to find the core dump, not something I’m familiar with doing. It’s not in the working directory where I run the command.

1 Like