dfinity / dfinity/sdk

Local development intro tutorial doesn't work on Windows WSL environment

Open
#2,792 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Rust
Stars
204
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Hi team,

I've discussed the issue in Discord here and here.

I'm running dfx on a Ubuntu machine (Ubuntu 20.04 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)) running on Windows 10 WSL. I followed the official docs for setting up dfx via WSL. I'm running node version v19.1.0 and dfx version 0.12.1.

[windows_dir]>wsl -l -v
  NAME                   STATE           VERSION
* docker-desktop-data    Stopped         2
  Ubuntu                 Running         1

This is the process I followed:

dfx new hello
dfx start --clean --background

Everything looked good, and I could access the dashboard that opens up.

Running dfx start for version 0.12.1
Using the default definition for the 'local' shared network because /home/amir/.config/dfx/networks.json does not exist.

Then, running dfx deploy ends with an error:

Creating a wallet canister on the local network.
thread 'main' panicked at 'assertion failed: (left == right)
  left: 819200,
 right: 0: The page allocator was initialized with non-empty file', replicated_state/src/page_map/page_allocator/mmap.rs:399:9

I followed a few suggestions including using the --clean option when starting dfx, as well as deleting the .dfx dir, but nothing worked.

I also tried an alternative command, but got the same issue:

dfx start --clean --backgroun
dfx identity get-wallet

Gives:

Creating a wallet canister on the local network.
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `819200`,
 right: `0`: The page allocator was initialized with non-empty file', replicated_state/src/page_map/page_allocator/mmap.rs:399:9
version: 0.8.1
 Error: Failed to get wallet for identity 'default' on network 'local'.
Caused by: Failed to get wallet for identity 'default' on network 'local'.
  Failed to create wallet for identity 'default' 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
Nov 30 19:21:06.947 WARN Internal Error during request:
hyper::Error(
    Connect,
    ConnectError(
        "tcp connect error",
        Os {
            code: 111,
            kind: ConnectionRefused,
            message: "Connection refused",
        },
    ),
)

I then downgraded to version 0.10.1 which started to work as expected. I suppose the issue is with the latest version then (0.12.1).

Meta

dfx --version:

0.12.1
Further log output

<log output>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported flow with dfx 0.12.1 on Ubuntu 20.04 under Windows WSL: run dfx new hello, dfx start --clean --background, then dfx deploy. Start at replicated_state/src/page_map/page_allocator/mmap.rs:399, and also check dfx identity get-wallet; done means these commands no longer produce the page allocator panic in the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.