`ManagementCanister::delete_canister_snapshot` does not work for canisters on IC mainnet
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 144
- Forks
- 84
- Avg merge
- 20h 4m
- Merged PRs (30d)
- 1
Description
Given this code:
let client = ManagementCanister::create(agent);
client
.delete_canister_snapshot(&canister, &snapshot_id.id)
.await?;
When I run this code for any canister on the local dfx network, it does work, but when running for a canister on IC mainnet, an error is returned:
The replica returned an HTTP Error: Http Error: status 400 Bad Request, content type "text/plain; charset=utf-8", content: error: canister_not_found
details: The specified canister does not exist.
This code however works for both local and mainnet canisters:
let call: AsyncCaller<'_, ()> = client.update(MgmtMethod::DeleteCanisterSnapshot.as_ref())
.with_arg(In {
canister_id: canister,
snapshot_id: &snapshot_id.id,
})
.with_effective_canister_id(canister)
.build();
call.await?;
The difference with the delete_canister_snapshot() implementation is this line:
.with_effective_canister_id(canister)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Rust implementation of ManagementCanister::delete_canister_snapshot and compare its request construction with the working AsyncCaller example in the issue. Verify the behavior against both a local dfx canister and an IC mainnet canister; done means the management call no longer returns canister_not_found on mainnet.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100