PartyManagement service returning INTERNAL error while allocating parties with large number of characters

Hi,

I am testing PartyManagementService on daml sandbox 2.2.1. While trying to allocate party with larger number of characters, the sandbox is returning INTERNAL error while it is expected to return INVALID_ARGUMENT.

Error:

INTERNAL: An error occurred. Please contact the operator and inquire about the request

In the sandbox logs:

LEDGER_API_INTERNAL_ERROR(4,0): Unexpected or unknown exception occurred., context: {err-context: “{location=ErrorInterceptor.scala:66}”}

Any suggestions? Thank you!

This should probably not be returned as an unexpected error, but please note that party identifiers are limited to 256 characters as documented here on the Ledger API reference. Note that Canton appends two colons followed by the hexadecimal representation of the public key of the participant where the party is allocated (which amounts to 70 characters, leaving 186 for the hint). As mentioned, this is not the kind of error you should be seeing, but this could be the source of your problem.

What is the length of the party ID hint you are providing? In principle, the current behavior is not strictly guaranteed, in the sense that the Ledger API server is free to disregard the party ID hint entirely, so users are generally advised to treat party IDs as opaque references.

Hi @stefanobaghino-da,

Actually, I am purposely trying to fail Party allocation to test the error codes and while testing it I got INTERNAL error instead on INVALID_ARGUMENT.

The Party ID hint has 187 character and after canton PartyId suffix it comes to be 257 where I am expecting the INVALID_ARGUMENT error due to the larger number of characters.