Failed to create batch: The replica returned a replica error: reject code CanisterReject, reject message Caller does not have Prepare permission, error code None


Hello,

Releasing asset canister has stopped working suddenly, I tried to install last version of dfx but the error is still happening:
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
Failed while trying to install all canisters.
Failed to install wasm module to canister ‘www’.
Failed to store assets in canister ‘www’.
Failed asset sync with canister opydh-zaaaa-aaaag-qabca-cai.
Failed to create batch: The replica returned a replica error: reject code CanisterReject, reject message Caller does not have Prepare permission, error code None

Anyone has any idea how can I make it work?

Are you using a different identity than before? If you use a controlling identity to make this call for you, you’ll be able to upload:

dfx canister --network ic call <asset canister name/id> grant_permission '(record { to_principal = principal "<principal to authorize>"; permission = variant { Commit } })'

Side note: Commit includes Prepare permissions. See here if you want all the details

2 Likes

this fixed the issue, I used the same identity, the only difference was that I updated dfx just to be up to date, it’s very strange that I did hundreds of deployments without running this command. thank you very much for the response