Deploy Fails with Illegal Chars In Path ArgumentException

Hello,

Using Octopus Server 3.3.17, we are getting this error during deployment of a Nuget package step.

System.ArgumentException: Illegal characters in path.

This happens right after a variable substitution step:

Performing variable substitution on ‘C:\Octopus\Applications\QAWeb20\HA.Web.Main\16.06.08.8493_7\Web.config’

I’m not sure if it is happening within the variable substitution step, or whatever comes next.

Is there some way to find out what the path in question is?

Below is the call stack from the error log:

Thanks,

Alan

09:44:10Error
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
09:44:10Error
at System.IO.Path.InternalCombine(String path1, String path2)
09:44:10Error
at System.IO.FileSystemEnumerableIterator1.GetFullSearchString(String fullPath, String searchPattern) 09:44:10Error at System.IO.FileSystemEnumerableIterator1…ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) 09:44:10Error at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption) 09:44:10Error at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.<EnumerateFiles>b__1(String pattern) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 184 09:44:10Error at System.Linq.Enumerable.<SelectManyIterator>d__12.MoveNext()
09:44:10Error
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 09:44:10Error at System.Collections.Generic.List1…ctor(IEnumerable1 collection) 09:44:10Error at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
09:44:10Error
at Calamari.Deployment.Conventions.SubstituteInFilesConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\SubstituteInFilesConvention.cs:line 26
09:44:10Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
09:44:10Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
09:44:10Error
Running rollback conventions…
09:44:10Error
System.ArgumentException: Illegal characters in path.
09:44:10Error
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
09:44:10Error
at System.IO.Path.InternalCombine(String path1, String path2)
09:44:10Error
at System.IO.FileSystemEnumerableIterator1.GetFullSearchString(String fullPath, String searchPattern) 09:44:10Error at System.IO.FileSystemEnumerableIterator1…ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) 09:44:10Error at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption) 09:44:10Error at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.<EnumerateFiles>b__1(String pattern) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 184 09:44:10Error at System.Linq.Enumerable.<SelectManyIterator>d__12.MoveNext()
09:44:10Error
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 09:44:10Error at System.Collections.Generic.List1…ctor(IEnumerable1 collection) 09:44:10Error at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source)
09:44:10Error
at Calamari.Deployment.Conventions.SubstituteInFilesConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\SubstituteInFilesConvention.cs:line 26
09:44:10Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
09:44:10Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 50
09:44:10Error
at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 108
09:44:10Error
at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
09:44:10Fatal
The remote script failed with exit code 100

This deployment step had the “Replace appSettings and connectionString entries in any .config files” setting enabled, which we were not using.

I disabled this setting and this resolved the problem.

If possible I would like to understand what caused this, since this project has been deployed numerous times before without issues.

Hi @avalanchis,

Thanks for reaching out, and glad to hear you found a workaround for your problem.

If you wanna keep troubleshooting this, I’d need to see the content of the Appsettings and connectionstring settings in your .config files. Apparently there was an invalid character in one of them that Octopus wasn’t able to parse.

If you can send the config files, I can check this for you.

Thanks,
Dalmiro