Symptoms
When configuring a process to update and change the permissions of a SharePoint Library we are seeing an error with failing to initialize the context:
Source -- Get Library Reference Event
Description -- Service: portal_denallix_com Service Guid: 0dbe5785-e8d4-4e61-b3e0-e061aaa0b59b Severity: Error Error Message: The remote server returned an error: (404) Not Found.Failed to initialize the Context: URL: https://portal.denallix.com/sptestingx/Permissions 2 Username: Error Details: Method: SharePointService.initializeContext SPRequestGuid : f0e5609d-f44d-005d-6a17-f46683f35755 InnerException Message:
Diagnoses
Workflow consists of 3 steps. Get Library Reference -> Stop Inheriting Permissions -> Add Library Permissions. Hard coding the Relative URL to Library name of Permissions 2 would give us the 404 error. We found that if you filled out the name field in order to filter and find the correct library this would actually not throw the 404 error.
Previously we were not filtering correctly in order to find a good library reference.
Resolution
In order to get this particular event to function without error we needed to make the following change:
When we are creating the library reference, we need to use the Name for filtering to get to our correct library. Do not use the relative URL and the list name for it's value. So in this case I filled in the Name with a hardcoded Permissions 2 (Library name). The two fields filled in this wizard are now:
Subsite Relative URL with the Relative Subsite URL mapping from the Item Reference, this is a column on a sharepoint list.
Name with Permissions 2 (Typed in)