Why is IC not able to delete live canister and transfer it's remaining cycles to my dfx wallet?

It worked fine a week or so ago… I ran the command to stop the canister that is deployed live first, then the command to delete the canister (which should also return existing cycles from that canister back to my currently active wallet. This is always failing though and I am confused as to why ?

it doesn’t seem like you’re doing anything wrong - what version of dfx is this?

Version used is 0.11.2

That shouldn’t happen, you are certainly performing the right steps. Would you mind trying again after a dfx wallet --network ic upgrade?

I’ve just upgraded wallet as per your instructions (which succeeded) and re-ran the stop / delete canister commands, but the same thing happens (note that I’ve used set-wallet before upgrading it to a second wallet that I have tied to my identity because the first one had like 0.01 trillion cycles which is not enough for the upgrade process to complete and I’m unsure on how I can top-up more cycles to the wallet canister itself?)

Hmm… that’s really weird. Would you mind trying with the latest 0.12.0 version? DFX_VERSION=0.12.0 sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)" will install it.

If you have ICP, you can work with dfx ledger top-up which will convert ICP into new cycles. Or you can top the wallet up from a different wallet.

1 Like

Thank you! The only way to actually delete the canister and return cycles back is to upgrade dfx to the latest version AND to change version to latest one as well in the dfx.json of the project so that it actually does the stop / delete commands using that latest version (and not 0.11.2 that was used previously). Looks like something changed on the IC blockchain that does not do cycles withdrawal / canister deletion properly for the previous version?

Glad to hear it worked. I’m not aware of any breaking changes and this is the first instance I’m hearing of, so I’d like to claim it was a fluke. But only time will tell…

1 Like