"Could not transform the file" misleading error message

We came across this error message, but it was pointing in the opposite direction to the real error:

Could not transform the file 'D:\Octopus\Applications\xx-UK-UAT\xx-UK-UAT\Spendvision.Mobile\2019.2.1364-RC\Website\api\Content\C_C\BuildAgent\work\bc6f8ca4640d0775\Mobile\obj\api\Release\Package\PackageTmp\WebConfig\Saml.Configuration.TrustedIssuers_OneWithAuthenticationType.config' using the pattern 'Release'. 
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Octopus\Applications\xx-UK-UAT\xx-UK-UAT\Spendvision.Mobile\2019.2.1364-RC\Website\api\Content\C_C\BuildAgent\work\bc6f8ca4640d0775\Mobile\obj\api\Release\Package\PackageTmp\WebConfig'.

The real error appeared to be due to the long filename. Note the there is no corresponding .release.config file for the Saml.Configuration.TrustedIssuers_OneWithAuthenticationType.config file. So Octopus should not have been attempting to transform the file in the first place.

We fixed the problem by shortening the path for the directory where the .nupkg is unpacked.

Suggestion: please supply a more informative error message in this situation?

Hi @dwhite

Thanks for getting in touch, and sorry for the delay in getting back to you on this one.

This particular error message (as I’m sure you already know) is a system message, which unfortunately makes it difficult for us to override the error message. Not technically, as that is fairly straightforward, but knowing when this issue is referring to long file paths, as opposed to other issues, would be the problem we encounter.

The key here, from our point of view, is in the definition of the error, specifically The exception that is thrown when part of a file or directory cannot be found. That is technically accurate in this case, although the cause is different from what you would expect (long file path rather than missing folders/files).

At this stage this isn’t something that we are willing to investigate engineering time into, although that could change in future.

Sorry that I don’t have a better answer for you,


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