Not able to update an already deployed canister to the network

The command without --network ic gets a local wallet, which i dont think is useful. The command with --network ic gets no wallet :
dfx identity --network ic get-wallet
Please enter a passphrase for your identity: [hidden]
Decryption complete.
Error: Failed to get wallet for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
Caused by: Failed to get wallet for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
Wallet not configured.
Diagnosis was added here.
Error explanation:
This command requires a configured wallet, but the combination of identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ and network ‘ic’ has no wallet set.
How to resolve the error:
To use an identity with a configured wallet you can do one of the following:

  • Run the command for a network where you have a wallet configured. To do so, add ‘–network ’ to your command.
  • Switch to an identity that has a wallet configured using ‘dfx identity use ’.
  • Configure a wallet for this identity/network combination: 'dfx identity --network set-wallet <wallet id

dfx identity get-principal
Please enter a passphrase for your identity: [hidden]
Decryption complete.
bve5y-t2wk7-i2k65-5syel-gq5r6-iuolu-awwyd-t6ekq-kyjwn-g5u6q-vqe

dfx canister --network ic info website
Please enter a passphrase for your identity: [hidden]
Decryption complete.
Controllers: o3vsw-mqaaa-aaaan-qaa3a-cai
Module hash: 0xe0df779f65fe44893d8991bef0f9af442bff019b79ec756eface2b58beec236f

ah i see. the problem is you are using the wrong identity to make the calls. you need to use the identity that controlls the wallet which is hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe. ishowed how to check before.

this command should list all the identities u have

dfx identity list
dfx identity --network ic list

check for both local and live.

try to change into the default one first with

dfx identity use default
dfx identity --network ic use default

try both local and live to be safe

then try the fix from earlier again

This helped! I was able to deploy with --no-wallet. Thank you! However, Im not about to interact with the wallet. deploying works fine now without wallet. This is what I get when it comes to wallet:
dfx wallet --network ic balance
Error: Failed to setup wallet caller.
Caused by: Failed to setup wallet caller.
Failed to get wallet canister caller for identity ‘default’ on network ‘ic’.
Failed to get wallet for identity ‘default’ on network ‘ic’.
Wallet not configured.
Diagnosis was added here.
Error explanation:
This command requires a configured wallet, but the combination of identity ‘default’ and network ‘ic’ has no wallet set.
How to resolve the error:
To use an identity with a configured wallet you can do one of the following:

  • Run the command for a network where you have a wallet configured. To do so, add ‘–network ’ to your command.
  • Switch to an identity that has a wallet configured using ‘dfx identity use ’.
  • Configure a wallet for this identity/network combination: ‘dfx identity --network set-wallet ’.

And i tried to sel the wallet with this:

dfx identity --network ic set-wallet o3vsw-mqaaa-aaaan-qaa3a-cai
Checking availability of the canister on the network…
Setting wallet for identity ‘default’ on network ‘ic’ to id ‘o3vsw-mqaaa-aaaan-qaa3a-cai’
Error: Failed to set wallet id to o3vsw-mqaaa-aaaan-qaa3a-cai for identity ‘default’ on network ‘ic’.
Caused by: Failed to set wallet id to o3vsw-mqaaa-aaaan-qaa3a-cai for identity ‘default’ on network ‘ic’.
Failed to get wallet config for identity ‘default’ on network ‘ic’.
Failed to load wallet config /home/free_will5/.config/dfx/identity/default/wallets.json.
Unable to parse contents of /home/free_will5/.config/dfx/identity/default/wallets.json as json
expected : at line 3 column 5

can u try running dfx identity --network set-wallet as is?

dfx identity --network ic set-wallet o3vsw-mqaaa-aaaan-qaa3a-cai
Checking availability of the canister on the network…
Setting wallet for identity ‘default’ on network ‘ic’ to id ‘o3vsw-mqaaa-aaaan-qaa3a-cai’
Error: Failed to set wallet id to o3vsw-mqaaa-aaaan-qaa3a-cai for identity ‘default’ on network ‘ic’.
Caused by: Failed to set wallet id to o3vsw-mqaaa-aaaan-qaa3a-cai for identity ‘default’ on network ‘ic’.
Failed to get wallet config for identity ‘default’ on network ‘ic’.
Failed to load wallet config /home/free_will5/.config/dfx/identity/default/wallets.json.
Unable to parse contents of /home/free_will5/.config/dfx/identity/default/wallets.json as json
expected : at line 3 column 5

sorry it was this dfx identity --network deploy-wallet o3vsw-mqaaa-aaaan-qaa3a-cai

That’s pretty bad. Did you ever try to manually edit this file? Dfx should never leave this file in a broken state. Right now, I think you would have to go in and fix this file manually. It has the following structure:

{
  "identities": {
    "<identity name>": {
      "<network name>": "<wallet id>"
    }
  }
}

So for your case that would be

{
  "identities": {
    "default": {
      "ic": "o3vsw-mqaaa-aaaan-qaa3a-cai"
    }
  }
}
2 Likes

dfx identity --network ic deploy-wallet o3vsw-mqaaa-aaaan-qaa3a-cai
Creating a wallet canister on the ic network.
Error: Failed to create wallet for identity ‘default’ on network ‘ic’.
Caused by: Failed to create wallet for identity ‘default’ on network ‘ic’.
The wallet canister “o3vsw-mqaaa-aaaan-qaa3a-cai” already exists for user “default” on “ic” network.

Solved!! Thank you so much and everyone else who contributed!

1 Like