Not able to update an already deployed canister to the network

I have problems deploying. It’s a canister that is already running but i’m unable to update as deploying keeps failing. Seems to be a wallet issue and I’m unsure which wallet nor which principal i used to deploy that canister. My question is how do i check which principal id is running with a wallet. Everyone I’ve tried seem to have no wallet. I’ve switched identities but all seem to have no wallet. But the site is running. I’m stuck abit . Any help will be appreciated.

dfx deploy --network ic
Please enter a passphrase for your identity: [hidden]
Decryption complete.
Error: Failed to get wallet canister caller for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
Caused by: Failed to get wallet canister caller for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
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 ’.

use : dfx deploy --network ic --no-wallet canister_name

Thanks for your response. By canister name do you mean the ID?

you can check your canister name, from dfx.json or canister_ids.json file in root.

This is what i got:
dfx deploy --network ic --no-wallet pw3wy-dyaaa-aaaan-qaa4q-cai
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed to collect canisters and their dependencies.
Failed to get canisters with their dependencies (for pw3wy-dyaaa-aaaan-qaa4q-cai).
Failed to add dependencies for canister ‘pw3wy-dyaaa-aaaan-qaa4q-cai’.
Cannot find canister ‘pw3wy-dyaaa-aaaan-qaa4q-cai’.

check your dfx.json file and canister_ids.json file. Can you share me your folder structure?
You can come on PM.

try this dfx identity get-principal to get your principal and check it maches the controller of the deployed canister. to check run dfx canister --network ic status --all in the your project.
it they match check if the caniser has a wallet by dfx identity --network ic get-wallet
you should het the wallet for your live project. if not you might have to make and deploy it.

Thank you. This is what i get when i run the second command: I followed all instructions in the error message but nothing works:
dfx canister --network ic status --all
Error: Failed to get canister status for ‘website’.
Caused by: Failed to get canister status for ‘website’.
Failed to get canister status of pw3wy-dyaaa-aaaan-qaa4q-cai.
Failed to call update function ‘canister_status’ regarding canister ‘pw3wy-dyaaa-aaaan-qaa4q-cai’.
Update call (without wallet) failed.
The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type “application/cbor”, content: Only controllers of canister pw3wy-dyaaa-aaaan-qaa4q-cai can call ic00 method canister_status
Error explanation:
Each canister has a set of controllers. Only those controllers have access to the canister’s management functions (like install_code or stop_canister).
The principal you are using to call a management function is not part of the controllers.
How to resolve the error:
To make the management function call succeed, you have to make sure the principal that calls the function is a controller.
To see the current controllers of a canister, use the ‘dfx canister (–network ic) info’ command.
To figure out which principal is calling the management function, look at the command you entered:
If you used ‘–wallet ’, then the wallet’s principal (the ‘’) is calling the function.
If you used ‘–no-wallet’ or none of the flags, then your own principal is calling the function. You can see your own principal by running ‘dfx identity get-principal’.
To add a principal to the list of controllers, one of the existing controllers has to add the new principal. The base command to do this is ‘dfx canister (–network ic) update-settings --add-controller <canister id/name or --all>’.
If your wallet is a controller, but not your own principal, then you have to make your wallet perform the call by adding ‘–wallet ’ to the command (before the ‘update-settings’ subcommand).

it seems your principal isnt a controller, i checked it for you by running dfx canister --network ic info pw3wy-dyaaa-aaaan-qaa4q-cai Controllers: o3vsw-mqaaa-aaaan-qaa3a-cai Module hash: 0xe0df779f65fe44893d8991bef0f9af442bff019b79ec756eface2b58beec236f. which i believe is your wallet.you able to log in to it you can check by putting your wallet address followed by ic0.app o3vsw-mqaaa-aaaan-qaa3a-cai.ic0.app
i did this for the wallet above. and by running and it seems to be already deployed since it asked me authenticate. then by running dfx canister --network ic info o3vsw-mqaaa-aaaan-qaa3a-cai Controllers: hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe Module hash: 0x9183a38dd2eb1a4295f360990f87e67aa006f225910ab14880748e091248e086
i got to know the controller of the wallet which is

you.

its a simple fix just use your wallet to add your principal as a controller.

you can add your principal as a controller by running dfx wallet --network ic add-controller <your principal>

you get your principal by dfx identity get-principal.

this should fix your issues

[quote=“valiantlynx, post:10, topic:15703”]
dfx wallet --network ic add-controller
[/qu
Thank you for all the details. It still didnt work. Not really sure whats wrong.

dfx wallet --network ic add-controller bve5y-t2wk7-i2k65-5syel-gq5r6-iuolu-awwyd-t6ekq-kyjwn-g5u6q-vqe
Please enter a passphrase for your identity: [hidden]
Decryption complete.
Error: Failed to call update function ‘add_controller’ on wallet.
Caused by: Failed to call update function ‘add_controller’ on wallet.
Failed to setup wallet caller.
Failed to get wallet canister caller for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
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 ’.

I also tried to deploy the wallet again and here is what i got:
dfx identity --network ic deploy-wallet o3vsw-mqaaa-aaaan-qaa3a-cai
Please enter a passphrase for your identity: [hidden]
Decryption complete.
Creating a wallet canister on the ic network.
Error: Failed to create wallet for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
Caused by: Failed to create wallet for identity ‘hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe’ on network ‘ic’.
Failed while installing wasm.
The replica returned an HTTP Error: Http Error: status 403 Forbidden, content type “application/cbor”, content: Only controllers of canister o3vsw-mqaaa-aaaan-qaa3a-cai can call ic00 method install_code
Error explanation:
Each canister has a set of controllers. Only those controllers have access to the canister’s management functions (like install_code or stop_canister).
The principal you are using to call a management function is not part of the controllers.
How to resolve the error:
To make the management function call succeed, you have to make sure the principal that calls the function is a controller.
To see the current controllers of a canister, use the ‘dfx canister (–network ic) info’ command.
To figure out which principal is calling the management function, look at the command you entered:
If you used ‘–wallet ’, then the wallet’s principal (the ‘’) is calling the function.
If you used ‘–no-wallet’ or none of the flags, then your own principal is calling the function. You can see your own principal by running ‘dfx identity get-principal’.
To add a principal to the list of controllers, one of the existing controllers has to add the new principal. The base command to do this is ‘dfx canister (–network ic) update-settings --add-controller <canister id/name or --all>’.
If your wallet is a controller, but not your own principal, then you have to make your wallet perform the call by adding ‘–wallet ’ to the command (before the ‘update-settings’ subcommand).

The most common way this error is solved is by running ‘dfx canister --network ic --wallet “$(dfx identity get-wallet)” update-settings --all --add-controller “$(dfx identity get-principal)”’.

this is wrong. from your ealier post it looks that the principal running the project is

this one.
To make sure run dfx identity get-principal in your project then use that for dfx wallet --network ic add-controller hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe

after this deploying should work.

Its weird but i ran and keep getting alternating principals. one this bve5y-t2wk7-i2k65-5syel-gq5r6-iuolu-awwyd-t6ekq-kyjwn-g5u6q-vqe and the one one hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe I have tried running both and keep getting same message. Not sure if all these has anything to do with the dfx upgrade. All was good before.

When i run dfx identity get-principal, this is what i get bve5y-t2wk7-i2k65-5syel-gq5r6-iuolu-awwyd-t6ekq-kyjwn-g5u6q-vqe and when i do dfx identity list, it doesnt appear on list.

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
free_will5@DESKTOP-NIBTLAT:~/web2$ dfx identity list
anonymous
default
hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe *
free_will5@DESKTOP-NIBTLAT:~/web2$

Careful, it looks like you are confusing identity name and its principal. dfx identity list shows the available identity names whereas dfx identity get-principal shows the currently selected identity’s principal. The error messages usually refer to the identity name, not the identity principal

as the error said the problem is your wallet is the controller use it to add your self as the controller.
this is the common way above.

dfx canister --network ic --wallet “$(dfx identity get-wallet)” update-settings --all --add-controller “$(dfx identity get-principal)”

dfx canister --network ic --wallet o3vsw-mqaaa-aaaan-qaa3a-cai update-settings --all --add-controller hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqePlease enter a passphrase for your identity: [hidden]
Decryption complete.
Error: Failed to get canister status of pw3wy-dyaaa-aaaan-qaa4q-cai.
Caused by: Failed to get canister status of pw3wy-dyaaa-aaaan-qaa4q-cai.
Failed to call update function ‘canister_status’ regarding canister ‘pw3wy-dyaaa-aaaan-qaa4q-cai’. Failed to construct wallet canister caller.
The Replica returned an error: code 4, message: “Only a controller or custodian can call this method.”

can u show me what these comands print out

 dfx identity --network ic get-wallet 

and

dfx identity --network ic get-principal

if for you they return

 o3vsw-mqaaa-aaaan-qaa3a-cai

and

hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe

then doing this should work

dfx wallet --network ic add-controller hmwcx-gwrbg-7rscj-aihzk-ddqua-426xw-rg62j-tfhse-rdxxu-32bef-bqe