Ran into the following error multiple times trying to upgrade from 2018.9.3 to 2018.9.6:
INFO Executing .NET Database Server script ‘Octopus.Core.UpgradeScripts.Script0132CorrectDanglingPackageReferences.cs’
INFO Channel ‘Tenant.TeamA’ of project ‘Email’ contains an invalid package reference. Let’s correct that…
INFO Deployment action ‘Deploy Web.Api’ references only one package. Updating to use package ‘#{ServiceName}’ () => Input string was not in a correct format.
FATAL We encountered an error during the schema upgrade. The schema upgrade was stopped and rolled back. Don’t worry, this means we haven’t made any changes to your data, and you should be able to get back up and running quickly.
Here is the summary of the problems we encountered:
Input string was not in a correct format.
System.FormatException
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.Text.StringBuilder.AppendFormat(String format, Object[] args)
at Octopus.Core.Initialization.DatabaseUpgraderLogAdapter.WriteInformation(String format, Object[] args)
at Octopus.Core.UpgradeScripts.Script0132CorrectDanglingPackageReferences.SanitizeDeploymentActionPackage(Func1 dbCommandFactory, JObject deploymentActionPackage, IDictionary
2 deploymentActions, String humanIdentifier, IUpgradeLog log)
at CallSite.Target(Closure , CallSite , Script0132CorrectDanglingPackageReferences , Func1 , Object , IDictionary
2 , String , IUpgradeLog )
at Octopus.Core.UpgradeScripts.Script0132CorrectDanglingPackageReferences.SanitizeChannelRules(Func1 dbCommandFactory, String projectId, JObject project, String projectName, IDictionary
2 deploymentActions, IUpgradeLog log)
at Octopus.Core.UpgradeScripts.Script0132CorrectDanglingPackageReferences.Execute(Func1 commandFactory, IUpgradeLog log) at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.<>c__DisplayClass5_0.<ExecuteDbCommandUpgradeScript>b__0(Func
1 commandFactory)
at DbUp.Engine.Transactions.SingleTrasactionStrategy.Execute(Action`1 action)
at Octopus.Core.Initialization.DatabaseUpgrader.OctopusUpgradeScriptExecutor.ExecuteDbCommandUpgradeScript(IConnectionManager connectionManager, IJournal journal, IDbCommandUpgradeScript upgradeScript)
at DbUp.Engine.UpgradeEngine.PerformUpgrade()
This put the project in question in an unusable state, where it would just show “The given key was not present in the dictionary.” when navigating to it in the Octopus UI. I was able to determine that this was caused by a corrupt channel list by using the API, so I had to delete all releases in order to delete the channels for that project one by one. Once i was left with a single channel (the default), the project would load properly in the UI.
Hoping this was just a single corrupt project, i re-tried the upgrade but ran into the same issue on another one of our projects, so it seems to be an issue with the upgrade process.
I normally upgrade once a week to the latest version and haven’t had any issues prior to the 2018.9.6 version. Seems like ‘Octopus.Core.UpgradeScripts.Script0132CorrectDanglingPackageReferences.cs’ is a good place to start…