Major bug in dfx 0.16.0 with Azle

Hey!

The Wasm binary limit has been lifted, and I’m trying to get it to work using dfx 0.16.0. I’m deploying with Azle like I always do, I just had everything working fine with a recent commit from the sdk GitHub master branch.

Azle canisters use the Rust CDK and the ic-wasi-polyfill. We’re also using wasmedge-quickjs…I’m not sure where this error is coming from but I’ve seen something similar before when integrating wasmedge-quickjs.

With a fresh install of dfx 0.16.0 I get the following error on dfx deploy:

Installing canisters...
Creating UI canister on the local network.
The UI canister on the "local" network is "bd3sg-teaaa-aaaaa-qaaba-cai"
Installing code for canister backend, with canister ID bkyz2-fmaaa-aaaaa-qaaaq-cai
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed while trying to install all canisters.
    Failed to install wasm module to canister 'backend'.
      Failed during wasm installation call: The replica returned an HTTP Error: Http Error: status 500 Internal Server Error, content type "", content: Internal Server Error

With a fresh install of dfx 0.16.0 the replica is logging the following:

lastmjs@lastmjs-G7-7790:~/development/azle$ dfx start --clean --host 127.0.0.1:8000
Running dfx start for version 0.16.0
Using the default definition for the 'local' shared network because /home/lastmjs/.config/dfx/networks.json does not exist.
Initialized replica.
Dashboard: http://localhost:45183/_/dashboard
thread 'MR Batch Processor' panicked at rs/execution_environment/src/execution/install_code.rs:207:9:
assertion `left == right` failed
  left: 192069442848
 right: 192071540000
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-01-24T22:47:27.270162Z ERROR icx_proxy_dev::proxy: Internal Error during request:
error trying to connect: tcp connect error: Connection refused (os error 111)
2024-01-24T22:47:27.270269Z ERROR tower_http::trace::on_failure: response failed classification=Status code: 500 Internal Server Error latency=0 ms
Stopping icx-proxy...
Stopped.
Initialized replica.
Dashboard: http://localhost:35883/_/dashboard
thread 'MR Batch Processor' panicked at rs/execution_environment/src/execution/install_code.rs:207:9:
assertion `left == right` failed
  left: 192069442848
 right: 192071540000
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2 Likes

Thank you for the bug report. The team is investigating in collaboration with Jordan to track down the root cause. At this point we’re confident this issue does not affect mainnet.

3 Likes

It seems this bug was introduced after dfx 0.15.3-largewasm.0. I can deploy locally just fine with that version, but as soon as I switch to dfx 0.16.0-beta.0 or dfx 0.16.0 it breaks.

1 Like

Thanks for the bug report @lastmjs, it’s really helpful to have you testing out the dfx beta releases. The issue has been fixed here so there won’t be any problems with installing large Wasms on mainnet. The fix should be included in dfx in the next release.

1 Like

We have a new beta release with the bugfix:

DFX_VERSION=0.17.0-beta.0 sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

@lastmjs could you please verify that the issue is fixed for you with this version?

2 Likes

Verified! Tried it on three example projects with large binaries. Thank you very much!

2 Likes

Since 0.17.0 contains a breaking change we decided to exclude the breaking change and release a minor version bump that also includes the fixed replica: Dfx 0.16.1 is promoted

1 Like

Yep, already on it and have run out test suite against it

1 Like