I already have a canister I created using the nns.ic0.app website.
So, I used the command:
dfx canister start --network=ic [canister-id]
I had to enter my passphrase and then it responded:
Decryption complete.
Starting code for canister [canister_ID], with canister_id [canister_ID]
Error: Failed to start canister [canister_ID].
Caused by: Failed to start canister [canister_ID].
Failed to call update function 'start_canister' regarding canister 'canister_ID'.
Update call (without wallet) failed.
The replica returned a replica error: reject code CanisterError, reject message Only controllers of canister canister_ID can call ic00 method start_canister, error code Some("IC0512")
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 info (--network ic)' command.
To figure out which principal is calling the management function, look at the command you entered:
If you used '--wallet <wallet id>', then the wallet's principal (the '<wallet id>') 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 update-settings --add-controller <controller principal to add> <canister id/name or --all> (--network ic)'.
If your wallet is a controller, but not your own principal, then you have to make your wallet perform the call by adding '--wallet <your wallet id>' to the command.
The most common way this error is solved is by running 'dfx canister update-settings --network ic --wallet "$(dfx identity get-wallet)" --all --add-controller "$(dfx identity get-principal)"'.
So, I fixed that by adding my principal id on my computer to the controller using the web interface on nns.ic0.app.
Then, I issued the command again:
dfx canister start --network=ic [canister-id]
I had to enter my passphrase. And it responded:
Decryption complete.
Starting code for canister [canister_ID, with canister_id [canister_ID]
Then, I issued the command:
dfx build
I had to enter my passphrase for my identity.
Response:
Decryption complete.
Error: Cannot find canister id. Please issue ‘dfx canister create [canister name]’
This is where I feel the main issue is. I already created a canister using the web on nns.ic0.app. I already funded it with 10T cycles.
So, I shouldn’t have to create a canister. I just want to work with that canister I already created and upload the files I have on my computer.
Anyways, instead of issuing that command, I issued:
dfx deploy --network=ic
I assume it’s going to deploy to the canister I explicitly named in the dfx start command at the beginning.
It asked for my passphrase for my identity. I entered it and it responded:
Deploying all canisters.
Creating canisters…
Creating canister [canister name]…
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to register all canisters.
Failed to create canister ‘[canister name]’.
In order to create a canister on this network, you must use a wallet in order to allocate cycles to the new canister. To do this, remove the --no-wallet argument and try again. It is also possible to create a canister on this network using dfx ledger create-canister
, but doing so will not associate the created canister with any of the canisters in your project.
This is my frustration as I don’t want to create a canister as I mentioned before. I just want to upload my compiled files to the existing canister to create a simple one page website.
I stopped here and I’ll update this when I get back to this.