Dfx nns local proposal fail "but canister only has 100000000000000 cycles"

Seriously, I started doubting anyone is actually using dfx nns install to test proposals…

Anyway, so I “resolved” my previous issue about Neuron Fund (thread) by setting the participation to neuron fund to false in the SNS.yaml. However, now, when I submit a proposal, it fails because some canister hasn’t enough cycles.

2024-07-10 17:37:47.590163 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] Proposal 7 decided, thanks to majority. Tally at decision time: Tally { timestamp_seconds: 1720633067, yes: 20000446685, no: 0, total: 21558891241 }
2024-07-10 17:37:47.590163 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] Execution of proposal: 7 failed. Reason: GovernanceError { error_type: External, error_message: “Error in deploy_new_sns response: SnsWasmError { message: "Message execution requires at least 180000000000000 cycles, but canister only has 100000000000000 cycles." } refund result: Ok(\n (),\n)” } (Proposal title: Some(“NNS Proposal to create an SNS named ‘CYCLES-TRANSFER-STATION’”))

I’m not aware of any post-installation command that should be run after dfx nns install or are there some command documented somewhere? If not, how to solve the issue?

@Severin the root cause of this issue is the fact that dfx nns install spins the SNS-Wasm canister with too little cycles - i.e. it is not even deployed with enough cycles to pass one SNS proposal.

To solve the issue I ran following command in my terminal targetting that canister dfx canister deposit-cycles 50000000000000 qaa6y-5yaaa-aaaaa-aaafa-cai. However, that’s just enough cycles to pass a single SNS proposal and unfortunately, if I ran the command again, I get following issue:

❯ dfx canister deposit-cycles 50000000000000 qaa6y-5yaaa-aaaaa-aaafa-cai
Depositing 50000000000000 cycles onto qaa6y-5yaaa-aaaaa-aaafa-cai
Error: Failed to deposit 50000000000000 cycles into qaa6y-5yaaa-aaaaa-aaafa-cai.
Caused by: Failed to deposit 50000000000000 cycles into qaa6y-5yaaa-aaaaa-aaafa-cai.
Failed to call update function ‘deposit_cycles’ regarding canister ‘qaa6y-5yaaa-aaaaa-aaafa-cai’.
Update call using wallet failed.
The replica returned a rejection error: reject code CanisterError, reject message Canister > bnz7o-iuaaa-aaaaa-qaaaa-cai is out of cycles, error code None

Is there a command I can run to provide that canister enough cycles?

You can conjure a bunch of cycles like this:

dfx ledger fabricate-cycles --canister qaa6y-5yaaa-aaaaa-aaafa-cai --t 9999999999

CC @Andre-Popovitch: this looks like a feature request :slightly_smiling_face:

2 Likes

Thanks a lot Severin! I’ll try that later.

Your command goes maybe over the top? :wink:

I got this error with it:

2024-07-12 17:39:42.691709 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] Execution of proposal: 4 failed. Reason: GovernanceError { error_type: External, error_message: “Failed to send deploy_new_sns request to SNS_WASM canister: (Some(5), "IC0502: Canister qaa6y-5yaaa-aaaaa-aaafa-cai trapped: cycles amount exceeds 64-bit representation") refund result: Ok(\n (),\n)” }

Ah the command is in T Cycles :crazy_face:

dfx ledger fabricate-cycles --canister qaa6y-5yaaa-aaaaa-aaafa-cai --t 100

Thanks again, it worked out!

100 T Cycles seems to be just enough for one test, so I fabricated 100000 T Cycles. Let’s see if it least longer.