`daml sandbox --dar <dar-to-be-uploaded>` error

I often have an error when I try to start Sandbox with specifying the DAR(s) to be uploaded.:

An exception was thrown during the upload-dar command
- GRPCIOBadStatusCode StatusDeadlineExceeded (StatusDetails {unStatusDetails = "Deadline Exceeded"})
One reason for this to occur is if the size of DAR file being uploaded exceeds the gRPC maximum message size. The default value for this is 4Mb, but it may be increased when the ledger is (re)started. Please check with your ledger operator.

The DAR size is under the specified limit.

Then after several attempts I succeed.

Does it make any difference if I first start Sandbox, wait for the creation of the port file, and issue the DAR upload command separately?

And in general: does anyone have any idea why this error happens?

The timeout in the daml assistant is definitively too short for uploading consistently big dars. I pushed a change to extend it toward a more reasonable value.

The assistant is actually waiting for the port file before uploading the dar, however the sandbox is probably still busy to process the upload fast enough. Waiting a bit after the port file is created seems to help.

1 Like

Yes, thank you, this will probably help in many cases. In my code I have separated the steps, so I start Sandbox waiting for the port file, and then start uploading the dars with the daml ledger upload-dar etc command.