Skip to content
CCPEDIAby Unity Nodes
App Development

Daml Hub service account errors

4 posts342 views1 likesLast activity Jan 2023

  1. gyorgybalazsiOP

    I’m trying to use Daml Hub service account login to retrieve access tokens so that I don’t have to refresh the token in every 24 hours.

    I’m using the requests Python library and implemented this try/except expression because the service account endpoint call fails with 502 error in the majority of cases (not always):

    SA_LOGIN = f"https://{HUB_LEDGER_ID}.daml.app:443/.hub/v1/sa/login"
    response = requests.post(SA_LOGIN, auth=('cred-XXXXXXXXXXXXXX', 'XXXXXXXXXXXXXX'))
    try:
      EVERLY_TOKEN = response.json()['token']
      print("Service account token exchange successful")
    except:
        print("Service account token exchange didn't succeed, fetch token manually")
        EVERLY_TOKEN = input("Insert Everly token ")
    

    Am I doing something wrong?

  2. gyorgybalazsi

    Anyway, it works good enough so I close this question.

  3. Daniel_Porter 1

    Hey Gyorgy,

    Sorry for the lack of response here - this one got lost in the holiday shuffle.

    Intermittent 502 errors seem bad and wrong; I’m going to look into this and get back to you.

  4. gyorgybalazsi

    I’ve implemented a retry mechanism and currently testing how reliable it gets in this way.