locked
Secure Token Service not working RRS feed

  • Question

  • We are experiencing an issue with security token service.

    Seeing below error in Eventlog.

    An exception occurred when trying to issue security token: Could not connect to http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:32843. .

    and in ULS logs, we noticed that, because of this user profile also not working as expected.

    12/30/2019 08:58:19.79 w3wp.exe (0x2E04) 0x1C58 SharePoint Portal Server User Profiles hyc6 High Exception occurred while connecting to WCF endpoint: System.ServiceModel.EndpointNotFoundException: Could not connect to http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:32843.  ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:32843     at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)     at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)     --- End of inner exception stack trace ---     at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)     at System.Net.HttpWebRequest.GetRequestStream()     at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()     --- End of inner exception stack trace ---    Server stack trace:      at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()     at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown at [0]:      at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)     at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrustContract.Issue(Message message)     at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)     at Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst)     at Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri context, Boolean bearerToken, SecurityToken onBehalfOf, SecurityToken actAs, SecurityToken delegateTo)     at Microsoft.SharePoint.SPSecurityContext.<>c__DisplayClass7.<GetProcessSecurityTokenForServiceContext>b__6()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurityContext.GetProcessSecurityTokenForServiceContext()     at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelAsProcess[TChannel](ChannelFactory`1 factory, EndpointAddress address, Uri via)     at Microsoft.SharePoint.SPChannelFactoryOperations.CreateChannelAsProcess[TChannel](ChannelFactory`1 factory, EndpointAddress address)     at Microsoft.Office.Server.UserProfiles.MossClientBase`1.get_Channel()     at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock) 55a5a351-2f86-4eb9-99f4-847153fe53c2
    12/30/2019 08:58:19.79 w3wp.exe (0x2E04) 0x1C58 SharePoint Portal Server User Profiles g11n High UserProfileApplicationProxy.InitializePropertyCache: Microsoft.Office.Server.UserProfiles.UserProfileException: System.ServiceModel.EndpointNotFoundException     at Microsoft.Office.Server.UserProfiles.MossClientBase`1.ExecuteOnChannel(String operationName, CodeBlock codeBlock)     at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.ExecuteOnChannel(String operationName, CodeBlock codeBlock)     at Microsoft.Office.Server.UserProfiles.ProfilePropertyServiceClient.GetProfileProperties()     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() 55a5a351-2f86-4eb9-99f4-847153fe53c2
    12/30/2019 08:58:19.79 w3wp.exe (0x2E04) 0x1C58 SharePoint Portal Server User Profiles cm6y High User Profile Application Proxy failed to retrieve partitions from User Profile Application: Microsoft.Office.Server.UserProfiles.UserProfileApplicationNotAvailableException: No User Profile Application available to service the request. Contact your farm administrator.     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.get_PartitionIDs()     at Microsoft.Office.Server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext serviceContext) 55a5a351-2f86-4eb9-99f4-847153fe53c2

    Also when I open userprofile service application I'm seeing as "This User Profile Application's connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator."

    Tried most of the MS blogs, but no luck.

    Can someone look into it and suggest some resolution.

    Thank you in Advance...

    Monday, December 30, 2019 4:04 PM

All replies

  • Hi Subrahmanyam,

    This condition can be caused by a number of reasons.

    To troubleshoot this problem, you can follow the steps below:

    1.Check that your app pool is running

    2.Go under sites and start "SharePoint Web Services" right click, manage and then click start or recycle then do an iisreset.

    3.Go under advanced settings for securityTokenServiceAppliction and make sure the user account that is used also has access/valid.

    More information:

    https://sharepoint.stackexchange.com/questions/82601/the-security-token-service-is-unavailable

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, December 31, 2019 2:49 AM
  • Hi Itch Sun,

    Thank you for your reply. I'd tried all the above, but no luck. Then I wrote here to get some assistance.

    Tuesday, December 31, 2019 9:47 AM
  • Hi,

    Did you try to recreate the User Profile service? If not, I recommend you to recreate it.

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, January 2, 2020 7:07 AM
  • Yes Created. But no luck.

    When I create I'm getting the same error.

    Thursday, January 2, 2020 2:16 PM
  • Hi Subrahmanyam,

    Go into Services.msc and check to ensure both services are started:

    Best regards

    Itch Sun


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, January 7, 2020 9:36 AM
  • Hi Subrahmanyam,

    Does your environment has any Symantec endpoint or any other network monitored tool installed, if yes then disable it and try to restart the security token application pool.

    ___________________________________

    Thivagar SEGAR

    Tuesday, January 7, 2020 9:58 AM