System.IO.DirectoryNotFoundException: Could not find a part of the path ending in .bin

Hi, I just upgraded the octopus server and tentacles to 3.1.3. My seemingly simple deploy now doesn’t work.

The deploy is set to fetch a nuget package from teamcity (which works fine) then deploy it using a powershell script specified in the deployment script section. The process is also set to replace app settings, and configure transforms.

The first time I tried to deploy after upgrading I got this same error except with the path 'C:\Octopus\Applications\Staging\ProjectName\1.0.775_1\NLog.bin'. Thinking that this was an issue maybe with running the NLog nuget package install script during deploy I disabled the “Automatically run configuration transformation files” option and added in my Web.config file in additional transforms. That changed the error to be the app-touch-icon file which leaves me baffled what’s going on. This is just a straight content file, of course there shouldn’t be any bin file.

All the files that should be in the working directory are there for every deploy so I’m not sure what’s going on.

Full error:

Deploying package 'C:\Octopus\Files\ProjectName.nupkg-c43ab896-b96c-412b-8c14-a9c7f9dd08ff' to machine 'https://50.196.32.107:10933/'
11:45:02Info
Deploying package:    C:\Octopus\Files\ProjectName.nupkg-c43ab896-b96c-412b-8c14-a9c7f9dd08ff
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Octopus\Applications\Staging\ProjectName\1.0.775_1\apple-touch-icon-120x120.bin'.
11:45:05Error
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
11:45:05Error
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
11:45:05Error
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
11:45:05Error
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
11:45:05Error
   at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.<EnumerateFiles>b__1(String pattern) in Y:\work\b1fd300731d5f2fc\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 183
11:45:05Error
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
11:45:05Error
   at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.ApplyTransformations(String sourceFile, IEnumerable`1 transformations, HashSet`1 alreadyRun) in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 68
11:45:05Error
   at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 46
11:45:05Error
   at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 60
11:45:05Error
   at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 28
Running rollback conventions...
11:45:05Error
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Octopus\Applications\Staging\ProjectName\1.0.775_1\apple-touch-icon-120x120.bin'.
11:45:05Error
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
11:45:05Error
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
11:45:05Error
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
11:45:05Error
   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)
11:45:05Error
   at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.<>c__DisplayClass11_0.<EnumerateFiles>b__1(String pattern) in Y:\work\b1fd300731d5f2fc\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 183
11:45:05Error
   at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
11:45:05Error
   at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.ApplyTransformations(String sourceFile, IEnumerable`1 transformations, HashSet`1 alreadyRun) in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 68
11:45:05Error
   at Calamari.Deployment.Conventions.ConfigurationTransformsConvention.Install(RunningDeployment deployment) in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\Conventions\ConfigurationTransformsConvention.cs:line 46
11:45:05Error
   at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 60
11:45:05Error
   at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\b1fd300731d5f2fc\source\Calamari\Deployment\ConventionProcessor.cs:line 50
11:45:05Error
   at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Y:\work\b1fd300731d5f2fc\source\Calamari\Commands\DeployPackageCommand.cs:line 105
11:45:05Error
   at Calamari.Program.Execute(String[] args) in Y:\work\b1fd300731d5f2fc\source\Calamari\Program.cs:line 27
11:45:06Error
The remote script failed with exit code 100

Hi Dillon,

That is odd. Could you please send through the content of the ‘Additional transforms’ field for the step?

Regards,
Michael

Before experimenting it was just
bin/Web.Application.config

When I turned off automatic transforms I added Web.config so it’s

bin/Web.Application.config Web.config

Sorry, formatting screwed up the second example, they’re on separate lines:

bin/Web.Application.config 
Web.config

Dillon,

I’m assuming you are wanting to apply the bin/Web.Application.config transformation to the Web.config in the root of your package?

If so, unfortunately, this is not supported. The transform and target configuration file must be in the same directory. Then you can configure this as:
Web.Application.config => Web.config (no directories are required).

You only need to enable Automatically run configuration transformation files if you have Web.Release.config or Web.[Environment].config transforms that you wish to be applied automatically.

I think what has happened is that you had your transform configured in a way that was never exactly supported, and was working via a loop-hole that was present in 2.x. In 3.x, we inadvertently closed that loop-hole.

I hope this helps. If we can be of any further assistance, don’t hesitate to ask.

Regards,
Michael

No, I want to transform both the bin/Web.Application.config and the main Web.config to their respective Web.[Environment].config

Just doing some experimenting I found that just removing the bin/Web.Application.config line in additional transforms fixed the issue. As you said, there must have been something in 2.x that made this required to pick it up.

Oh, I see. In that case, yes, simply enabling Automatically run configuration transformation files should be enough.

I’m glad you got it working.

Happy deployments,
Michael