Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/07/2023 02:23 PM - edited 09/07/2023 04:41 PM
Hi,
We are unable to import the accounts from GitHub. We are getting the below error:
Failed to execute following statement in processAccountsFullBySequentialAndIterative:persistAccounts : Insert into accounts set ENDPOINTKEY = 77, SYSTEMID = 69, ORPHAN=0, JOBID = 1049442, status = '1', accountID = null, name = null on duplicate key update STATUS = '1', JOBID = 1049442\n","stream":"stdout","time":"2023-09-07T21:12:44.938283094Z"}
It seems the values are coming as null from the API.
Below is the Import JSON we are using:
{
"accountParams": {
"connection": "acctAuth",
"createUsers": false,
"adminName": "admin",
"processingType": "SequentialAndIterative",
"call": {
"call1": {
"callOrder": 0,
"stageNumber": 0,
"http": {
"url": "https://api.github.com/orgs/<org name>/members?per_page=1&page=1",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/x-www-form-urlencoded",
"httpMethod": "GET"
},
"listField": "",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "node_id~#~char",
"name": "login~#~char",
"displayName": "login~#~char"
},
"makeProcessingStatus": true,
"disableDeletedAccounts": true
},
"call2": {
"callOrder": 1,
"stageNumber": 1,
"http": {
"url": "https://api.github.com/graphql",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "POST",
"httpParams": "{\"query\":\"{organization(login:\"<org name>\"){samlIdentityProvider{externalIdentities(first: 100, login:\"A20681\"){edges{node{user{id login name email}samlIdentity{nameId username} }}}}}}\"}"
},
"listField": "",
"keyField": "accountID",
"colsToPropsMap": {
"accountID": "data.organization.samlIdentityProvider.externalIdentities.edges[0].node.user.id~#~char",
"name": "data.organization.samlIdentityProvider.externalIdentities.edges[0].node.user.login~#~char"
},
"multiTrigger": {
"multiTriggerType": "MultiTriggerByAccountBatching",
"triggersCount": "20",
"params": {
"accountsoraccess": "accounts"
}
}
}
}
},
"entitlementParams": {},
"acctEntParams": {}
}
I even tried hardcoding the username in the httpParams of call2. It still is not working.
I am able to call the same API from Postman and getting the response properly.
Here is the API used in call2:
https://api.github.com/graphql
And the body is a JSON:
Not sure what's wrong in the above JSON. Most probably the 'httpParams' has an issue. Have I passed the httpParams correctly in the import JSON?.
UPDATE: I am able to import a single account now by hardcoding the account name. The issue was with the httpParams. However, we want the value of accountName to be dynamically populated.
For each account in call1, call2 is being called. And in call2 --> httpParams, we need to fetch the accountName from call1.
How can we achieve this?. I tried adding dependentCall: true and nextApiKeyField but it isn't working.
Thanks,
Atul Singh
[This post has been edited by a Moderator to remove sensitive information.]
09/12/2023 12:25 PM
Hi @AS5278
Thanks for reaching out. Can you please add the below in the ConfigJSON and validate if the HTTP params are resolving
{"showLogs": true}