Path Too long exception

I am trying to deploy a package and getting Path too long exception. We didn’t get this error in the past. It was working perfectly fine until the last deployment. Any idea why it is causing.

    Deploying package:    C:\Octopus\Files\empower-medseek-api.6.7.665.nupkg-2996dbef-a1ef-49b1-9062-06d7157f46da
    December 11th 2020 13:11:50Error
    System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
    December 11th 2020 13:11:50Error
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    December 11th 2020 13:11:50Error
       at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
    December 11th 2020 13:11:50Error
       at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
    December 11th 2020 13:11:50Error
       at Calamari.Integration.Packages.NuGet.NupkgExtractor.Extract(String packageFile, String directory, Boolean suppressNestedScriptWarning)
    December 11th 2020 13:11:50Error
       at Calamari.Deployment.Conventions.ExtractPackageConvention.Install(RunningDeployment deployment)
    December 11th 2020 13:11:50Error
       at Calamari.Deployment.ConventionProcessor.RunInstallConventions()
    December 11th 2020 13:11:50Error
       at Calamari.Deployment.ConventionProcessor.RunConventions()
    December 11th 2020 13:11:50Error
    Running rollback conventions...
    December 11th 2020 13:11:51Error
    Value cannot be null.
    December 11th 2020 13:11:51Error
    Parameter name: path
    December 11th 2020 13:11:51Error
    System.ArgumentNullException
    December 11th 2020 13:11:51Error
       at System.IO.DirectoryInfo..ctor(String path)
    December 11th 2020 13:11:51Error
       at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.EnumerateFiles(String parentDirectoryPath, String[] searchPatterns)
    December 11th 2020 13:11:51Error
       at Calamari.Integration.Scripting.PackagedScriptRunner.FindScripts(RunningDeployment deployment)
    December 11th 2020 13:11:51Error
       at Calamari.Integration.Scripting.PackagedScriptRunner.RunScripts(RunningDeployment deployment)
    December 11th 2020 13:11:51Error
       at Calamari.Deployment.ConventionProcessor.RunRollbackConventions()
    December 11th 2020 13:11:51Error
       at Calamari.Deployment.ConventionProcessor.RunConventions()
    December 11th 2020 13:11:51Error
       at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments)
    December 11th 2020 13:11:51Error
       at Calamari.Program.Execute(String[] args)
    December 11th 2020 13:11:52Error
    The remote script failed with exit code 100
    December 11th 2020 13:12:24Fatal
    Deploy medseek-api package on AZ-AQA-WEB-01_Tentacle

Hi @hjulapelli!

Thanks for reaching out, and sorry to hear that you’re hitting the long filename issues when deploying. You generally have a couple of options here:

  1. (Recommended) Enable long paths on your server, if it’s something you have control over. You can find more details about this on Microsoft’s docs here: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

  2. (Workaround) You can adjust your deployment/packages in ways that reduce your overall path length - you can use a custom install directory, if you’re not, or rework the package name to try and shorten things up. As this is a laborious process, that will likely need to be done manually on each project, we recommend using option 1 above.

I hope this helps, and please let me know if you have any further questions.

Thank you @Justin_Walsh for your quick response.

I have tried following the steps mentioned in the Microsoft doc which you send and enabled long paths by adding a registry key. But still, the issue is persisting.

Also, another concern for me is, this was all working until last week. I double-checked there aren’t changes in the deployment step. Wondering what caused this issue.

Hi @hjulapelli!

You’ll likely need to restart the machine (but you might be able to get away with just restarting the Octopus Tentacle service) to get the registry change to take effect - so hopefully, that’s something that can happen in your next maintenance period.

I’m not sure what exactly could have caused it here - were new files/subfolders added to your package that were not there last time it worked? If you were just under, and adding another directory layer to the path (or a longer filename) could have pushed you over the 260 character limit.

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