Accounts cannot be removed while background tasks are being processed

I’m trying to remove an account from an identity because it correlated incorrectly, but I cannot seem to do so because of this error “Accounts cannot be removed while background tasks are being processed”

image

After that, it just kicks me back to the identity search page

Any thoughts? There doesn’t seem to be much going on here

Hello @mcheek , you may find below post useful (clear long running background tasks in IDN):

Apart from that, even I am not sure if there’s any other way to go around this.

Yes, I see 3 pending tasks, but it doesn’t seem to want to let me update them

{
    "errorName": "IllegalArgumentException",
    "errorMessage": "Cannot deserialize value of type `java.util.ArrayList<com.github.fge.jsonpatch.JsonPatchOperation>` from Object value (token `JsonToken.FIELD_NAME`)\n at [Source: (io.undertow.servlet.spec.ServletInputStreamImpl); line: 2, column: 5]",
    "trackingId": "b75da64cd73246a0829917edd325c3eb"
}

@mcheek,

This code can be cleaned up a bit, but I think this will get you what you need:

Solution

If the job has a start date that is older than expected, follow the steps below.

  1. First we need to find the ID of the pending task.
GET https://{org}.api.identitynow.com/cc/api/org/getPendingIdentityTasks

This should show the aggregation that is currently running.

  1. In the response find the id of the task that’s stuck then run the following API call to set the task’s completionStatus value to error.
PATCH https://{org}.api.identitynow.com/beta/task-status/{id}

In your headers include:

Key: Content-Type Value: application/json-patch+json

For your body include:

[
 {
 "op": "replace",

"path": "/completionStatus",

"value": "Success"
 }
]

Example response once committed → “completionStatus”: “Success”

  1. Next we need to set the completed value to a date in the past to mark the task completed.
PATCH https://{org}.api.identitynow.com/beta/task-status/{id}

In your headers include:

Key: Content-Type Value: application/json-patch+json

For your body include:

[

{

"op": "replace",

"path": "/completed",

"value": "2021-05-07T18:14:16.043Z"

}

]

Example response once committed → “completed”: “2021-05-07T18:14:16.043Z”

  1. By now if you make a call to GET https://{org}.api.identitynow.com/cc/api/org/getPendingIdentityTasks you should no longer find the pending task in the list. If you don’t find the task confirm in the UI that you no longer see the Blue bar displaying Identity data is updating. If not you should be good to resume normal operations.

Yeah, that makes sense… the API spec seems to be incorrect. FYI @colin_mckibben or @tyler_mairose the spec for update-task-status suggests that you need to have an “operations” object like below, but that seems to throw a 400. @Justin’s suggested fix worked.

{
  "operations": [
    {
      "op": "remove",
      "path": "<string>",
      "value": "<string>"
    },
    {
      "op": "copy",
      "path": "<string>",
      "value": "<string>"
    }
  ]
}

Thanks for letting us know. I created a ticket (DEVREL-1380) to fix the spec.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.