I recently ran into an issue with the Deploy Package Step: Already having quite a long path with the Octopus-Home\Applications[TenantName][EnvironmentName][PackageName][ReleaseName] folder on my tentacle (due to long tenant, environment and package names), the files and folders in my extracted nuget package result in a path that easily exceed 260 characters. The deployment then ends up with an error saying System.IO.DirectoryNotFoundException: Could not find a part of the path ‘[very long path]’
FYI: I’m running a Windows Server 2019 with tentacle version 6.3.305 (Calamari v25.3.3)
I found some issues related to that topic
12:38PM - 04 Dec 15 UTC
11:25PM - 06 Dec 15 UTC
I have packaged up an ASP.NET 5 application into a NuGet package. When deploying
… this NuGet Package through Octopus (standard NuGet package step with no optional features) - the deployment falls over with this error:
Deploying package 'C:\Octopus\Files\WebApplication.Mvc.1.0.490.nupkg-bc3e15a8-e654-4d96-8057-5d374a700c0b' to machine 'https://rchdevweb01:10933/'
Deploying package: C:\Octopus\Files\WebApplication.Mvc.1.0.490.nupkg-bc3e15a8-e654-4d96-8057-5d374a700c0b
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.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetDirectoryName(String path)
at Calamari.Integration.Packages.LightweightPackageExtractor.Install(String packageFile, String directory, Boolean suppressNestedScriptWarning, Int32& filesExtracted) in Y:\work\14ffc968155e4956\source\Calamari\Integration\Packages\LightweightPackageExtractor.cs:line 79
at Calamari.Deployment.Conventions.ExtractPackageConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ExtractPackageConvention.cs:line 28
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
Running rollback conventions...
System.ArgumentNullException: Value cannot be null.
Parameter name: path
at System.IO.DirectoryInfo..ctor(String path)
at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.EnumerateFiles(String parentDirectoryPath, String searchPatterns) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 179
at Calamari.Integration.Scripting.PackagedScriptRunner.FindScripts(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Integration\Scripting\PackagedScriptRunner.cs:line 55
at Calamari.Integration.Scripting.PackagedScriptRunner.RunScripts(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Integration\Scripting\PackagedScriptRunner.cs:line 29
at Calamari.Deployment.ConventionProcessor.RunRollbackConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 69
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 48
at Calamari.Commands.DeployPackageCommand.Execute(String commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 103
at Calamari.Program.Execute(String args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
The remote script failed with exit code 100
This is telling me that some file within the NuGet package, has a full path that is too long for windows to cope with.
Please can it tell me which files?
I would love for octopus to do a check in advance of extracting the package to disk, to check to make sure that no files will exceed this limit, and then to raise a more informative error about the problematic files if it finds any.
This will also save it leaving a package half extracted to the installation directory!
02:56AM - 03 Feb 17 UTC
05:50AM - 05 Nov 21 UTC
Windows 10/Server 2016 introduced improvements in long path support.
… ation: https://octopus.com/docs/how-to/long-paths
- [x] Support in Calamari (#3129)
- [ ] Support in C# scripts
- [ ] Support in F# scripts
- [x] Support in Server
- [ ] Support in Tentacle
- [x] Check #2532 is now resolved for Win10/Server2016
- [x] Documentation
- [ ] Migrator
#2532 (Retention policy failing on long path structures) is related
which look like the problem was solved some time ago.
My question now is: is there a character limit for extracted files from a nuget package or is there a way to enable long file path support?
Thanks for getting in touch!
Octopus should work fine with long file paths once enabled within the OS.
For Server 2019, you will need to make a group policy change to enable long file path support.
guide seemed to be fairly detailed on the required steps.
29 May 2023 11:59
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.