Working with cycles in a work network

An error occurs in the working network:

dfx canister --network=ic --no-wallet call yfsj5-qaaaa-aaaah-aav2a-cai request_replace_value ‘(“fca545e2-0862-c188-8015-6275a0be6f8d”, “1”, “1”, “1”, “1”)’
The Replica returned an error: code 4, message: “Canister ohx7x-fiaaa-aaaah-aawbq-cai is out of cycles: requested 2000590000 cycles but the available balance is 598785060953 cycles and the freezing threshold 82855580000000 cycles”

I make financing for each call (I have several call stacks and on each of them)

Code snippet

ExperimentalCycles.add(sumOperation);
let accept = await u.deposit(); //deposit

the amount is also considerable

private let sumOperation = 400_000_000_000; //cycles

What is the reason for this behavior?

Thanks for asking, I am not sure.

Let me ping the SDK team.

Hi!
OK, can you write me what to provide you with?

1 Like

tbh, i am not sure yet. but as soon as I hear back, i definitely will!

Thanks. I have already redone it several times and uploaded it to the network, I’m not sure that the correct version with cycle financing is now. But if you need all the source code, feel free to demand. I’ll give it to you.

Fwiw, I am really sorry to hear about that. This sounds very frustrating, not the kind of experience we want from SDK.

I understand. Perhaps I was too hasty with the answer. Version 0.7.2 now I have done work on upgrading to 0.8.1 and this did not solve the problem. I will redo the funding code in cycles, most likely these are my mistakes. I will write in this thread if the problem remains.

The available balance is less than the freezing threshold. I think that means the canister is in a stopped state and won’t be taking any calls.

The freezing threshold for ohx7x-fiaaa-aaaah-aawbq-cai is unusually high, it’s 82T, which means that canister needs to have at least 82T cycles to take any calls. Is this intentionally?

Can you also paste the result for dfx canister --network ic ohx7x-fiaaa-aaaah-aawbq-cai status, and see the numbers matches the error message you get.

Thank you for your time Chenyan.

  • No it wasn’t intentional

the only parameter that could affect it is freezing_threshold = 15_770_000 (6 months) But that’s not the reason. Other canisters with the same parameter

If I understand you correctly. Any function call from this canister outputs the same error. This is the generated canister it has controllers. Here is the request - response


dfx canister --network=ic call aanaa-xaaaa-aaaah-aaeiq-cai wallet_call "(record { canister= principal \"ohx7x-fiaaa-aaaah-aawbq-cai\"; method_name= \"status\"; args= blob \"DIDL\01nh\01\00\00\"; cycles= (0:nat64); })"

(

variant {

3_456_837 = "An error happened during the call: 2: Canister ohx7x-fiaaa-aaaah-aawbq-cai is out of cycles: requested 2000590000 cycles but the available balance is 383807142953 cycles and the freezing threshold 82855580000000 cycles"

},

)

Did I compose the call correctly? I doubt it…

The 82T freezing threshold is certainly a problem. You can use dfx canister update-settings to update it.

If your wallet is one of the controllers of ohx7x-fiaaa-aaaah-aawbq-cai, you should be able to call dfx canister status directly, because the call is routed via your wallet. Otherwise, you need to ask the controller to make the call to “aaaaa-aa”.canister_status.

Hi, Chenyan
Your advice helped me solve the problem.

I have reduced the freezing threshold and computing resources consumed in the settings. I also raised the limit of the amount of storage in each canister. These actions have yielded results. Thanks.

1 Like

Hi, Safik
Do you mind explaining more about the reduce the amount? I tried to redeem the 20TC with a Twitter account, but I keep getting this error, not sure what to do? Thank you!

Is your principal (dfx identity get-principal) one of the controllers of the canister?

dfx canister --network ic info fg7gi-vyaaa-aaaal-qadca-cai 
Controllers: q7srv-57hq5-cmjza-l37an-ljxqv-5pefr-lhnxt-we3zr-4wf6r-prvhp-zae rcccp-jaaaa-aaaal-qaauq-cai sqqi5-5kexz-bqd3x-ufmlf-dfobm-4bp44-63tzg-jvrqe-3pz4a-q5edu-hqe
Module hash: 0x993aa144fc499bd7916097ee5a34d569c840b129bb0e0c105a7c0d69572890e1

Hi, Mr. Erics Wanson
when I put in the command you gave, I get the exactly same thing. And I am not sure that my principal is one of the controllers of the canister? I am sorry, I just followed the udemy course, they have it as Github to claim, but now is Twitter, so I am not sure how to claim, even though I follow the instruction on the web. what command do I need to check the controller? or do I need to write something in the vscode in order to make my principal as the controller? Thank you for your time.

That command will display your principal. Then, we’ll look to see if it is one of these, which are the controllers of your canister:

Controllers: q7srv-57hq5-cmjza-l37an-ljxqv-5pefr-lhnxt-we3zr-4wf6r-prvhp-zae rcccp-jaaaa-aaaal-qaauq-cai sqqi5-5kexz-bqd3x-ufmlf-dfobm-4bp44-63tzg-jvrqe-3pz4a-q5edu-hqe

Also, what are you trying to achieve? What instructions on twitter are you trying to follow?

It sounds like you are trying to follow some directions in order to redeem some cycles from someone else’s canister. That canister is out of cycles, or at least, doesn’t have 20T cycles to give.

I think @willyhuang18 is referring to the cycles faucet.

Hi, Mr. Erics Wanson
I did the get-principal command, but the ID display is not one of the Controllers you listed. I think after I connected with my Twitter, I am able to redeem it. And I think I got an error on the second step, where it said " dfx canister–network ic…" because the step asked me to copy the command in there, and I did so.
Yes, like Mr. Paul Young said, I was following the instruction on the Cycles Faucet | Internet Computer Developer Portal, it used to be Github, it is easier to redeem, but it change to Twitter, which is more complicated I think.
Thank you

Okay. In that case we wouldn’t expect your principal to be one of the controllers. It sounds like you were able to redeem the cycles you were hoping to. If you have more questions, please include a link to the instructions that you are trying to follow.