Deployment issue

Hello Community,

I hope this message finds you well. I’m currently working on a DFINITY project using the dfx tool, and I’ve encountered an issue during the deployment process that I’m having trouble resolving.

Error Message:

Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to get wallet canister caller for identity 'sai' on network 'local'.
    Failed to get wallet for identity 'sai' on network 'local'.
      Failed to create wallet for identity 'sai' on network 'local'.
        Failed while installing wasm.
          The replica returned an HTTP Error: Http Error: status 500 Internal Server Error, content type "", content: Internal Server Error

Additionally, I encountered a separate issue when running the dfx start command:

thread 'MR Batch Processor' panicked at 'MmapPageAllocator failed to mmap 765952 bytes to memory file #35 at offset 0 for deserialization: ENOEXEC: Exec format error', rs/replicated_state/src/page_map/page_allocator/mmap.rs:615:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Did you try dfx start --clean?

yes i am using dfx start --clean but when i am deploying it i am getting error in deployment terminal and

thread 'MR Batch Processor' panicked at 'MmapPageAllocator failed to mmap 765952 bytes to memory file #35 at offset 0 for deserialization: ENOEXEC: Exec format error', rs/replicated_state/src/page_map/page_allocator/mmap.rs:615:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

this in start terminal

I’ll ask round what the problem could be… What system are you running this on? macOS?

I am using windows with wsl2

thread 'MR Batch Processor' panicked at 'MmapPageAllocator failed to mmap 765952 bytes to memory file #34 at offset 0 for deserialization: ENOEXEC: Exec format error', rs/replicated_state/src/page_map/page_allocator/mmap.rs:615:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-11-20T10:15:48.936877Z ERROR icx_proxy_dev::proxy: Internal Error during request:
error trying to connect: tcp connect error: Connection refused (os error 111)
2023-11-20T10:15:48.942658Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=16 ms
Stopping icx-proxy...
Stopped.

Thanks for the report @unknown84502.

The error looks like a bug in WSL: mmap(NULL, ...) on zero-length file fails with ENOEXEC · Issue #3451 · microsoft/WSL · GitHub

What does wsl -l -v show for you?

PS C:\WINDOWS\system32> wsl -l -v
NAME STATE VERSION

  • Ubuntu Running 1

That means Ubuntu is using WSL 1. Would you mind switching to WSL 2 using

wsl --set-version Ubuntu 2

And the verify with

wsl -l -v

It should say “Ubuntu Running 2”

Here is the documentation: Install WSL | Microsoft Learn

PS C:\WINDOWS\system32> wsl --set-version Ubuntu 2
For information on key differences with WSL 2 please visit Comparing WSL Versions | Microsoft Learn
Conversion in progress, this may take a few minutes.
Failed to configure network (networkingMode Nat). To disable networking, set wsl2.networkingMode=None in C:\Users\MY PC.wslconfig
Error code: Wsl/Service/CreateVm/ConfigureNetworking/HNS/ERROR_FILE_NOT_FOUND

Looks like another issue in WSL. People report some workarounds here: