Configuration Variables option filter in deployment step?

Hi,

We’re using Octopus to deploy a web application which is using a Node package that gots a JSON file that’s got an extension of .config. Go knows why they did that instead of .json, but it’s causing Octopus to error with the below message:

Exception while replacing configuration-variables in: C:\Octopus\Applications\MyProject\MyProduct\1.0.94.0\node_modules\typescript\test.config December 15th 2016 10:23:34Error System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. December 15th 2016 10:23:34Error at System.Xml.XmlTextReaderImpl.Throw(Exception e) December 15th 2016 10:23:34Error at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() December 15th 2016 10:23:34Error at System.Xml.XmlTextReaderImpl.ParseDocumentContent() December 15th 2016 10:23:34Error at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) December 15th 2016 10:23:34Error at Calamari.Integration.ConfigurationVariables.ConfigurationVariablesReplacer.ReadXmlDocument(String configurationFilePath) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Integration\ConfigurationVariables\ConfigurationVariablesReplacer.cs:line 63 December 15th 2016 10:23:34Error at Calamari.Integration.ConfigurationVariables.ConfigurationVariablesReplacer.ModifyConfigurationFile(String configurationFilePath, VariableDictionary variables) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Integration\ConfigurationVariables\ConfigurationVariablesReplacer.cs:line 54 December 15th 2016 10:23:34Error at Calamari.Deployment.Conventions.ConfigurationVariablesConvention.Install(RunningDeployment deployment) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationVariablesConvention.cs:line 32 December 15th 2016 10:23:34Error at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60 December 15th 2016 10:23:34Error at Calamari.Deployment.ConventionProcessor.RunConventions() in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28 December 15th 2016 10:23:34Error Running rollback conventions... December 15th 2016 10:23:34Error System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. December 15th 2016 10:23:34Error at System.Xml.XmlTextReaderImpl.Throw(Exception e) December 15th 2016 10:23:34Error at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() December 15th 2016 10:23:34Error at System.Xml.XmlTextReaderImpl.ParseDocumentContent() December 15th 2016 10:23:34Error at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) December 15th 2016 10:23:34Error at Calamari.Integration.ConfigurationVariables.ConfigurationVariablesReplacer.ReadXmlDocument(String configurationFilePath) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Integration\ConfigurationVariables\ConfigurationVariablesReplacer.cs:line 63 December 15th 2016 10:23:34Error at Calamari.Integration.ConfigurationVariables.ConfigurationVariablesReplacer.ModifyConfigurationFile(String configurationFilePath, VariableDictionary variables) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Integration\ConfigurationVariables\ConfigurationVariablesReplacer.cs:line 54 December 15th 2016 10:23:34Error at Calamari.Deployment.Conventions.ConfigurationVariablesConvention.Install(RunningDeployment deployment) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationVariablesConvention.cs:line 32 December 15th 2016 10:23:34Error at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60 December 15th 2016 10:23:34Error at Calamari.Deployment.ConventionProcessor.RunConventions() in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 50 December 15th 2016 10:23:34Error at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 116 December 15th 2016 10:23:34Error at Calamari.Program.Execute(String[] args) in Z:\buildAgent\workDir\14ffc968155e4956\source\Calamari\Program.cs:line 45 December 15th 2016 10:23:35Fatal The remote script failed with exit code 100

Is there any way to add an exclusion to the step? For now we’ve not used it and got a community step template to do this.

Thanks.

Hi,

Thanks for getting in touch! There are a few ideas we have that you can use to get this deployment working.

The first of which is to rename the test.config file to get it past the transformation, then script the post-deploy to rename it back after the transformations have been run.

The next idea which you could try is scripting the Pre-deploy to rename the file and have the post-deploy change it back, this would give you a bit more automation than the above method.

The final thing you could do is disable enable the “Don’t show transformation errors” variable. This can be done by creating the variable Octopus.Action.Package.IgnoreConfigTransformationErrors and setting it to true. See Suppressing Configuration Transformation Errors down the bottom of the following page: http://docs.octopus.com/display/OD/Configuration+files
With this method, you will need to manually ensure that your transformations are being run correctly.

Let me know if this helps or if you have any further questions.

Best regards,
Daniel