Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Sav4Sav Userimport from Account API getting stuck

ashutoshkumar16
New Contributor II
New Contributor II

Hi,

we have configured Sav4Sav Rest Multi call User Import. when we execute it runs for hours and did not even get completed, I had to restart the system to stop the job. I see it has updated the customporpert32 in user attribute but job is getting stuck and not letting any other job to execute 

Below is the user Import JSON

{
"type": "multiCall",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://XXXXX/ECM/api/v5/getAccounts",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}",
"contentType": "application/json"
},
"httpParams": "{\"endpoint\" :\"ServiceNow\",\"advsearchcriteria\": {\"status\": \"INACTIVE\"}}",
"httpContentType": "application/json",
"colsToPropsMap": {
"username": "username~#~char",
"customproperty32": "accountID~#~char"
},
"userResponsePath": "Accountdetails",
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 500,
"totalCountPath": "completeResponseMap.total"
}}},{
"name": "call2",
"connection": "acctAuth",
"url": "https://XXXXX/ECM/api/v5/getAccounts",
"httpMethod": "POST",
"httpHeaders": {
"Authorization": "${access_token}",
"contentType": "application/json"
},
"httpParams": "{\"endpoint\" :\"ServiceNow\",\"advsearchcriteria\": {\"status\": \"ACTIVE\"}}",
"httpContentType": "application/json",
"colsToPropsMap": {
"username": "username~#~char",
"customproperty32": "accountID~#~char"
},
"userResponsePath": "Accountdetails",
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 500,
"totalCountPath": "completeResponseMap.total"
}}}]}

I am gettng below error in the logs,

 
2023-11-06T20:15:18+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-DEBUG-maxRefreshTryCount : 2
 
2023-11-06T20:15:18+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-ERROR-Exception in token refresh : null
 
2023-11-06T20:15:18+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-ERROR-Error WebService call failed After retrying 2 times with responseStatusCode-null, Failed url-https://XXXXXX/ECM/api/v5/getAccounts?offset=0&max=500, Error Message - null
 
2023-11-06T20:15:18+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-DEBUG-Decrementing connectionParamMap.refreshTryCount : 2
 
2023-11-06T20:15:18+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-DEBUG-Decrementing connectionParamMap.refreshTryCount : 1
 
2023-11-06T20:15:18+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-3-DEBUG-Decrementing connectionParamMap.refreshTryCount : 0
8 REPLIES 8

SB
Saviynt Employee
Saviynt Employee

Based on the above error, it appears to be an issue with the Connection JSON. Attached is a working format of Connection JSON for SAV connection. Can you compare your with this and try.


Regards,
Sahil

jralexander137
New Contributor III
New Contributor III

Do you have some sample 'working' importUserJson for sav4sav?

{
   "accountParams":{
      "connection":"userAuth",
      "processingType":"SequentialAndIterative",
      "call":{
         "call1":{
            "callOrder":0,
            "stageNumber":0,
            "http":{
               "url":"https://<EIC_URL>.saviyntcloud.com/ECM/api/v5/getUser",
               "httpHeaders":{
                  "Authorization":"${access_token}"
               },
               "httpContentType":"application/json",
               "httpMethod":"POST",
               "httpParams":"{\"userQuery\":\"user.username is not null\"}"
            },
            "listField":"userdetails",
            "keyField":"accountID",
            "colsToPropsMap":{
               "accountID":"username~#~char",
               "name":"username~#~char",
               "displayName":"username~#~char",
               "customproperty31":"STORE#ACC#ENT#MAPPINGINFO~#~char"
            }
         }
      }
   },
   "entitlementParams":{
      "connection":"userAuth",
      "processingType":"SequentialAndIterative",
      "entTypes":{
         "SAVRole":{
            "entTypeOrder":1,
            "call":{
               "call1":{
                  "callOrder":0,
                  "listField":"result",
                  "keyField":"entitlement_value",
                  "http":{
                     "url":"https://<EIC_URL>.saviyntcloud.com/ECM/api/v5/fetchControlDetailsES?analyticsid=1470",
                     "httpMethod":"GET",
                     "httpContentType":"application/json",
                     "httpHeaders":{
                        "Authorization":"${access_token}"
                     },
                     "httpParams":"{\"offset\":\"0\"}"
                  },
                  "colsToPropsMap":{
                     "displayname":"ROLENAME~#~char",
                     "entitlementID":"ROLEKEY~#~char",
                     "description":"ROLEDESCRIPTION~#~char",
                     "entitlement_value":"ROLENAME~#~char"
                  }
               }
            }
         }
      }
   },
   "acctEntParams":{
      "connection": "userAuth",
      "entTypes": {
         "SAVRole": {
            "call":{
               "call1":{
                  "callOrder":0,
                  "stageNumber":0,
                  "processingType": "httpEntToAcct",
                  "http":{
                     "url":"https://<EIC_URL>.saviyntcloud.com/ECM/api/v5/fetchControlDetailsES?analyticsid=1471",
                     "httpMethod":"GET",
                     "httpContentType":"application/json",
                     "httpHeaders":{
                        "Authorization":"${access_token}"
                     },
                     "httpParams":"{\"filtercriteria\":{\"rolekey\":[\"${id}\"]}}"
                  },
                  "listField":"result",
                  "entKeyField": "entitlementID",
                  "acctIdPath": "username",
                  "acctKeyField": "accountID"
               }
            }
         }
      }
   }
}

 

Documentation : https://docs.saviyntcloud.com/bundle/Saviynt-REST-based-Guide/page/Content/Understanding-Integration... 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

rushikeshvartak
All-Star
All-Star

Can you try below connection json

{
	"authentications": {
		"userAuth": {
			"authType": "oauth2",
			"url": "https://saviyntcloud.com/ECM/api/login",
			"httpMethod": "POST",
			"httpParams": "{\"username\":\"admin\",\"password\":\"Admin@123\"}",
			"httpHeaders": {
				"contentType": "application/json"
			},
			"httpContentType": "application/json",
			"expiryError": "ExpiredAuthenticationToken",
			"authError": [
				"InvalidAuthenticationToken",
				"AuthenticationFailed",
				"FAILURE",
				"INVALID_SESSION_ID"
			],
			"timeOutError": "Read timed out",
			"errorPath": "code",
			"maxRefreshTryCount": 5,
			"tokenResponsePath": "access_token",
			"tokenType": "Bearer",
			"accessToken": "Bearer abcde",
			"retryFailureStatusCode": [
				401,
				404,
				403,
				500
			],
			"testConnectionParams": {
				"http": {
					"url": "https://saviyntcloud.com/ECM/api/user?q=accountExpired:0&fields=firstname,lastname,username&sort=username&order=desc&offset=2&max=2",
					"httpContentType": "application/json",
					"httpHeaders": {
						"Authorization": "${access_token}"
					},
					"httpMethod": "GET"
				},
				"successResponse": [
					"200",
					"Successful"
				],
				"successResponsePath": "msg",
				"errors": [
					"fail",
					"error",
					"invalid_token"
				],
				"errorPath": "responseText"
			}
		}
	}
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

@rushikeshvartak @SB , I have tried both the connection, it still getting stuck.

It seems to me that there is no issue with the connection, as I can see the user attributes are getting updated as per the mapping and at the begining I can see in the logs that its is getting the response but after some time I see the error in the logs.

can u share logs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

SB
Saviynt Employee
Saviynt Employee

Can you attach the Job log from the job start time until the point you start to see the error.


Regards,
Sahil

ashutoshkumar16
New Contributor II
New Contributor II

@rushikeshvartak @SB 

PFA Logs.

As I can see the logs, Captured in Exported logs , if you look from the below in the first call of multicall, I am fetching servicenow account with inactive stauts, pagination offset goes till 8500 and then it calls the second API call where we are fetching service now accout with Active Status and offset goes till 5500 and offset starts from 0 again and it keeps on repeating the same.

Seems like 2 API calls is going in loop.