JAVA gRPC request error to DAML Hub

I have the IOU sample app deployed to DAML Hub and am trying to use the Java app to interact with it. I am getting a error of “io.grpc.StatusRuntimeException: PERMISSION_DENIED: An error occurred. Please contact the operator and inquire about the request ” when it tries to make this request

.getActiveContracts(iouFilter, true)
response → {
.ifPresent(offset → acsOffset.set(new LedgerOffset.Absolute(offset)));
contract → {
long id = idCounter.getAndIncrement();

I am connecting as is suggested in another post and it is connecting fine -

DamlLedgerClient client =
DamlLedgerClient.newBuilder(ledgerhost, ledgerport)
// use the roots of trust already present on the system,
// ledgers running on * domains use certs
// provided by Let’s Encrypt
// on Daml Hub, you will still need an access token;
// it can be supplied here or per operation

My thought is maybe I need to pass the access token on the request as well? I am not finding in the documentation how to try that though.

Hi @RyanMedlen,

I just tested using the Iou sample app on Daml hub using your modifications and it works fine for me.

What I suspect is happening is that you are running as party Alice which is the default in the sample app. Daml hub on the other hand allocates different party identifiers so your token is for a different party than Alice and your request fails.

To fix that you can edit the party in pom.xml or pass it directly on the command line, e.g.

mvn compile exec:java@run-quickstart -Dparty=ledger-party-youruuidhere

You can find your actual party id in the Daml hub console where you also got your access token.


That was exactly it. Thanks for the help.