I get the an error in deploy when Octopus applies the web.release.config transform.
Note that I am not concerned with the warnings. But the exception is the thing fails the deploy.
Info 14:56:06
Transforming 'e:\Octopus\Applications\MyEnv\MyApp\1000.0.0.2316_1\Web.config'.
Warning 14:56:06
(25:8) No element in the source document matches '/configuration/dataCacheClient/hosts/host[@name='localhost']'
Warning 14:56:06
(31:18) Argument 'debug' did not match any attributes
Error 14:56:06
Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Web.XmlTransform.XmlTransformationLogger.LogWarning(XmlNode referenceNode, String message, Object[] messageArgs)
at Microsoft.Web.XmlTransform.RemoveAttributes.Apply()
at Microsoft.Web.XmlTransform.Transform.ApplyOnAllTargetNodes()
Fatal 14:56:06
One or more errors were encountered when applying the XML configuration transformation file: e:\Octopus\Applications\MyEnv\MyApp\1000.0.0.2316_1\Web.Release.config. View the deployment log for more details, or set the special variable Octopus.Action.Package.IgnoreConfigTranformationErrors to True to ignore this error.
Thanks for getting in touch. The null reference exception comes from deep within the configuration transformation code from Microsoft and there’s not much we can do about it. It’s actually directly caused by the warning about the missing ‘debug’ attribute - basically, it gets told to remove an attribute, but can’t find it, logs a warning, then attempts to remove it anyway and throws.
There are two things you can do:
Fix the transform/config file so that the attribute does exist (thus no warning, and no error), or
Create a variable called Octopus.Action.Package.IgnoreConfigTranformationErrors with a value of True to ignore the warnings and error.
Thanks for pointing that out! I have created a GitHub issue to add a new variable with the correct spelling, while also keeping the other so both will work.
You can track the issue here if you feel the need to update to the correct spelling once it’s done! https://github.com/OctopusDeploy/Issues/issues/1225