Exception while replacing configuration-variable

Hi,

We recently updated our hosted Octopus Deploy server from version 2020.3.2 to version 2020.4.6 and noticed a new problem started to occur with our deploys:

Deploying package:    C:\Octopus\Files\bzp@S7.146.11-tags-release-bzp-v7.146.11@D68CEDBBD24EFD45ABDE349190ECE8F4.zip 

October 19th 2020 09:47:07Info
No matching appSetting, applicationSetting, nor connectionString names were found in: C:\Octopus\Applications\stagingtudor2\Dev\bzp\7.146.11-tags-release-bzp-v7.146.11_2\AppCues.config
October 19th 2020 09:47:07Error
Exception while replacing configuration-variables in: C:\Octopus\Applications\stagingtudor2\Dev\bzp\7.146.11-tags-release-bzp-v7.146.11_2\environment.config
October 19th 2020 09:47:07Error
System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
October 19th 2020 09:47:07Error
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
October 19th 2020 09:47:07Error
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
October 19th 2020 09:47:07Error
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
October 19th 2020 09:47:07Error
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
October 19th 2020 09:47:07Error
at Calamari.Common.Features.ConfigurationVariables.ConfigurationVariablesReplacer.ReadXmlDocument(String configurationFilePath)
October 19th 2020 09:47:07Error
at Calamari.Common.Features.ConfigurationVariables.ConfigurationVariablesReplacer.ModifyConfigurationFile(String configurationFilePath, IVariables variables)
October 19th 2020 09:47:07Error
at Calamari.Common.Features.Behaviours.ConfigurationVariablesBehaviour.Execute(RunningDeployment context)
October 19th 2020 09:47:07Error
at Calamari.Deployment.Conventions.ConfigurationVariablesConvention.Install(RunningDeployment deployment)
October 19th 2020 09:47:07Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions()
October 19th 2020 09:47:07Error
at Calamari.Deployment.ConventionProcessor.RunConventions()
October 19th 2020 09:47:07Error
Running rollback conventions…

This error appears for all of our IIS deploys after update to the new version.

In order to work around this issue we’ve temporarily added the following project variable:

Octopus.Action.Package.IgnoreVariableReplacementErrors true

Investigating the issue further seems to point to a file called environment.config in our project. This file is a JSON formatted file and is the only JSON formatted config file in our project. The error suggests that Octopus Deploy is expecting an XML formatted file and when it can’t find it it errors out.

This did not happen before updating to 2020.4.6 and the JSON formatted file has been in our project for a very long time.

Please help us find a solution to this issue.

Regards,
Karl Brodén

Hey Karl,

Thanks for reaching out. I’m going to try and reproduce the behavior you’re seeing and I will update you as I progress.

Please feel free to reach out in the meantime.

Thanks,
Jeremy

Hey Karl,

Do you by chance know the most recent version you had this working on? You can find the server version in the task log.

Thanks,
Jeremy

Hi,

The last version this worked on was 2020.3.2+Branch.tags-2020.3.2.Sha.0d64b33d41be33a511fe1fab38f207d2348460d4

Hi Karl,

Thanks for the information. And just to be sure I’ve reproduced it on latest with the same behavior as you have, are you just doing a deploy a package step with these options enabled:

Thanks,
Jeremy

Hi,

We don’t have any of those boxes checked in any of our projects:

Regards,
Karl

Hi Karl,

Thanks for the update. The step in question that’s having the problem is just a deploy package step? Would you be able to send me the rest of the settings or is everything default and those 2 check boxes disabled?

Thanks,
Jeremy

Hi,

Yes, that is correct. The step that is having a problem is a deploy package step.
The configuration is pretty much default. Attaching pictures.


1 Like

Hey Karl,

Thanks for all the info and patience. Here is a github issue you can follow for updates: https://github.com/OctopusDeploy/Issues/issues/6633

Please let me know if you have any questions.

Thanks,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.