Transform failing on Prod server

I’m trying to transform a Release.web.config into my web.config on my prod server. I’m applying the same transform in test and it works fine. I have removed Run default XML transforms from my deployment step and defined my transform under additional transforms with Web.Release.config => Web.config.

Here’s the error I’m getting from my prod deployment…
System.Xml.XmlException: ‘<;’, hexadecimal value 0x3C, is an invalid attribute character. Line 34, position 238.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlDocument.Load(XmlReader reader)
at Microsoft.Web.XmlTransform.XmlFileInfoDocument.LoadFromTextReader(TextReader textReader)
at Microsoft.Web.XmlTransform.XmlFileInfoDocument.LoadFromFileName(String filename)
at Microsoft.Web.XmlTransform.XmlFileInfoDocument.Load(String filename)
at Microsoft.Web.XmlTransform.XmlTransformation…ctor(String transform, Boolean isTransformAFile, IXmlTransformationLogger logger)
at Calamari.Integration.ConfigurationTransforms.ConfigurationTransformer.ApplyTransformation(String configFile, String transformFile, String destinationFile, IXmlTransformationLogger logger)
at Calamari.Integration.ConfigurationTransforms.ConfigurationTransformer.PerformTransform(String configFile, String transformFile, String destinationFile)

Hi Klay,

​Thanks for getting in touch! I’ve responded to your question you sent us via email, but in case you don’t see it I’ll paste it here as well. :slight_smile:

I suspect there’s a < character defined somewhere outside of the designated tag syntax which is throwing this error. Is it possible that a different config file with this syntax issue is being used in your production environment and not in your test environment? If this is the case, you’d need to escape this character by using &lt; in its place.

​If this isn’t relevant to your scenario, could you provide the full verbose deployment logs with debugging variables enabled to provide us with more context? The following doc page outlines how to produce and export this log.
​https://octopus.com/docs/support/how-to-turn-on-variable-logging-and-export-the-task-log

​I look forward to hearing back!

​Best regards,

Thanks for the response but I was able to eventually fix the problem. The transform had a setting to remove debug attributes, once I removed that line from the config it started working. Not sure if octopus removes that from the config automatically when deploying to a prod environment and that was causing the error or what because it ran fine on test. :man_shrugging:t2:

Thanks,

Klay

Hi Klay,

Thanks for following up and letting me know! That’s great to hear you’ve fixed the issue. Don’t hesitate to reach out if you have any further questions or concerns moving forward. :slight_smile:

Best regards,

Kenny

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