SharePoint 2010 Runtime Exception when edit items in pending for approval

Recently I came across with a customer’s incident that is running a “custom workflow” that finally creates a List-Event (item update, asynchronous). Unfortunately we could not repro the issue but while troubleshooting and research, I found another interesting “Issue” in my lab.

image

How found??  see below steps and/or just use the quick links to jump directly to the topics 😉

Quick links:

 

Repro steps:

Environment:  SharePoint 2010 enterprise server, patch level 14.0.5128.5003 (which is the “fixed” Oct. 2010 CU), separate SQL server, all configurations done and working.

1. browsing your portal page:

Capture 

 Back to Top

2. create there a “Custom List”

Capture2 

 Back to Top

3. Go to the List settings for your “Custom List”: 

image

4. Go to “Versioning settings”

image

Back to Top

5. configure the settings as follows:

– Require content approval… : yes
– Create a version each time… :yes
– Optionally limit the number of versions… 3 versions, 3 drafts

Who should see draft items in this list?

– Only users who can approve items (and the author of the item)

Capture4

6. On list settings, go to the permissions settings and add some users as follows:

image

– Add to the SharePoint group “Approvers” a user account i.e. “domainApproverUser”
– Add  two more user accounts, i.e. “domainUser1 and domainuser2” with contribute permission to the list

image

Back to Top

7. Now logon to the List with the “Approver account” and add a new item

Note: The approval status of the item will be shown as “pending”

– With the approver account, click the List tools/items/Approve and approve the version.

 

8. Now logon with User1 to the List and note, that the item is shown as “approved”

9. Click “edit item” and modify it

Note: The approval status changed back to “pending”

 

10. Now logon to the list with “User2”

Note: You’ll see the old item, previously uploaded/changed by the Approver account and with status “approved” but not the just modified item from User1!

 

11. Now click edit this shown item and change it.

image

Back to Top

 

Result (Error):

Once you click “save”, you’ll end up in an error page with the following error message from SharePoint:

image

–> Here is the full error call stack:

Error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Cannot complete this action.

Please try again.<nativehr>0x80004005</nativehr><nativestack></nativestack> 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Runtime.InteropServices.COMException: Cannot complete this action.Please try again.<nativehr>0x80004005</nativehr><nativestack></nativestack>

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 
[COMException (0x80004005): Cannot complete this action.
Please try again.<nativehr>0x80004005</nativehr><nativestack></nativestack>]

Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, 
Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, 
Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) +0   

Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, 
 String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, 
 Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) +406

[SPException: Cannot complete this action. Please try again.]
Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) +27418402   
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, 
 Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, 
 String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) +27810175   

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) +26575661   Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, 
 Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename) +26575102   Microsoft.SharePoint.SPListItem.Update() +161
Microsoft.SharePoint.WebControls.SaveButton.SaveItem(SPContext itemContext, Boolean uploadMode, String checkInComment) +20173012   Microsoft.SharePoint.WebControls.SaveButton.OnBubbleEvent(Object source, EventArgs e) +1315   

System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29   
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4209 

Back to Top

Resolution/Workaround:

Currently there is no resolution or fix for this issue.

The only workaround you may have is:

On List settings, go to the “version settings” and change the ” Who should see draft items in this list?” to either

– Any user who can read items or
– Only users who can edit items

With this settings you will not get the error message and the “contributor users” will see the items as “pending” with the actual changes previously made by any other user.

We have reported this to the Product team and if tehre will be a fix available ion future, I’ll update it here.

cheers, Steve 😉

4 thoughts on “SharePoint 2010 Runtime Exception when edit items in pending for approval

  1. So, I think I mighted of figured it out. After further testing it looks like the for one user the list item the status is set to 'Approved' but for the approver it's in a status of 'Pending'.
    Let's say we have two users:
    User1 – defined as the Approver and owner of the list.
    User2 – defined as the contributor
    1) User 2 – creates a list item – status set to 'Pending'
    2) User 1 – approves the chages and the status is set to 'Approved'
    3) User 1 – changes the same list item that User2 changes. Status is set to 'Pending', but to User2 the status is set to 'Approved'
    3) User2 – opens the same list item user1 modified and it's currently in pending state, and User2 get's the error.
    Looks if an approvers changes the value, it does not update the status value to pending for non-approver users.

    Like

  2. Sorry my message re-post, but I was wondering if you had any updates regarding this issue? I'm getting the same error you've listed in your in blog post.

    Like

  3. Hi Steve,
    I had this issue last week on Staging environment where the library has been set up
    Require content approval for submitted items? NO
    No versioning  
    Require documents to be checked out before they can be edited? NO
    By setting Browser File Handling to Permissive , solved the issue
    regards,
    Marius Mag

    Like

  4. HI Brandon,
    yes, this is the issue as described and is related to the fact that once a 2nd user is modifying the item before the first change was approved, the same error occurs as shown above.
    We have a bug report for this already but its still active…
    I can try to ping the owner (with no promises yet) and see if or when we may expect a fix or comment for this but by now, there is no other known way as I posted here.
    Sorry for not having better news yet.
    if you seriuosly need this to be fixed, please raise a support call with our engineers and refer to my blog. We then can hook in this issue based on your case and may have better chances to drive it faster.
    As soon as I get any other news on this, I'll update my post accordingly.
    Cheers and greetz,

    Like

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s