We recently tried to upgrade from 3.3.4 to 3.3.10 and once installed the octopus server service fails to start up with the following error in windows event viewer:
2016-04-28 09:48:59.0497 7 FATAL Unhandled AppDomain exception occurred: Database upgrade failed: An item with the same key has already been added.
Database upgrade logs:
Beginning database upgrade
Fetching list of already executed scripts.
Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.cs’
Upgrade failed due to an unexpected exception:
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 comparer) at Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.GetProjectActionNameToIdMap(Func
1 commandFactory) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\UpgradeScripts\Script0038 - Convert StepAction-ChannelRule link to use Id not Name.cs:line 33
at Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.ProvideScript(Func1 commandFactory) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\UpgradeScripts\Script0038 - Convert StepAction-ChannelRule link to use Id not Name.cs:line 23 at DbUp.Engine.LazySqlScript.get_Contents() at DbUp.Support.SqlServer.SqlScriptExecutor.Execute(SqlScript script, IDictionary
2 variables)
at DbUp.Engine.UpgradeEngine.PerformUpgrade()
System.Exception: Database upgrade failed: An item with the same key has already been added.
Database upgrade logs:
Beginning database upgrade
Fetching list of already executed scripts.
Executing SQL Server script 'Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.cs’
Upgrade failed due to an unexpected exception:
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 comparer) at Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.GetProjectActionNameToIdMap(Func
1 commandFactory) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\UpgradeScripts\Script0038 - Convert StepAction-ChannelRule link to use Id not Name.cs:line 33
at Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.ProvideScript(Func1 commandFactory) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\UpgradeScripts\Script0038 - Convert StepAction-ChannelRule link to use Id not Name.cs:line 23 at DbUp.Engine.LazySqlScript.get_Contents() at DbUp.Support.SqlServer.SqlScriptExecutor.Execute(SqlScript script, IDictionary
2 variables)
at DbUp.Engine.UpgradeEngine.PerformUpgrade()
—> System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 comparer) at Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.GetProjectActionNameToIdMap(Func
1 commandFactory) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\UpgradeScripts\Script0038 - Convert StepAction-ChannelRule link to use Id not Name.cs:line 33
at Octopus.Core.UpgradeScripts.Script0038ConvertStepActionChannelRuleLink.ProvideScript(Func1 commandFactory) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\UpgradeScripts\Script0038 - Convert StepAction-ChannelRule link to use Id not Name.cs:line 23 at DbUp.Engine.LazySqlScript.get_Contents() at DbUp.Support.SqlServer.SqlScriptExecutor.Execute(SqlScript script, IDictionary
2 variables)
at DbUp.Engine.UpgradeEngine.PerformUpgrade()
— End of inner exception stack trace —
at Octopus.Core.Initialization.DatabaseUpgrader.Upgrade(IRelationalStore store) in Y:\work\refs\tags\3.3.9\source\Octopus.Core\Initialization\DatabaseUpgrader.cs:line 40
at Octopus.Core.Initialization.StoreInitializer.Initialize() in Y:\work\refs\tags\3.3.9\source\Octopus.Core\Initialization\StoreInitializer.cs:line 22
at Octopus.Server.OctopusServerEngine.Start() in Y:\work\refs\tags\3.3.9\source\Octopus.Server\OctopusServerEngine.cs:line 49
at Octopus.Server.Commands.RunCommand.Start() in Y:\work\refs\tags\3.3.9\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.9\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58
at Octopus.Shared.Startup.WindowsServiceHost.<>c__DisplayClass1_0.b__0() in Y:\work\refs\tags\3.3.9\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 19
at Octopus.Shared.Startup.WindowsServiceAdapter.RunService() in Y:\work\refs\tags\3.3.9\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()