Symptoms
We are experiencing a periodic error in Production when the workflow attempts to Create a record in multiple different Smartbox SmartObjects:
"10:20:18","Debug","General","15","GeneralDebugMessage","ProcessInstance.HandleException","15 ServerEvent: Message: Unable to create the object. An object with the specified key property(s) already exist. ServiceName: SmartBoxService ServiceGuid: e5609413-d844-4325-98c3-db3cacbd406d InnerExceptionMessage: " The GUID corresponds to the Production andltserviceinstance name="SmartBoxService" guid="e5609413-d844-4325-98c3-db3cacbd406d"
This is affecting multiple processes causing them to go into an Error state.
Diagnoses
Customer utilized a SmartBox SmartObject in a workflow to keep track of what was done for each process and activity during that process.
We had 3 keys on this smartbox that were all set as unique, ApproverID, ProcID, and Activity Step. When we reached the activity it would run a create method on this smartobject in the workflow activity with the above keys and other information.
There was a chance during the reassignment of a task at the IT Task activity that the create method on this smartbox would be run and duplicate an earlier smartbox entry for the same activity. If this happened we would get the "Unable to create the object. An object with the specified key property(s) already exist." error.
When viewing the SmartBox SmartObject we saw that the 3 keys ApproverID, ProcID, and Activity Step were set to unique. Meaning that if all 3 of these are duplicated in some way then we will get the error.
Resolution
In order to avoid this duplicate key error we can either redesign how our Keys are utilized on the smartbox and make sure they aren't all set to unique.
The other option is that for the reassignment route we make sure that we go to a new activity and THEN run the SmartBox Create method. This will cause Activity Step to be different and the workflow will not error out because our smartbox will not have a duplicate set of keys. Customer implemented different design based on information provided above and then tested.
It was updated/deployed into production and they did not see this issue any longer.