Episerver site initialization fails due to the unavailability of AD server

Last update: Aug 10 2017

This article describes an error that occurs when an Episerver site initializes and an active directory membership provider that is configured is down.

System.Configuration.Provider.ProviderException: Unable to establish secure connection with the server ---> System.Runtime.InteropServices.COMException: The server is not operational.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.RefreshCache()
at System.Web.Security.DirectoryInformation..ctor(String adspath, NetworkCredential credentials, String connProtection, Int32 clientSearchTimeout, Int32 serverSearchTimeout, Boolean enablePasswordReset)
--- End of inner exception stack trace ---
at System.Web.Security.DirectoryInformation..ctor(String adspath, NetworkCredential credentials, String connProtection, Int32 clientSearchTimeout, Int32 serverSearchTimeout, Boolean enablePasswordReset)
at System.Web.Security.ActiveDirectoryMembershipProvider.Initialize(String name, NameValueCollection config)
at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
--- End of inner exception stack trace ---
at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType)
at System.Web.Security.Membership.InitializeSettings(Boolean initializeGeneralSettings, RuntimeConfig appConfig, MembershipSection settings)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.get_Provider()
at EPiServer.Initialization.MembershipSecurityEntityProviderInitialization.<>c.b__0_1(IServiceLocator s)
at EPiServer.ServiceLocation.Internal.StructureMapConfiguration.<>c__DisplayClass6_0.b__1(IServiceLocator s)
at lambda_method(Closure , IBuildSession , IContext )

 

The error occurs because of a misconfiguration issue. Episerver does not swallow the error as it is critical to the end customer to know the issue with the connection.

The easiest recommendation is to create a custom AD provider that wraps (or inherits) the Microsoft one, and swallows that error gracefully.

ActiveDirectory Provider fail over Best Practices

You need to be logged in with your Episerver World account to rate articles.

Top