Hey so I thought that Wasm modules could be up to 100 MiB with 90 MiB of data section? Is that wrong?
I’m trying to deploy a Wasm module that is 49 MiB using dfx 0.16.1 locally, should be mostly data section, and I get this error:
Installing canisters...
Upgrading 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 a replica error: reject code CanisterError, reject message Wasm module of canister bkyz2-fmaaa-aaaaa-qaaaq-cai is not valid: Failed to decode wasm module: Wasm module is too large, it can be at most 31457280 bytes, error code None
Were you also using the option to gzip the Wasm module? If that’s the case then it’s a bug that was fixed in dfx 0.17.0. If that’s not the case then I’ll need some more information to debug what’s happening here (link to the repo, steps to reproduce).
I am on dfx 0.17.0 and this issue still persists, it doesn’t matter if gzip is set to true or false. The Wasm binary is 47.3 MB in size, and has a 17.8 MB file, a 12.2 MB file, and a 5.3 MB file included in the binary using the include_dir Rust directive. This is an Azle canister. I would expect to have up to 90 MB of data section available.
Looks like the fix didn’t actually make it into dfx 0.17.0, but is in 0.18.0. When I make a large canister using include_bytes and deploy to a dfx local subnet I do still get your initial error. But it works on dfx 0.18.0.