Cycles wallet issue: no query method wallet_api_version

Hey all

TLDR: Using a very old (older than ~September 2021) cycles wallet doesn’t work with recent dfx versions. Solutions are either upgrading the wallet wasm (see instructions below) or waiting for a new dfx version

As a result of rolling out the change to error codes we discovered a problem with how agent-rs detects cycle wallet versions. A typical error looks like this:

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 'frontend'.
   Failed to construct wallet canister caller: The replica returned a replica error: reject code CanisterError, reject message IC0536: Canister <your cycles wallet principal> has no query method 'wallet_api_version', error code Some("IC0536")

This happens because the error code is used to figure out the wallet version in case no version is explicitly returned by the wallet. Only wallets older than version 0.2.0 (released on September 3, 2021) do not have this function.

How to fix it

There are two options to fix this problem:

  1. Wait for a dfx version that includes a patched Rust agent (will be released soon)
  2. Upgrade the cycles wallet:
  • Download the latest cycles wallet wasm
  • Upgrade the cycles wallet: dfx canister --network ic install <cycles wallet id> --wasm <path to wallet.wasm> --mode upgrade