Here is a strange workflow issue I've recently encountered with SharePoint 2013 (Foundation or Server, with or without the latest March 2013 CU). The repro below is (obviously) not the original situation where I originally faced the issue, but a drastic simplification to make the error reproduction easy.
Here is the situation:
1. Content Type "Customer2" inherits from Item (without any additional site column)
2. Content Type "Customer" inherits from Item with an additional "Original Invoice No."site column.
3. The "Original Invoice No." column is required (has a max length of 7) and contains he following Column Validation (to enforce that its length be at least 6 characters and is a number):
=AND(ISNUMBER([Original Invoice No.]+0),LEN([Original Invoice No.])>5)
4. A custom list is configured to allow content types. "Customer" and "Customer2" are added as content types on that list
5. A SharePoint 2010 Workflow is created on that list and is supposed to update the Title field of a new item, only if that item is of type "Customer2". Additionally, the workflow is set to automatically start whenever a new item is created (I am
not sure that this is a requirement to repro the error though).
Image may be NSFW.
Clik here to view.
The error occurs when a "Customer2" item is created, and the wokflow fails with the following error: "The workflow could not update the item, possibly because one or more columns for the item require a different type of information."
Obviously a rather puzzling message, since my item only includes a Title field, which I have filled.
The ULS log reports this more informative error message:
03/17/2013 22:10:05.20 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General 8kh7 High <nativehr>0x810200c5</nativehr><nativestack></nativestack>[Original
Invoice No.] - [This is not a 6 or 7 digit number] 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General 8e2r Medium Possible mismatch between the reported error with code = 0x81079802
and message: "[Original Invoice No.] - [This is not a 6 or 7 digit number]" and the returned error with code 0x810200c5. 46e1089c-3435-d0c9-ac0e-a660e7938393
A bit below, the following error message appears:
03/17/2013 22:10:05.20 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium System.Runtime.InteropServices.COMException: <nativehr>0x810200c5</nativehr><nativestack></nativestack>[Original
Invoice No.] - [This is not a 6 or 7 digit number], StackTrace: at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish,
Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean
bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, ... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...String filename, Boolean bPreserveItemUIVersion)
at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateListItem(Transaction txn, Object[] transData) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction
transaction, ICollection items) at System.Workflow.Runtime.WorkBatch.PendingWorkCollection.Commit(Transaction transaction) at System.Workflow.Runtime.WorkBatch.Commit(Transaction transaction)
at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback
commitWorkBatchCallback) at System.Workflow.Runtime.Workflo... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...wExecutor.CommitTransaction(Activity activityContext)
at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) at System.Workflow.Runtime.WorkflowExecutor.System.Workflow.ComponentModel.IWorkflowCoreRuntime.PersistInstanceState(Activity
activity) at System.Workflow.ComponentModel.Activity.MarkClosed() at System.Workflow.ComponentModel.Activity.ReleaseLockOnStatusChange(IActivityEventListener`1 eventListener) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.SafeReleaseLockOnStatusChange(ActivityExecutionContext
context) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.OnEvent(Object sender, ActivityExecutionStatusChangedEventArgs e) at System.Workflow.Component... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...Model.ActivityExecutorDelegateInfo`1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime
workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run() at System.Workflow.Runtime.WorkflowExecutor.RunScheduler() at System.Workflow.Runtime.WorkflowExecutor.RunSome(Object ignored)
at System.Workflow.Runtime.Hosting.DefaultWorkflowSchedulerService.WorkItem.Invoke(WorkflowSchedulerService service) at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunOne(Guid workflowInstanceId)
at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.RunWorkflow(Guid workflowInstanceId) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWorkflow workflow, SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)
at Microsoft.SharePoint.Workflow.S... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...PWinOeEngine.RunWorkflow(SPWorkflowHostService host, SPWorkflow workflow,
Collection`1 events, TimeSpan timeOut) at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow workflow, Collection`1 events, SPWorkflowRunOptionsInternal runOptions) at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflowElev(Object
context, SPWorkflowAssociation association, DateTime elevationTimeUtc, SPWorkflowEvent startEvent, SPWorkflowRunOptions runOptions) at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.<>c__DisplayClass1.<AutoStartWorkflow>b__0(SPSite
superUserSite, SPWeb superUserWeb) at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass10.<RunWithSystemSiteAndWeb>b__f() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedP... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...rivileges>b__3() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated
secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.AutoStartWorkflow(SPItemEventProperties properties, Boolean bCreate, Boolean bChange, AssocType atyp) at Microsoft.SharePoint.Workflow.SPWorkflowAutostartEventReceiver.ItemAdded(SPItemEventProperties
properties) at Microsoft.SharePoint.SPEventManager.RunItemEventReceiver(SPItemEventReceiver receiver, SPUserCodeInfo userCodeInfo, SPItemEventProperties properties, SPEventContext context, String receiverData)... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ... at Microsoft.SharePoint.SPEventManager.RunItemEventReceiverHelper(Object
receiver, SPUserCodeInfo userCodeInfo, Object properties, SPEventContext context, String receiverData) at Microsoft.SharePoint.SPEventManager.<>c__DisplayClassa`1.<InvokeEventReceiver>b__7() at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken
userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPEventManager.InvokeEventReceiver[ReceiverType](SPUserToken userToken, Guid tranLockerId, RunEventReceiver runEventReceiver, Object receivers,
Int32 n, Object properties, SPEventReceiverOperationsType operationsType, Boolean& canceled, String& error) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](SPRemoteEventReceiverCallType remoteCallT... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...ype, SPUserToken userToken, Guid tranLockerId, RunEventReceiver runEventReceiver,
RunRemoteEventReceiver runRemoteEventReceiver, Object receivers, Object properties, Boolean checkCancel, SPEventReceiverOperationsType operationsType) at Microsoft.SharePoint.SPEventManager.InvokeEventReceivers[ReceiverType](SPRemoteEventReceiverCallType
remoteCallType, Byte[] userTokenBytes, Guid tranLockerId, RunEventReceiver runEventReceiver, RunRemoteEventReceiver runRemoteEventReceiver, Object receivers, Object properties, Boolean checkCancel, SPEventReceiverOperationsType operationsType)
at Microsoft.SharePoint.SPEventManager.HandleEventCallback[ReceiverType,PropertiesType](Object callbackData) at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state) at System.Thr... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.20* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation General ai1wu Medium ...eading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() at System.Threading.ThreadPoolWorkQueue.Dispatch() 46e1089c-3435-d0c9-ac0e-a660e7938393
And then:
03/17/2013 22:10:05.23 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 72er Medium Microsoft.SharePoint.SPListDataValidationException:List data validation failed. at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut,
Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean
bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at
Microsoft.SharePoint.SPListItem.Update(... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 72er Medium ...) at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateListItem(Transaction txn, Object[] transData) 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 72fe High Error in commiting pending workflow batch items: Microsoft.SharePoint.SPListDataValidationException: List data validation failed. at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean
bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean
suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean
bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersio... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 72fe High ...n) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateListItem(Transaction
txn, Object[] transData) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items) 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 88xr Unexpected WinWF Internal Error, terminating workflow Id# 0db96375-00c7-413c-88bd-0d18beb7a20c 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23 w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 98d4 Unexpected System.Workflow.Runtime.Hosting.PersistenceException: List data validation failed. ---> Microsoft.SharePoint.SPListDataValidationException: List data validation failed.
at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames,
Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean
bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String ... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 98d4 Unexpected ...filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.Update() at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdateListItem(Transaction
txn, Object[] transData) at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.Commit(Transaction transaction, ICollection items) at System.Workflow.Runtime.WorkBatch.PendingWorkCollection.Commit(Transaction transaction)
at System.Workflow.Runtime.WorkBatch.Commit(Transaction transaction) at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback
commitWorkBatchCallback) at System.Workflow.Runtime.WorkflowExecut... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 98d4 Unexpected ...or.CommitTransaction(Activity activityContext) at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation)
--- End of inner exception stack trace --- at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) at System.Workflow.Runtime.WorkflowExecutor.System.Workflow.ComponentModel.IWorkflowCoreRuntime.PersistInstanceState(Activity
activity) at System.Workflow.ComponentModel.Activity.MarkClosed() at System.Workflow.ComponentModel.Activity.ReleaseLockOnStatusChange(IActivityEventListener`1 eventListener) at System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.SafeReleaseLockOnStatusChange(ActivityExecutionContext
context) at... 46e1089c-3435-d0c9-ac0e-a660e7938393
03/17/2013 22:10:05.23* w3wp.exe (0x0A84) 0x16E4 SharePoint Foundation Legacy Workflow Infrastructure 98d4 Unexpected ... System.Workflow.ComponentModel.FaultAndCancellationHandlingFilter.OnEvent(Object sender, ActivityExecutionStatusChangedEventArgs e) at System.Workflow.ComponentModel.ActivityExecutorDelegateInfo`1.ActivityExecutorDelegateOperation.Run(IWorkflowCoreRuntime
workflowCoreRuntime) at System.Workflow.Runtime.Scheduler.Run() 46e1089c-3435-d0c9-ac0e-a660e7938393
Obviously, you will have certainly noticed that [Original Invoice No.] is a column on "Customer", not "Customer2" (which is the content type of the item I just created).
Now, if I remove the validation rule on the "Original Invoice No." column, all is well again and the workflow successfully completes.
This clearly looks like a bug to me, because the validation rule should never fire for a content type item that doesn't include the column with that validation rule. However, it looks like it currently does. I do understand that the [Original Invoice No.] column is part of the list's column by virtue of the "Customer" content type, but still, the validation rule should be ignored when the item on which the workflow is running doesn't include that column. After all, the workflow is able to ignore a required column, when that column doesn't belong to the item's content type definition, so it should behave in the same way for column validation, shouldn't it?
Clearly, having one list for each of my customer's content types is not an option, and the only workaround I will recommend (before a much expected fix) is to remove all column validations (which will significantly degrade the user experience and data consistency of the SharePoint list content).
Thanks in advance for any feedback,
Raphael.
Raphael Londner - www.riolinx.com