Wallet upgrade not possible

i’m currently trying to upgrade my wallet, but it fails with the following error:

❯ dfx wallet --network ic upgrade
The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type "", content: Requested canister rejected the message

my current identity is the controller of the wallet

❯ dfx identity --network ic get-principal
cbvco-k27pa-...-dayv3-4qe
❯ dfx wallet --network ic controllers
cbvco-k27pa-...-dayv3-4qe

is this a bug?

tagging @diegop bc i don’t know whose expertise this is

thanks for tagging me @cryptoschindler . let me escalate within the team

Hi there, what version of dfx are you using? That will help us investigate. Thank you

thanks for the quick response!

i’m using 0.9.0

Would you please run the following?

$ dfx identity --network ic get-wallet
$ dfx canister --network ic status $(dfx identity --network ic get-wallet)
$ dfx wallet --network ic addresses
1 Like
❯ dfx identity --network ic get-wallet
lom6m-...-cai
❯ dfx canister --network ic status $(dfx identity --network ic get-wallet)
The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type "", content: Requested canister rejected the message
❯ dfx wallet --network ic addresses
Id: edhea-...-sqe, Kind: Unknown, Role: Custodian, Name: No name set.
Id: cbvco-...-4qe, Kind: Unknown, Role: Controller, Name: No name set.
Id: ec4jk-...-tqe, Kind: Unknown, Role: Custodian, Name: No name set.
Id: 3hlbk-...-dqe, Kind: Unknown, Role: Contact, Name: No name set.

It looks like the identity that you are using isn’t the controller of the wallet, at the canister level. The wallet’s address list is a different entity from the list of controllers of the canister.

Would you please run this? (dfx canister info, which works for anyone, vs dfx canister status, which works only for a controller of the canister)

$ dfx canister --network ic info $(dfx identity --network ic get-wallet)
1 Like

you are right!

❯ dfx canister --network ic info $(dfx identity --network ic get-wallet)
Controllers: 3hlbk-...-dqe
Module hash: 0x9183a38dd2eb1a4295f360990f87e67aa006f225910ab14880748e091248e086

I didn’t even know there’s a distinction between controller at canister level and controller at wallet level, it might be of helps to use a different term here to avoid confusion?

When trying to update the controller for the wallet canister I get the following error (I’m using the identity that is the controller at the canister level):

❯ dfx canister --network ic update-settings --controller mainnet $(dfx identity --network ic get-wallet)
Cannot find canister name for id 'lom6m-...-cai'.

Adding the principal to canister_ids.json doesn’t help either:

❯ dfx canister --network ic update-settings --controller mainnet lom6m-...-cai
Cannot find canister 'wallet'.

it might be of helps to use a different term here to avoid confusion?

Yeah, it’s confusing.

Okay, update-settings is trying to look up the canister name in dfx.json given the canister id. So it might work to add it there, in addition to canister_ids.json.

Another option would be to try dfx --identity mainnet wallet --network ic upgrade

Adding the canister name to dfx.json did the trick! Can we avoid this in general? So that we don’t need to modify dfx.json or canister_ids.json when running commands that address a principal directly? dfx should have everything it needs (the canister id) to run the command correctly without needing to specify stuff somewhere else, right?

Thanks for your help Eric! :slight_smile:

The reason dfx canister update-settings is looking up the canister in dfx.json is to look up the compute allocation, memory allocation, and freezing threshold, so it might not be that simple.

In this case though, the way to upgrade a wallet is to upgrade it with the identity that created it, in this case dfx --identity mainnet wallet --network ic upgrade

1 Like