Issue: Candid Interface Compatibility Warning When Using dfx install

We are running into a Candid compatibility error when we use “dfx install”. The issue does not occur when we run “dfx deploy”.

  1. Run the following command to upgrade the canister:

dfx canister install --network=ic --wasm .dfx/local/canisters/auth_dev/auth_dev.wasm.gz --mode upgrade '--argument=(record { modclub_canister_id = xxxxxxxx; })' auth_dev

  1. Noticed the following warning message and prompt:
Upgrading code for canister auth_dev, with canister ID xxxx-xxxxx-xxxxx

WARNING!

An error occurred during Candid interface compatibility check for canister 'auth_dev'.

Checking generated did file.

Do you want to proceed? yes/No

This prompt will never disappear even if we have selected "yes" in a previous run. This causes issues for us as it fails our CI pipeline.

More details with the candid files can be seen here:

We are on dfx 0.20.1

@diegop Could you help us by tagging a Dfinity member that might know the solution?

Yup!

@chenyan any ideas?

The two did files you posted is actually fine. I manually run didc check new.did old.did, and didn’t find any breaking changes.

The problem probably comes from the --wasm option, where you provided a gzipped wasm. This may prevent dfx from finding the right did file, thus reporting a spurious error. Ping @Severin to double check on the dfx side.

One workaround is to remove the --wasm option, and add gzip: true in dfx.json. Then dfx should perform the gzip for you.

1 Like

Thanks @chenyan we will try this and report back

@chenyan We have tested with the gzip flag in dfx.json and we still receive the same error.

You mentioned dfx deploy works fine, right? With the gzip option, you can use dfx deploy instead.