I have Cycles.add not working

I am developing a new NoSQL database NacDB for IC.

At NacDB/main.mo at main · vporton/NacDB · GitHub I add 300M cycles to created canisters.

Nevertheless, browser JavaScript executing the relevant frontend code claims that I added 0 cycles:

Uncaught (in promise) Error: Call was rejected:
  Request ID: 1136fd3d2682e6ecc2c48fce76475970cdba83c6fc75e666dbcadbdafb10329d
  Reject code: 4
  Reject text: Creating a canister requires a fee of 7_692_307_692 that is deducted from the canister's initial balance but only 0 cycles were received with the create_canister request.

    at pollForResponse (index.js:2042:19)
    at async caller (index.js:210:35)
    at async HTMLFormElement.<anonymous> (index.js:17744:20)
1 Like

Hi there,

I want to be helpful and ill pass these to the right team.

In the meantime:

just to be clear:

a. The message says 7.692 billion cycles are required
b. The message also says “only 0 cycles were received”

Are you saying a) does not work. Have you tried adding more cycles? (maybe the error message is wrong so 300MM cycles were added but it was not enough).

I want to understand if the method does not work or if the error message is misleading (which itself is a bug of course)

First, I added 300 billions, not 300 millions cycles, see the source not the question for the correct amount.

It apparently does not work. 300 billions should be enough, but it does not work.

1 Like

Makes sense. Thank you

(Fwiw I still passed tis to the engineering team closest to this)

I think this should work, but also noticed that your dfx.json only declares 1B cycles for the index canister. I didn’t know you could do this with dfx.json, but perhaps that is the source of the problem?

I noticed that your implementation of ‘greet’ calls ‘Index.Index()’ but without adding any cycles. Could that be the actual source of failure?

Yes, after fixing this my software seems started to work.

1 Like

Awesome. thats great to hear.