dfinity / dfinity/sdk

Always getting "Module hash <hash> is already installed" when trying to upgrade

Open
#2,516 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

blocked bug triaged
Dominant language
Rust
Stars
204
Forks
98
PR merge metrics
No merged PRs in 30d

Description

I'm attempting to upgrade a custom canister locally by calling dfx canister install --mode upgrade <canister name>

I receive a message saying that the module is already installed despite the gzipped Wasm file being different. I even get this message if I remove the real .wasm.gz file and create an empty one at the expected path using touch, or rm the file.

If I try dfx canister install --mode upgrade --upgrade-unchanged <canister name> I see traces from the upgrade hooks but the canister remains unchanged. My assets canister seems unaffected.

I'm using dfx 0.12.0-beta.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the dfx canister install --mode upgrade <canister name> command path and reproduce the behavior with the reported 0.12.0-beta.1 setup. Compare normal upgrade handling with --upgrade-unchanged, including the case where the .wasm.gz file is removed or replaced; done means a changed module is upgraded and an unchanged module is handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.