Error when running script - Get-SPSite : There was no endpoint listening at localhost:32843/SecurityTokenServiceApplication/securitytoken.svc

May 31, 2013 at 6:25 PM
I am running the autospinstaller and the script is halting at There was noe endpoint listening at http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc. When i browse to that application pool its stopped, so I start it and rerun the script and I get the same error. Any clues.
  • Done setting up managed paths at "http://communities-s.ntrs.com:80"
    Get-SPSite : There was no endpoint listening at
    http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc that
    could accept the message. This is often caused by an incorrect address or SOAP
    action. See InnerException, if present, for more details.
    At Y:\SPMedia\AutoSPInstaller\AutoSPInstallerFunctions.ps1:2182 char:32
  • $getSPSiteCollection = Get-SPSite -Limit ALL | Where-Object {$_.Url
    -eq ...
  • ~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidData: (Microsoft.Share...SPCmdletGetSite:
      SPCmdletGetSite) [Get-SPSite], EndpointNotFoundException
    • FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSite

- Creating Site Collection "http://communities-s.ntrs.com"...

  • Script halted!
Exception : System.ServiceModel.EndpointNotFoundException: There
                    was no endpoint listening at http://localhost:32843/Sec
                    urityTokenServiceApplication/securitytoken.svc that
                    could accept the message. This is often caused by an
                    incorrect address or SOAP action. See InnerException,
                    if present, for more details. --->
                    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, Exception& exception)
                       --- End of inner exception stack trace ---
                       at System.Net.HttpWebRequest.GetRequestStream(Transp
                    ortContext& context)
                       at System.Net.HttpWebRequest.GetRequestStream()
                       at System.ServiceModel.Channels.HttpOutput.WebReques
                    tHttpOutput.GetOutputStream()
                       --- End of inner exception stack trace ---

                    Server stack trace:
                       at System.ServiceModel.Channels.HttpOutput.WebReques
                    tHttpOutput.GetOutputStream()
                       at
                    System.ServiceModel.Channels.HttpOutput.Send(TimeSpan
                    timeout)
                       at System.ServiceModel.Channels.HttpChannelFactory`1
                    .HttpRequestChannel.HttpChannelRequest.SendRequest(Mess
                    age message, TimeSpan timeout)
                       at System.ServiceModel.Channels.RequestChannel.Reque
                    st(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.ServiceChannelProxy.
                    InvokeService(IMethodCallMessage methodCall,
                    ProxyOperationRuntime operation)
                       at System.ServiceModel.Channels.ServiceChannelProxy.
                    Invoke(IMessage message)

                    Exception rethrown at [0]:
                       at System.Runtime.Remoting.Proxies.RealProxy.HandleR
                    eturnMessage(IMessage reqMsg, IMessage retMsg)
                       at System.Runtime.Remoting.Proxies.RealProxy.Private
                    Invoke(MessageData& msgData, Int32 type)
                       at Microsoft.IdentityModel.Protocols.WSTrust.IWSTrus
                    tContract.Issue(Message message)
                       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrust
                    Channel.Issue(RequestSecurityToken rst,
                    RequestSecurityTokenResponse& rstr)
                       at Microsoft.IdentityModel.Protocols.WSTrust.WSTrust
                    Channel.Issue(RequestSecurityToken rst)
                       at Microsoft.SharePoint.SPSecurityContext.SecurityTo
                    kenForContext(Uri context, Boolean bearerToken,
                    SecurityToken onBehalfOf, SecurityToken actAs,
                    SecurityToken delegateTo,
                    SPRequestSecurityTokenProperties properties)
                       at Microsoft.SharePoint.SPSecurityContext.SecurityTo
                    kenForLegacyLoginContext(Uri context)
                       at
                    Microsoft.SharePoint.SPSite.InitUserToken(SPRequest
                    request)
                       at
                    Microsoft.SharePoint.SPSite.SPSiteConstructor(SPFarm
                    farm, Guid applicationId, Guid contentDatabaseId, Guid
                    siteId, Guid siteSubscriptionId, SPUrlZone zone, Uri
                    requestUri, String serverRelativeUrl, Boolean
                    hostHeaderIsSiteName, SPUserToken userToken, Boolean
                    appWebRequest, String appHostHeaderRedirectDomain,
                    String appSiteDomainPrefix, String subscriptionName,
                    String appSiteDomainId, Uri primaryUri)
                       at Microsoft.SharePoint.SPSite..ctor(SPFarm farm,
                    Uri requestUri, Boolean contextSite, Boolean
                    swapSchemeForPathBasedSites, SPUserToken userToken)
                       at Microsoft.SharePoint.SPSite..ctor(SPFarm farm,
                    Uri requestUri, Boolean contextSite)
                       at Microsoft.SharePoint.Administration.SPSiteCollect
                    ion.get_Item(String strSiteName)
                       at Microsoft.SharePoint.Administration.SPConfigurati
                    onDatabase.CreateSite(SPWebApplication application,
                    SPContentDatabase database, String originalPath, Guid
                    id, Guid siteSubscriptionId, Boolean
                    useHostHeaderAsSiteName, Boolean bDeleted, DateTime
                    deletionTime, String subscriptionName, String
                    appSiteDomainId, List`1 siteUrls, Boolean bResyncMode)
                       at Microsoft.SharePoint.Administration.SPConfigurati
                    onDatabase.CreateSite(SPWebApplication application,
                    SPContentDatabase database, String path, Boolean
                    useHostHeaderAsSiteName)
                       at Microsoft.SharePoint.Administration.SPSiteCollect
                    ion.Add(SPContentDatabase database, SPSiteSubscription
                    siteSubscription, String siteUrl, String title, String
                    description, UInt32 nLCID, Int32 compatibilityLevel,
                    String webTemplate, String ownerLogin, String
                    ownerName, String ownerEmail, String
                    secondaryContactLogin, String secondaryContactName,
                    String secondaryContactEmail, String quotaTemplate,
                    String sscRootWebUrl, Boolean useHostHeaderAsSiteName,
                    Boolean overrideCompatibilityRestriction)
                       at Microsoft.SharePoint.PowerShell.SPCmdletNewSite.C
                    reateDataObject()
                       at Microsoft.SharePoint.PowerShell.SPNewCmdletBase`1
                    .InternalProcessRecord()
                       at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessR
                    ecord()
TargetObject : Microsoft.SharePoint.PowerShell.SPCmdletNewSite
CategoryInfo : InvalidData:
                    (Microsoft.Share...SPCmdletNewSite:SPCmdletNewSite)
                    [New-SPSite], EndpointNotFoundException
FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletNewSite
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at CreateWebApp, Y:\SPMedia\AutoSPInstaller\AutoSPInsta
                    llerFunctions.ps1: line 2206
                    at CreateWebApplications, Y:\SPMedia\AutoSPInstaller\Au
                    toSPInstallerFunctions.ps1: line 2060
                    at Setup-Farm,
                    Y:\SPMedia\AutoSPInstaller\AutoSPInstallerMain.ps1:
                    line 190
                    at <ScriptBlock>,
                    Y:\SPMedia\AutoSPInstaller\AutoSPInstallerMain.ps1:
                    line 358
                    at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
PSMessageDetails :
Jul 16, 2013 at 5:44 AM
Same issue here.
Jul 16, 2013 at 6:22 AM
Edited Jul 16, 2013 at 6:24 AM
Jul 16, 2013 at 1:36 PM
Can you verify if the security update at http://support.microsoft.com/kb/2844286 is installed. This patch was released last week and apparently breaks SharePoint. If you do have it, uninstall it and retry AutoSPinstaller.
Oct 25, 2013 at 5:05 AM
Edited Oct 25, 2013 at 5:05 AM
I added the script below to "Function CreateWebApp([System.Xml.XmlElement]$webApp)", just before "ForEach ($siteCollection in $webApp.SiteCollections.SiteCollection)":

Import-Module WebAdministration
Start-WebSite 'SharePoint Web Services'

This force IIS to start "http://localhost:32843", which resolved the problem.
Marked as answer by brianlala on 11/3/2013 at 6:57 PM
Dec 19, 2013 at 1:38 AM
Nice work. Thank you.