Skip to main content


 

Symptoms

 


When running a Smartforms that is dependant on a Sharepoint SmartObject, intermittently the following error would be logged:

 

 

 

The remote server returned an error: (401) Unauthorized.Failed to initialize the Context: URL: https://portal.denallix.com/sites/hr/exitinterviews Username: Error Details: Method: SharePointService.initializeContext x-ms-diagnostics : 3001000reason="There has been an error authenticating the request."category="invalid_client" SPRequestGuid : 8df9d69d-40a9-209d-eebd-9a0188b51d23 ?Type: SourceCode.SmartObjects.Client.SmartObjectException ?Source: SourceCode.SmartObjects.Client ?Method Base ?Member Type: Method ?Name: ExecuteScalar ?Module ?Scope Name: SourceCode.SmartObjects.Client.dll ?Declaring Type ?Full Name: SourceCode.SmartObjects.Client.SmartObjectClientServer ?Stack Trace: at SourceCode.SmartObjects.Client.SmartObjectClientServer.ExecuteScalar(SmartObject smartObject, DataTable inputTable) at SourceCode.Forms.AppFramework.FormRuntime.SmartObjectExecution(XPathNavigator nav, Boolean outputDependencies, SmartObjectClientServer svr) at SourceCode.Forms.AppFramework.FormRuntime.WorkXmlToApi(String xml) at SourceCode.Forms.Runtime.AJAXCall.ProcessRequest(HttpContext context)
 

 

Diagnoses

 


Verbose ULS logging was enabled for more details and when it failed the following error was logged: Exception occured while connecting to WCF endpoint:

 

 

 

System.ServiceModel.Security.SecurityAccessDeniedException: Access is denied. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpcand rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Objecti] ins, Objecti] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy... ....Invoke(IMessage message) Exception rethrown at e0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageDataand msgData, Int32 type) at Microsoft.Office.Server.UserProfiles.IProfilePropertyService.GetProfileProperties() at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.<>c__DisplayClass1.b__0(IProfilePropertyService channel) at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock) UserProfileProperty_WCFLogging::Begin ProfilePropertyServiceClient.ExecuteOnChannel threw Exception Microsoft.Office.Server.UserProfiles.UserProfileException: System.ServiceModel.Security.SecurityAccessDeniedException at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock) at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.ExecuteOnChannel(String operationName, CodeBlock codeBlock) UserProfileApplicationProxy.InitializePropertyCache: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsCompatibleDatabaseSchema(ProfilePropertyData propertyData) at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.RefreshProperties(Guid applicationID) at Microsoft.Office.Server.Utilities.SPAsyncCache`2.GetValueNow(K key) at Microsoft.Office.Server.Utilities.SPAsyncCache`2.GetValue(K key, Boolean asynchronous) at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.InitializePropertyCache() Failure retrieving application ID for User Profile Application Proxy 'User Profile Service Application': Microsoft.Office.Server.UserProfiles.UserProfileApplicationNotAvailableException: UserProfileApplicationNotAvailableException_Logging :: UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have 8e3f1ca4-51ce-45ce-af9f-8202921143f3 at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties() at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_AppID() Unexpected GetPartitionPropertiesCache :: ApplicationId is empty SPApplicationAuthenticationModule: Error authenticating request, Error details { Header: {0}, Body: {1} }. Available parameters: 3001000reason="There has been an error authenticating the request."category="invalid_client" {"error_description":"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."} .
 

 

Resolution

To resolve this intermittent issue, the account running the application pool for the User Profile Service web service was granted Full Control to the User Profile Service Application. This application pool may show up in IIS as a guid that can be matched to the User Profile Service application pool name using the following Sharepoint Powershell query:

 

 

 

Get-SPServiceApplicationPool | select Id, Name

 

 

 

Alternatively, one can also view the applications within the application pool and look for where 'Physical Path' is 'C:Program FilesMicrosoft Office Server15.0WebServicesProfile'. The guid associated with the 'Virtual Path' will belong to the User Profile Service Application and can be confirmed with Sharepoint Powershell query:

 

 

 

$upaSAType = "User Profile Service Application" $upa = Get-SPServiceApplication | where-object {$_.TypeName -eq $upaSAType} $upa.id

 

 



 
Be the first to reply!

Reply