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

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.

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.