Seems to be the same error as previously reported here:
and here:
https://help.octopus.com/t/problem-with-config-file-transformation/6688/3
Neither of these contain solutions that work.
We have Windows targets that this step works fine on.
When deploying to a Linux (Ubuntu 20.04) target we get the error xsi is an undeclared prefix
System.Xml.XmlException: 'xsi' is an undeclared prefix. Line 2, position 17.
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node)
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.AttributeNamespaceLookup()
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.ParseAttributes()
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.ParseElement()
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
September 9th 2020 14:33:28
Error
at System.Xml.XmlTextReaderImpl.Read()
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlAttributePreservationDict.EnumerateAttributes(String elementStartTag, Action`3 onAttributeSpotted)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlAttributePreservationDict.ReadPreservationInfo(String elementStartTag)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlAttributePreservationProvider.GetDictAtPosition(Int32 lineNumber, Int32 linePosition)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlFileInfoDocument.XmlFileInfoElement..ctor(String prefix, String localName, String namespaceUri, XmlFileInfoDocument document)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlFileInfoDocument.CreateElement(String prefix, String localName, String namespaceURI)
September 9th 2020 14:33:28
Error
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
September 9th 2020 14:33:28
Error
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
September 9th 2020 14:33:28
Error
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
September 9th 2020 14:33:28
Error
at System.Xml.XmlDocument.Load(XmlReader reader)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlFileInfoDocument.LoadFromTextReader(TextReader textReader)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlFileInfoDocument.LoadFromFileName(String filename)
September 9th 2020 14:33:28
Error
at Octopus.Web.XmlTransform.XmlFileInfoDocument.Load(String filename)
September 9th 2020 14:33:28
Error
at Calamari.Common.Features.ConfigurationTransforms.ConfigurationTransformer.ApplyTransformation(String configFile, String transformFile, String destinationFile, IXmlTransformationLogger logger) in C:\buildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\ConfigurationTransforms\ConfigurationTransformer.cs:line 85
September 9th 2020 14:33:28
Error
at Calamari.Common.Features.ConfigurationTransforms.ConfigurationTransformer.PerformTransform(String configFile, String transformFile, String destinationFile) in C:\buildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\ConfigurationTransforms\ConfigurationTransformer.cs:line 34
September 9th 2020 14:33:28
Error
Could not transform the file '/home/Octopus/Applications/.../3.66.0-fix-deployment-s0002/nlog.config' using the pattern 'Release'.
As far as transformations go our nlog configs are not complicated
nlog.config
<nlog autoReload="true"
xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="csv"
xsi:type="File"
...>
<layout xsi:type="CSVLayout">
...
</layout>
</target>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="csv" />
</rules>
</nlog>
nlog.Release.config
<nlog
xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<targets>
<target name="csv" fileName="#{LogPath}" archiveFileName="#{LogArchivePath}" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</targets>
<rules>
<logger name="*" minlevel="Info" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" />
</rules>
</nlog>
This does feel like an issue in the Octopus config transformation code, especially as the stacktrace shows it and it already works on Windows. Running this through online transformation checkers also shows no errors.