Canister have enough cycle, can be called directly, but returns error out of cycle when the funtions is being called from another canister

Hi

We have a condition where a canister have enough cycle balance, and it can be accessed directly from canister dashboards out there, or by dfx terminal.

but when it’s function is being called by another canister via motoko inter-canister call, it returns error of out of cycle.
it just happened today, the mechanism works fine yesterday, also the inter-canister calls.
we have tried to :

  1. top up the canister being accessed, also upgrade it.
  2. upgrade the canister calling the said canister
    But still, error out of cycle.

Can i please get more info on how to deal with this condition?

Error: Call was rejected: Request ID: 9f7e5c415ef893ebdfe273cdb25b8e95e09dd6a6945818d6df9aa35bf9ff9f3f Reject code: 5 Reject text: Error from Canister 5gwe4-6aaaa-aaaam-adi3q-cai: Canister 5gwe4-6aaaa-aaaam-adi3q-cai is out of cycle

edit
this is an ICRC1 canister

  1. query functions work fine, e.g can fetch “fee” without problem
  2. but shared functions throws out of cycle error. “icrc1_transfer” throws error out of cycle

edit 2 [SOLVED] but brings another question

-tried top up again and success
-but somehow the cycle balance is much lesser than what we topped up.
is there any process behind this? before it was 9 trillion cycles, then topped up another 5++ trillion. After, it shows 5 trillion instead of 14-15 trillion

thanks

This sounds very weird. Are you using the default ICRC ledger or did you write something custom? If you have a lot of canister calls outstanding that can make the balance seem too low because cycles are withdrawn from the canister to prepay for response processing.

Otherwise I don’t have many ideas. Maybe some simple mistake: Are you topping up the right canister? And are you reading the right canister’s balance? Are the two commands on the same network (mainnet vs local)?

1 Like