Thanks @marc0olo.
I was able to reproduce the issue by cloning the repo and running the script locally. After debugging, I managed to isolate the problem and find a solution.
The code fails when calling provisional_create_canister_with_cycles
if no canister ID is provided. This happens because the canisterId
parameter is mapped to the effectiveCanisterId
through the specified_id
and transform
function I mentionned earlier. That’s why providing one works, and leaving it empty does not.
If I supply a canister ID (for example, the one I use by default in Juno’s Docker setup), the script runs successfully and the canister is created.
const result = await this.management.provisionalCreateCanisterWithCycles({
amount: cyclesToUse,
canisterId: Principal.fromText('jx5yt-yyaaa-aaaal-abzbq-cai') // <----- 👀
});
Canister created successfully with provisional function!
Canister ID: jx5yt-yyaaa-aaaal-abzbq-cai
SUCCESS! Canister created successfully!
@Huygon764 can you give this a try specifying a canister ID?
@mraszyk @ilbert given the above, should we go ahead and implement the fix you suggested today or other ideas?