2.4.2 - Cannot login after upgrade (Domain Authentification)

Hi

I tried to upgrade our Octopus Server to the new pre-release 2.4.2 from 2.3.6, and i’m having issues logging in, with domain authentification. The user login prompt says “Please provide a valid API key or log in again” after i click login. If i try to choose the new option Integrated Windows authentication option, and type in my AD credentials, nothing happends.

Here is some log information:

WARN Principal ‘xx@xx’ (Domain: ‘’) could not be logged on via WIN32: 0x0000052E.

and also this one:

ERROR Unhandled error on request: http://octo/api/users/login : Value cannot be null.
Parameter name: instance
System.ArgumentNullException: Value cannot be null.
Parameter name: instance
at System.ComponentModel.DataAnnotations.ValidationContext…ctor(Object instance, IServiceProvider serviceProvider, IDictionary2 items) at Nancy.Validation.DataAnnotations.DataAnnotationsValidatorAdapter.<Validate>d__4.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Nancy.Validation.DataAnnotations.DataAnnotationsValidator.Validate(Object instance) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at System.Linq.Enumerable.<SelectManyIterator>d__142.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Nancy.Validation.CompositeValidator.Validate(Object instance) at Octopus.Platform.Web.Api.Responder1.BindAndValidateTModel in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Platform.Web\Api\Responder.cs:line 82
at Octopus.Server.Web.Api.Actions.UserLoginAction.Execute() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Web\Api\Actions\UserLoginAction.cs:line 29
at Octopus.Platform.Web.Api.Responder1.Respond(TDescriptor options, NancyContext context) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Platform.Web\Api\Responder.cs:line 162 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , Object , NancyContext ) at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass5.<.ctor>b__2(Object o) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 47 at CallSite.Target(Closure , CallSite , Func2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

Another log entry which has been thrown once only:

ERROR Could not convert document userroles-projectcontributor to entity of type Octopus.Platform.Documents.Model.Users.UserRole
System.InvalidOperationException: Could not convert document userroles-projectcontributor to entity of type Octopus.Platform.Documents.Model.Users.UserRole —> System.ArgumentException: Requested value ‘ActionTemplateView’ was not found.
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1378
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IWrappedCollection wrappedList, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1132
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 572
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 240
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndConstructorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1423
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectFromNonDefaultConstructor(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ConstructorInfo constructorInfo, String id) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 1298
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 362
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 238
at Raven.Imports.Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 164
at Raven.Imports.Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) in c:\Builds\RavenDB-Stable\Imports\Newtonsoft.Json\Src\Newtonsoft.Json\JsonSerializer.cs:line 565
at Raven.Client.Document.InMemoryDocumentSessionOperations.ConvertToEntity(Type entityType, String id, RavenJObject documentFound, RavenJObject metadata) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 479
— End of inner exception stack trace —
at Raven.Client.Document.InMemoryDocumentSessionOperations.ConvertToEntity(Type entityType, String id, RavenJObject documentFound, RavenJObject metadata) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 503
at Raven.Client.Document.InMemoryDocumentSessionOperations.TrackEntity(Type entityType, String key, RavenJObject document, RavenJObject metadata, Boolean noTracking) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 420
at Raven.Client.Document.InMemoryDocumentSessionOperations.TrackEntity(Type entityType, JsonDocument documentFound) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 400
at Raven.Client.Document.InMemoryDocumentSessionOperations.TrackEntity[T](JsonDocument documentFound) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\InMemoryDocumentSessionOperations.cs:line 344
at Raven.Client.Document.SessionOperations.LoadOperation.CompleteT in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\SessionOperations\LoadOperation.cs:line 61
at Raven.Client.Document.DocumentSession.Load[T](String id) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\DocumentSession.cs:line 249
at Octopus.Server.Storage.Defaults.DefaultTeamInstaller.EnsureRoleExists(IDocumentSession session, BuiltInRole builtInRole) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Storage\Defaults\DefaultTeamInstaller.cs:line 116
at Octopus.Server.Storage.Defaults.DefaultTeamInstaller.EnsureBuiltInRolesExist(IDocumentSession session) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Storage\Defaults\DefaultTeamInstaller.cs:line 107
at Octopus.Server.Storage.Defaults.DefaultTeamInstaller.Initialize(IDocumentStore store) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Storage\Defaults\DefaultTeamInstaller.cs:line 26
at Octopus.Server.Storage.StoreInitializer.Initialize() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Storage\StoreInitializer.cs:line 28
at Octopus.Server.OctopusServerEngine.Start() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\OctopusServerEngine.cs:line 50
at Octopus.Server.Commands.RunCommand.Start() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Commands\RunCommand.cs:line 21
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass2.b__0() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 19
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Startup\WindowsServiceAdapter.cs:line 44

I also see some errors being thrown in the ravenDB log. I don’t know if the logs have anything to do with the login problem:

System.InvalidOperationException: Index does not exists: TeamsIndex
at Raven.Database.Indexing.IndexStorage.OpenOrCreateLuceneDirectory(IndexDefinition indexDefinition, String indexName, Boolean createIfMissing) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\IndexStorage.cs:line 315
at Raven.Database.Indexing.IndexStorage.OpenIndexOnStartup(String indexName) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\IndexStorage.cs:line 126
2014-05-03 22:36:12.1799 WARN Could not open index UserRolesIndex. Recovery operation failed, forcibly resetting index
System.InvalidOperationException: Index does not exists: UserRolesIndex
at Raven.Database.Indexing.IndexStorage.OpenOrCreateLuceneDirectory(IndexDefinition indexDefinition, String indexName, Boolean createIfMissing) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\IndexStorage.cs:line 315
at Raven.Database.Indexing.IndexStorage.OpenIndexOnStartup(String indexName) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\IndexStorage.cs:line 126
2014-05-03 22:36:12.1955 WARN Could not open index UsersByLoginIndex. Recovery operation failed, forcibly resetting index
System.InvalidOperationException: Index does not exists: UsersByLoginIndex
at Raven.Database.Indexing.IndexStorage.OpenOrCreateLuceneDirectory(IndexDefinition indexDefinition, String indexName, Boolean createIfMissing) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\IndexStorage.cs:line 315
at Raven.Database.Indexing.IndexStorage.OpenIndexOnStartup(String indexName) in c:\Builds\RavenDB-Stable\Raven.Database\Indexing\IndexStorage.cs:line 126

I have tried reinstalling twice, and also clearing all my cookies and saved passwords, as written in a similar issue here http://help.octopusdeploy.com/discussions/problems/16477-cant-login-after-migration-from-16-to-21

For now i had to downgrade to the previous version.

I did a clean 2.4.2 install on another server, and did a DB restore from the latest 2.3.6 backup i had, and it did worked. So this seems only to be related when you’re upgrading.

Thanks for the report Thomas, I’m sorry this happened and I’m glad you got it working. The errors you received are quite strange, if this happens again with the new instance please let us know.

Paul

Thanks for the report Thomas, I’m sorry this happened and I’m glad you got it working. The errors you received are quite strange, if this happens again with the new instance please let us know.

Paul