Dfx deploy by proposal error

Hi,
I’m trying to deploy via proposal but i’m getting this error :

Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to prepare assets for commit.
    Failed to store assets in canister 'gld_dashboard'.
      Failed asset sync with canister rbsh4-yyaaa-aaaal-qdigq-cai.
        Failed to create batch: The replica returned a rejection error: reject code CanisterError, reject message Error from Canister rbsh4-yyaaa-aaaal-qdigq-cai: Canister called `ic0.trap` with message: Batch 5 is already proposed.  Delete or execute it to propose another..
Consider gracefully handling failures from this canister or altering the canister to handle exceptions. See documentation: http://internetcomputer.org/docs/current/references/execution-errors#trapped-explicitly, error code None

It was working correctly in the past, but for some reason one of our jobs had an error :

 Failed to list assets: The replica returned an HTTP Error: Http Error: status 429 Too Many Requests, content type "text/plain; charset=utf-8", content: load_shed: Overloaded

And when i tried to restart the job, he is continously failing saying that the batch is already proposed. How can i reset/delete the pending batch and create a new one ?

THanks !
Gautier

Do this with a principal that has Prepare permissions (the same that you use to do dfx deploy --by-proposal with will work as that requires the same permissions):

dfx canister call <canister> delete_batch '(record { batch_id = 5 : nat })'

Canister interface: sdk/src/distributed/assetstorage.did at master · dfinity/sdk · GitHub

Thanks you Severin. It worked. Please note you have a small typo error in your msg, it’s delete_batch and not delete_Batch (in case someone just copy/pasta your msg)
Thanks again !

1 Like