Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format exception executing database upgrade script Script0132CorrectDanglingPackageReferences #5079

Closed
MJRichardson opened this issue Nov 12, 2018 · 2 comments

Comments

@MJRichardson
Copy link

commented Nov 12, 2018

In Octopus 2018.9.5 we changed the way we use DbUp to run our upgrade scripts. As a consequence, when logging messages during upgrades, every message is interpreted as a format string. If the logged message contains an Octopus variable expression (e.g. #{ServiceName}) then the logging framework parses that as a format expression (an invalid one of course).

Reported by https://help.octopus.com/t/error-upgrading-from-v2018-9-3-to-v2018-9-6/21733

The exception stack trace appears similar to:

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, IDictionary2 deploymentActions, String humanIdentifier, IUpgradeLog log)
at CallSite.Target(Closure , CallSite , Script0132CorrectDanglingPackageReferences , Func1 , Object , IDictionary2 , String , IUpgradeLog )
at Octopus.Core.UpgradeScripts.Script0132CorrectDanglingPackageReferences.SanitizeChannelRules(Func1 dbCommandFactory, String projectId, JObject project, String projectName, IDictionary2 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(Func1 commandFactory)
at DbUp.Engine.Transactions.SingleTrasactionStrategy.Execute(Action`1 action)
@MJRichardson MJRichardson self-assigned this Nov 12, 2018
@octoreleasebot octoreleasebot added this to the 2018.9.9 milestone Nov 14, 2018
@octoreleasebot

This comment has been minimized.

Copy link

commented Nov 14, 2018

Release Note: Resolved logging format exception when executing database upgrade script

@lock

This comment has been minimized.

Copy link

commented Feb 12, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.