XPath and Structured Configuration Variables gotcha

This is not necessarily a bug in Octopus, but I thought it may help others in the future.

I’m using the XPath variable replacement available when using the ‘Structured Configuration Variables’ (SCV) feature.

I had these 2 variables defined:

  • WebURL
  • /configuration/appSettings/@key='WebURL'

Since the SCV feature can handle both formats, it doesn’t actually like you including the full XPath version.
If you do you will get an XPath exception:

    System.NullReferenceException: Object reference not set to an instance of an object.
08:25:45   Error    |       at System.Xml.XPath.XPathNodeIterator.Enumerator.get_Current()
08:25:45   Error    |       at Calamari.Common.Features.StructuredVariables.XmlFormatVariableReplacer.ModifyFile(String filePath, IVariables variables)

Removing the XPath version of the variables fixes the issue.

Cheers

Hi Tony,

Thanks for letting us know, great pickup!

Regards,
Alex

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