Upgrade to 3.4.0-beta0002 failed

I tried upgrading a test instance of octopus 3.3.27 to the beta version 3.4.0-beta0002 (I now know that that isn’t supported)

It looks like the database migration fails, and it completely messes up the install.

Hopefully the same wont happen when upgrading from 3.3. to the final version of 3.4

2016-08-18 22:33:02.8600      7 FATAL  Error converting value "TenantView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[14]', line 1, position 567.
Newtonsoft.Json.JsonSerializationException: Error converting value "TenantView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[14]', line 1, position 567. ---> System.ArgumentException: Requested value 'TenantView' was not found.
   at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Octopus.Core.RelationalStorage.RelationalTransaction.<Stream>d__28`1.MoveNext() in Y:\Work\refs\tags\3.3.27\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 292
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.EnsureRoleExists(IRelationalTransaction transaction, BuiltInRole builtInRole) in Y:\Work\refs\tags\3.3.27\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 121
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.EnsureBuiltInRolesExist(IRelationalTransaction transaction) in Y:\Work\refs\tags\3.3.27\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 113
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.Initialize(IRelationalStore store) in Y:\Work\refs\tags\3.3.27\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 27
   at Octopus.Core.Initialization.StoreInitializer.Initialize() in Y:\Work\refs\tags\3.3.27\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
   at Octopus.Server.OctopusServerEngine.Start() in Y:\Work\refs\tags\3.3.27\source\Octopus.Server\OctopusServerEngine.cs:line 49
   at Octopus.Server.Commands.RunCommand.Start() in Y:\Work\refs\tags\3.3.27\source\Octopus.Server\Commands\RunCommand.cs:line 37
   at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\Work\refs\tags\3.3.27\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58
   at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime) in Y:\Work\refs\tags\3.3.27\source\Octopus.Shared\Startup\OctopusProgram.cs:line 221
   at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.<Run>b__0() in Y:\Work\refs\tags\3.3.27\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 19
   at Octopus.Shared.Startup.WindowsServiceAdapter.RunService() in Y:\Work\refs\tags\3.3.27\source\Octopus.Shared\Startup\WindowsServiceAdapter.cs:line 48

Hi,

Sorry to hear you had this issue upgrading to the 3.4 beta, could you send through the full Octopus Server log for us to have a look at as it might assist us in figuring out what happened. Could you also let us know what version of 3.3 you upgraded from?

We’ve run upgrades from 3.x to 3.4 and we have not had the migration scripts fail on us, so maybe something else is at play here.

Thank you and best regards,
Henrik

I was running the official (non beta) 3.3.27

I’m not positive but I believe I performed the upgrade at this timestamp.

2016-08-18 22:29:28.7868

They key lines are:

2016-08-18 22:29:09.6563     52  INFO  Stopping the Windows Service
2016-08-18 22:29:09.6563     52  INFO  The Octopus server is shutting down...
2016-08-18 22:29:09.6563     52  INFO  Shutting down the embedded web server
2016-08-18 22:29:09.6563     52  INFO  listen://[::]:10943/             52  Listener stopped
2016-08-18 22:29:10.6720     52  INFO  The Windows Service has stopped
2016-08-18 22:29:27.3946      7  INFO  Browse your Octopus server at: https://localhost:443/
2016-08-18 22:29:28.7868      7  INFO  Browse your Octopus server at: http://localhost:80/
2016-08-18 22:29:28.7868      7  INFO  The Octopus server is starting: Initializing database and performing migrations...
2016-08-18 22:29:28.8408      7  INFO  Beginning database upgrade
2016-08-18 22:29:28.8408      7  INFO  Fetching list of already executed scripts.
2016-08-18 22:29:28.8728      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0043 - Increase Package Column Widths.sql'
2016-08-18 22:29:28.8998      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0044 - Octopus 3.4 Schema.sql'
2016-08-18 22:29:29.3048      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0045AddDefaultMachinePolicyToExistingTentacles.cs'
2016-08-18 22:29:29.4244      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0046ConvertHealthCheckStatus.cs'
2016-08-18 22:29:29.4951      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0047AddMachinePolicyAndTenantAndProxyPermissionsToBuiltInRoles.cs'
2016-08-18 22:29:29.5714      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0048PopulateIncludedLibraryVariableSetIdsOnProjects.cs'
2016-08-18 22:29:29.6007      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0049 - Add TenantTags columns.sql'
2016-08-18 22:29:29.6337      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0050 - Add IncludedTenantIds column.sql'
2016-08-18 22:29:29.6337      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0051 - Add ReleaseCurrentDashboard View.sql'
2016-08-18 22:29:29.6568      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0052 - Add ProjectCurrentDashboard View.sql'
2016-08-18 22:29:29.6678      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0053 - Update Triggers.sql'
2016-08-18 22:29:29.7228      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0054 - Add EventSourceDeployments function.sql'
2016-08-18 22:29:29.7418      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0055 - Add ChannelId to EventSourceDeployments function.sql'
2016-08-18 22:29:29.7595      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0056ConvertMachineCleanupIntervalToTimespan.cs'
2016-08-18 22:29:29.7835      7  INFO  Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0057 - UpdateProjectTriggerTypeEnum.sql'
2016-08-18 22:29:29.7925      7  INFO  Upgrade successful
2016-08-18 22:29:29.8365      7  INFO  Creating built-in role Tenant manager
2016-08-18 22:29:29.8865      7 FATAL  Error converting value "AuditView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[72]', line 1, position 1336.
Newtonsoft.Json.JsonSerializationException: Error converting value "AuditView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[72]', line 1, position 1336. ---> System.ArgumentException: Requested value 'AuditView' was not found.
   at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Octopus.Core.RelationalStorage.RelationalTransaction.<Stream>d__31`1.MoveNext() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 324
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.EnsureRoleExists(IRelationalTransaction transaction, BuiltInRole builtInRole) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 124
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.EnsureBuiltInRolesExist(IRelationalTransaction transaction) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 116
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.Initialize(IRelationalStore store) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 27
   at Octopus.Core.Initialization.StoreInitializer.Initialize() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
   at Octopus.Server.OctopusServerEngine.Start() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Server\OctopusServerEngine.cs:line 59
   at Octopus.Server.Commands.RunCommand.Start() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Server\Commands\RunCommand.cs:line 39
   at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58
   at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.<Run>b__0() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 19
   at Octopus.Shared.Startup.WindowsServiceAdapter.RunService() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Shared\Startup\WindowsServiceAdapter.cs:line 44
2016-08-18 22:29:30.1125      7 FATAL  Unhandled AppDomain exception occurred: Error converting value "AuditView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[72]', line 1, position 1336.
Newtonsoft.Json.JsonSerializationException: Error converting value "AuditView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[72]', line 1, position 1336. ---> System.ArgumentException: Requested value 'AuditView' was not found.
   at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnumName(String enumText, Boolean isNullable, Type t)
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Octopus.Core.RelationalStorage.RelationalTransaction.<Stream>d__31`1.MoveNext() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 324
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.EnsureRoleExists(IRelationalTransaction transaction, BuiltInRole builtInRole) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 124
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.EnsureBuiltInRolesExist(IRelationalTransaction transaction) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 116
   at Octopus.Core.Initialization.BuiltIn.BuiltInTeamInitializer.Initialize(IRelationalStore store) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\BuiltIn\BuiltInTeamInitializer.cs:line 27
   at Octopus.Core.Initialization.StoreInitializer.Initialize() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
   at Octopus.Server.OctopusServerEngine.Start() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Server\OctopusServerEngine.cs:line 59
   at Octopus.Server.Commands.RunCommand.Start() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Server\Commands\RunCommand.cs:line 39
   at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58
   at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.<Run>b__0() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 19
   at Octopus.Shared.Startup.WindowsServiceAdapter.RunService() in Y:\Work\refs\tags\3.4.0-beta.2\source\Octopus.Shared\Startup\WindowsServiceAdapter.cs:line 59
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
2016-08-18 22:29:54.1612      7  INFO  Browse your Octopus server at: https://localhost:443/
2016-08-18 22:29:54.1612      7  INFO  Browse your Octopus server at: http://localhost:80/
2016-08-18 22:29:54.1612      7  INFO  The Octopus server is starting: Initializing database and performing migrations...
2016-08-18 22:29:54.3542      7  INFO  Beginning database upgrade
2016-08-18 22:29:54.3542      7  INFO  Fetching list of already executed scripts.
2016-08-18 22:29:54.3712      7  INFO  No new scripts need to be executed - completing.
2016-08-18 22:29:54.5572      7  INFO  Creating built-in role Tenant manager
2016-08-18 22:29:54.6392      7 FATAL  Error converting value "AuditView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[72]', line 1, position 1336.
Newtonsoft.Json.JsonSerializationException: Error converting value "AuditView" to type 'Octopus.Client.Model.Permission'. Path 'GrantedPermissions[72]', line 1, position 1336. ---> System.ArgumentException: Requested value 'AuditView' was not found.
   at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)

OctopusServer.txt (207 KB)

Hi,

OK, your issue is due to that we’ve added a new permission (AuditView) in a 3.3.x release (I believe the new permission was added post-3.3.24) that was released after we had already released 3.4.0-beta0002. This issue will not happen with the RTW version of 3.4 as we will have merged all changes made in the 3.3.x branch of code.

I hope that helps.

Thank you and best regards,
Henrik

I upgraded the same machine to the official 3.4.1 today with no problems. Thanks for making octopus so bullet proof.

Hi,

Great to hear that everything worked without issue for you with the official release.

Thanks for letting us know.

Thank you and best regards,
Henrik