Error running daml script on Hub

Hey there, I’m trying to run a start up script on Hub. I’ve created all the parties needed on Hub, downloaded the participants.json and ledger-parties.json according to https://hub.daml.com/docs/quickstart#ledger-initialization-with-daml-script. When I run the command

daml script --participant-config daml/participants.json --json-api --dar dist/marketplace-demo.dar --script-name Demo:runDemo --input-file daml/ledger-parties.json

it seems to work to a certain point - many contracts get created - then fails with this error

Exception in thread "main" com.daml.lf.engine.script.ScriptF$FailedCmd: Command submit failed: All parties must be on the same participant but parties were allocated as follows: List((ledger-party-06f2ee59-e6dd-4ef8-a0e6-e9819f890f0d,com.daml.lf.engine.script.ledgerinteraction.JsonLedgerClient@7a85c150), (ledger-party-e7384b29-a139-424e-903f-904388531185,com.daml.lf.engine.script.ledgerinteraction.JsonLedgerClient@c26edf1))

Seems like two parties are not on the same participant node and this is causing the error. How does one go about debugging or fixing this problem? I believe it’s failing on a submitMulti command that involves the two parties in the error message.

Hi @arya , where did you get that participants.json file? Is that one you downloaded from Hub? Could you share it (removing any of the secrets)?

The issue here is that you are trying to use submitMulti while only having two single party tokens so your participants.json file has them configured as two different participants with the same host & port but different token.
submitMulti is not just syntactic sugar, it really requires a multi-party token so you cannot use it without this. At this point, Daml hub does not issue such tokens so you cannot use it and you have to use a propose-accept style workflow to acquire authorization instead.