The OOTB approval workflow could not update the item in SharePoint

We encountered the issue where the OOTB approval workflow stopped with the error message “The workflow could not update the item, possibly because one or more columns for the item require a different type of information”.

There are a few possible solutions for this issue.

  1. Content approval is not configured for the library
  2. The service account used by the workflow is disabled/removed or password expired as the workflow updates the item with this account
    You can republish the worfklow with an account that has sufficient permissions for the library but who is also working.

The previous version of the workflow has been started a few times before we could resolve this issue where you can use the below script to retrieve the items where the previous version of the workflow is current in progress. First find the workflow name by going to the workflow settings on the specific library.

Next run the following script in the SharePoint Management Shell as administrator where you will need to add the web url, list title and previous version date.

$web = get-spweb <SiteUrl>
$list = $web.lists.trygetlist("<ListName>")
$items = $list.Items
Foreach($item in $items){
$workflows = $item.workflows
foreach($workflow in $workflows){
if($workflow.statustext –eq "In Progress" –or $workflow.statustext –eq "Error Occurred"){
$result = $item.workflows.parentassociation
If($result.internalname –like "*Previous Version:9-2-2018 18:46:48*"){
write-host "$($item.name)"
}
}
}
}

and you will receive a list of the items for which this workflow is still “In Progress” or if an “Error Occurred”

 

Sorry, you don’t have access to this page creating documents in SharePoint

We encountered the issue where people were receiving access denied errors when uploading documents while having contribute permissions for a specific document library. Create a document worked most of the time but access was denied for some tries with the error “Sorry, you don’t have access to this page”

The user clicked on “New document” and was presented with the “Create a new document” pop-up.

The below error occurred after click on OK

The below was available in the ULS Log.

Access Denied. Exception: Access denied., StackTrace:  at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAndFolderProperties(String bstrUrl, String bstrStartUrl, ListDocsFlags ListDocsFlags, Boolean bThrowException, Int32& phrStatus, Object& pvarFiles, Object& pvarDirs, UInt32& pdwNumberOfFiles, UInt32& pdwNumberOfDirs)    at Microsoft.SharePoint.Library.SPRequest.GetFileAndFolderProperties(String bstrUrl, String bstrStartUrl, ListDocsFlags ListDocsFlags, Boolean bThrowException, Int32& phrStatus, Object& pvarFiles, Object& pvarDirs, UInt32& pdwNumberOfFiles, UInt32& pdwNumberOfDirs).

Access Denied for <SiteName>/_layouts/15/CreateNewDocument.aspx?id=https://xxxx etc etc

Solution

The user had the permissions to upload documents and create documents given by the members group. This library was setup that users were not able to view other peoples documents. After troubleshooting we found that the document name already existed in the library but the user doesn’t have permissions to view this document metadata and receives the access denied error. The error changes to “Sorry, something went wrong” should the user be able to view the document with an better message saying “A file with the name <DocName> exists.”