I am trying to upload a new DAR file via POST /v1/packages request, but I got a 400 response with the message DAR file is corrupted.
I am wondering this might be happening because I had previously updated a package before (and would like to upload a new version).
My questions then are:
why is this happening and how to solve it?
how to delete the previously uploaded package? (restarting the SQL driver did not work)
Your DAR works fine and I was able to upload it via postman by selecting a binary body. Try the following two steps:
Reproduce against daml sandbox instead of Daml on SQL.
If that still fails, try sending via curl instead of postman. This command should do the trick once you adjust host/ip & token. You need to run it from the directory in which you placed your DAR (or adjust the path to it)
If you want to reset completely, drop the database for Daml on SQL. That will also drop contracts parties and any other state though. There is no way to just drop packages.
I don’t think that’s your issue though. Previously uploaded packages should never result in this error.