Dfx 0.16: Wasm module is too large

Hi,

We recently upgraded some our wasm to include other canisters with the new dfx version 0.16.

All is good except the unzipped wasm is 39.9 MB (41,866,288 bytes) and on install we get this error:

Error: Failed to install wasm module to canister ‘root’.
Caused by: Failed to install wasm module to canister ‘root’.
Failed during wasm installation call: The replica returned a replica error: reject code CanisterError, reject message Wasm module of canister avqkn-guaaa-aaaaa-qaaea-cai is not valid: Failed to decode wasm module: Wasm module is too large, it can be at most 31457280 bytes, error code None

Going through the forum posts I found this posted in June 2023 Dynamically create a canister from wasm module - #22 by abk

Actually we recently made a change that allows the Wasm module to be 30MB uncompressed as long as the code section is still under 10MB

I’m guessing that check was somehow left in there?

The gzipped wasm is 7.1 mb

1 Like

Yeah we accidentally left that gzip limit in there, but there is already an MR out to raise it. For now, since your unzipped size is ~40 MiB, so can just do the chunked install without zipping.

Awesome, thanks. Yeah, we decided to embed all the WASMs of our 6 canisters so we can do stuff like this. It makes all the co-ordination, and cycle management a lot easier. Also probably helps when we get to the multiple subnet stage.

1 Like

thanks, could you please let us know once the MR has been merged? Thanks

Sure thing. Feel free to bug me about it as well.