Upgrade 3.0.9 to 3.2.2 causes System.ArgumentException

Hi guys,

We’ve been using OD Since February (it’s a super product BTW, I’m sorry my first interaction with you is a support request). Since upgrading from 3.0.9 to 3.2.2 on Thursday (and 3.2.3 today) one of our deployments has begun failing:

Transforming ‘C:\O\A\dev.cipfa.org\Forum.Master\7.5.451.399_5\web.config’ using ‘C:\O\A\dev.cipfa.org\Forum.Master\7.5.451.399_5\web.dev.cipfa.org.config’.

12:31:48 Verbose | Executing Replace (transform line 21, 73)

12:31:48 Verbose | on /configuration/system.serviceModel/client/endpoint[@contract=‘CipfaRolesService.RolesSoap’]

12:31:48 Verbose | Applying to ‘endpoint’ element (source line 173, 8)

12:31:48 Verbose | Replaced ‘endpoint’ element

12:31:48 Verbose | Done executing Replace

12:31:48 Error | System.ArgumentException: Second path fragment must not be a drive or UNC name.

12:31:48 Error | Parameter name: path2

12:31:48 Error | at System.IO.Path.InternalCombine(String path1, String path2)

12:31:48 Error | at System.IO.FileSystemEnumerableIterator`1.GetFullSearchString(String fullPath, String searchPattern)

12:31:48 Error | at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost)

12:31:48 Error | at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)

12:31:48 Error | at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.b__1(String pattern) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 183

12:31:48 Error | at System.Linq.Enumerable.d__14`2.MoveNext()

12:31:48 Error | at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.ApplyTransformations(String sourceFile, IEnumerable1 transformations, HashSet1 alreadyRun) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 68

12:31:48 Error | at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 46

12:31:48 Error | at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60

12:31:48 Error | at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28

12:31:48 Error | Running rollback conventions…

I don’t think it’s the contents of the config transforms that are causing the errors, it seems to be their paths. OD is configured to run website transforms against this rule:

*.#{websiteUrl}.config => *.config

And there are only two config files to transform.

This is the second step in a multi-step deployment. The first deploys a site and the second an application running under it. The first deployment works correctly. #{websiteUrl} is resolving correctly, since that is used in the first deployment.

Do you have any ideas where I might look for the issue? OD is not configured to use any network drives, only local folders.

Thank you!

Kaylee.

hi,

i’m getting this issue on 3.2.2 as well - it only seems to happen if I try *.foo.config => *.config

if I use
*.foo.xml => *.xml
it works as expected.

i’ve only just started trying this with *.config files rather than xml files, so can’t be certain when this started

thanks
Jon

Hi Kaylee & Jonathan,

Thanks for getting in touch and I’m sorry to hear you are having these issues!

I’ve had a quick look and added your specific transform scenario to our tests in Calamari and it is failing. I’ve raised #2154 to have this investigated and fixed as soon as possible.

The workaround for now would be to not use wildcards in the transform definition but instead use the actual prefix (i.e. web.#{webSiteUrl}.config => web.config) but that might not be feasible in your scenario.

Thank you and warm regards,
Henrik

Hi Kaylee,

I’m having a look at the issue with configuration transforms and I am having trouble reproducing it. I can get the same exception that you are getting by including “//” or “\” in my configuration transform definition. eg:

*.//foo.config => *.config

So, I’m wondering if #{websiteUrl} is resolving to something with slashes in it? (Like http://)

Appreciate the extra information.

Cheers,
Shane

I’m afraid not- they’re in the format host.domain.ext. I’ve attached some screenshots so perhaps that might help replicating the problem : ) I can always attach the actual files and the deployment step details if you would like.

Screenshots.zip (18 KB)

Hi Kaylee,

Thanks for getting back to me. I’ve added some extra logging in Calamari (it does the transforms) to help determine what is causing the issue.

You can wait for the next Octopus release or download the attached NuGet package on your Octopus Server and add the following line to your Octopus.Server.config (usually in C:\Octopus\OctopusServer):

<set key="Octopus.Deployment.CustomBundledPackageDirectory">C:\Calamari\built-packages</set>

(Replacing C:\Calamari\built-packages with the location of the Calamari NuGet package.)

It should give a line like this when the deployment fails:

Could not transform the file 'C:\Octopus\Applications\MultiPack\1\Octo.exe.config' using the wildcard pattern '\\Release.config'.

Cheers
Shane

Calamari.3.1.19-ci0006.nupkg (7 MB)

I also have this problem with v 3.2.7

12:13:49   Error    |       System.ArgumentException: Second path fragment must not be a drive or UNC name.
12:13:49   Error    |       Parameter name: path2
12:13:49   Error    |       at System.IO.Path.InternalCombine(String path1, String path2)
12:13:49   Error    |       at System.IO.FileSystemEnumerableIterator`1.GetFullSearchString(String fullPath, String searchPattern)
12:13:49   Error    |       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler)
12:13:49   Error    |       at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
12:13:49   Error    |       at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.<EnumerateFiles>b__1(String pattern) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 183
12:13:49   Error    |       at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
12:13:49   Error    |       at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.ApplyTransformations(String sourceFile, IEnumerable`1 transformations, HashSet`1 alreadyRun) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 68
12:13:49   Error    |       at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 46
12:13:49   Error    |       at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
12:13:49   Error    |       at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
12:13:49   Error    |       Running rollback conventions...
12:13:49   Verbose  |       Adding journal entry:
12:13:49   Verbose  |       <Deployment Id="17b7523a-435b-471d-8f25-d74fd955b2a3" EnvironmentId="Environments-2" ProjectId="Projects-29" PackageId="Nzte-WebNode" PackageVersion="6.14.371" InstalledOn="2016-02-09 23:13:45" ExtractedFrom="C:\Octopus\Files\Nzte-WebNode.6.14.371.nupkg-902f37f3-16d9-431f-8dee-dee5c3fb6b60" ExtractedTo="D:\wwwdeployment\dev\Nzte-WebNode\6.14.371_1" RetentionPolicySet="Environments-2/Projects-29/Step-Deploy NZTE WebNodes/Machines-3/&lt;default&gt;" CustomInstallationDirectory="" WasSuccessful="False" />
12:13:49   Error    |       System.ArgumentException: Second path fragment must not be a drive or UNC name.
12:13:49   Error    |       Parameter name: path2
12:13:49   Error    |       at System.IO.Path.InternalCombine(String path1, String path2)
12:13:49   Error    |       at System.IO.FileSystemEnumerableIterator`1.GetFullSearchString(String fullPath, String searchPattern)
12:13:49   Error    |       at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler)
12:13:49   Error    |       at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
12:13:49   Error    |       at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.<EnumerateFiles>b__1(String pattern) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 183
12:13:49   Error    |       at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
12:13:49   Error    |       at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.ApplyTransformations(String sourceFile, IEnumerable`1 transformations, HashSet`1 alreadyRun) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 68
12:13:49   Error    |       at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 46
12:13:49   Error    |       at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
12:13:49   Error    |       at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 50
12:13:49   Error    |       at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 109
12:13:49   Error    |       at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
12:13:50   Fatal    |       The remote script failed with exit code 100

Hi Murray,

Thanks for getting in touch! I would love to see your full logs to help diagnose the issue. http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task
I would suggest making another thread and marking it private or everyone on this thread will see your logs.

Thanks!
Vanessa