Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Daml Hub service account errorsForum ↗

Daml Hub service account errors

App Development4 posts302 views1 likesLast activity Jan 2023
GY
gyorgybalazsiOP
Dec 2022

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?

GY
gyorgybalazsi
Jan 2023

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

DA
Daniel_Porter
Jan 2023

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.

GY
gyorgybalazsi
Jan 2023

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

← Back to Discussions