Login Problems With Active Directory

We are experiencing a recurring problem with logging in to Octopus deploy.

We are using Active Directory authentication. Most of the time it works fine, but intermittently (once a week perhaps) the login fails with the message:

The server could not be contacted.

Restarting the Octopus service does not resolve the problem, however restarting the server does.

The OctopusServer.txt log file contains the following:

2016-09-08 06:50:13.9784 103 WARN An exception was thrown while trying to establish a principal for the current request
System.DirectoryServices.AccountManagement.PrincipalServerDownException: The server could not be contacted. —> System.DirectoryServices.Protocols.LdapException: The LDAP server is unavailable.
at System.DirectoryServices.Protocols.LdapConnection.Connect()
at System.DirectoryServices.Protocols.LdapConnection.SendRequestHelper(DirectoryRequest request, Int32& messageID)
at System.DirectoryServices.Protocols.LdapConnection.SendRequest(DirectoryRequest request, TimeSpan requestTimeout)
at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
— End of inner exception stack trace —
at System.DirectoryServices.AccountManagement.PrincipalContext.ReadServerConfig(String serverName, ServerProperties& properties)
at System.DirectoryServices.AccountManagement.PrincipalContext.DoServerVerifyAndPropRetrieval()
at System.DirectoryServices.AccountManagement.PrincipalContext…ctor(ContextType contextType, String name, String container, ContextOptions options, String userName, String password)
at System.DirectoryServices.AccountManagement.PrincipalContext…ctor(ContextType contextType, String name, String container)
at Octopus.Server.Web.Infrastructure.Authentication.ActiveDirectoryMembership.GetOrCreateUser(String username, Boolean& wasCreated) in Y:\work\refs\tags\3.3.17\source\Octopus.Server\Web\Infrastructure\Authentication\ActiveDirectoryMembership.cs:line 232
at Octopus.Server.Web.Infrastructure.Authentication.ActiveDirectoryMembership.GetOrCreateUser(String username) in Y:\work\refs\tags\3.3.17\source\Octopus.Server\Web\Infrastructure\Authentication\ActiveDirectoryMembership.cs:line 222
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.GetPresentedUserIdentity(NancyContext context) in Y:\work\refs\tags\3.3.17\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 97
at Octopus.Server.Web.Infrastructure.Authentication.OctopusPrincipalEstablisher.EstablishPrincipalForRequest(NancyContext context) in Y:\work\refs\tags\3.3.17\source\Octopus.Server\Web\Infrastructure\Authentication\OctopusPrincipalEstablisher.cs:line 43

I understand that this is likely not an issue with Octopus specifically, but any troubleshooting advice would be greatly appreciated.

Thanks!

Alan

Hi Alan,

Thanks for getting in touch! It looks like you’re correct in that it’s not specifically an issue within Octopus. One of my team members wrote a fantastic guide, Troubleshooting Active Directory integration in our documentation, which will hopefully assist you in troubleshooting the issue and find the cause :slight_smile:

I hope that helps!

Kenny

Notice:

This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.