Hello there,
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
opened 12:38PM - 04 Dec 15 UTC
closed 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/'
12:05:07Info
Deploying package: C:\Octopus\Files\WebApplication.Mvc.1.0.490.nupkg-bc3e15a8-e654-4d96-8057-5d374a700c0b
12:05:12Error
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.
12:05:12Error
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
12:05:12Error
at System.IO.Path.GetDirectoryName(String path)
12:05:12Error
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
12:05:12Error
at Calamari.Deployment.Conventions.ExtractPackageConvention.Install(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Deployment\Conventions\ExtractPackageConvention.cs:line 28
12:05:12Error
at Calamari.Deployment.ConventionProcessor.RunInstallConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 60
12:05:12Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 28
12:05:12Error
Running rollback conventions...
12:05:12Error
System.ArgumentNullException: Value cannot be null.
12:05:12Error
Parameter name: path
12:05:12Error
at System.IO.DirectoryInfo..ctor(String path)
12:05:12Error
at Calamari.Integration.FileSystem.CalamariPhysicalFileSystem.EnumerateFiles(String parentDirectoryPath, String[] searchPatterns) in Y:\work\14ffc968155e4956\source\Calamari\Integration\FileSystem\CalamariPhysicalFileSystem.cs:line 179
12:05:12Error
at Calamari.Integration.Scripting.PackagedScriptRunner.FindScripts(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Integration\Scripting\PackagedScriptRunner.cs:line 55
12:05:12Error
at Calamari.Integration.Scripting.PackagedScriptRunner.RunScripts(RunningDeployment deployment) in Y:\work\14ffc968155e4956\source\Calamari\Integration\Scripting\PackagedScriptRunner.cs:line 29
12:05:12Error
at Calamari.Deployment.ConventionProcessor.RunRollbackConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 69
12:05:12Error
at Calamari.Deployment.ConventionProcessor.RunConventions() in Y:\work\14ffc968155e4956\source\Calamari\Deployment\ConventionProcessor.cs:line 48
12:05:12Error
at Calamari.Commands.DeployPackageCommand.Execute(String[] commandLineArguments) in Y:\work\14ffc968155e4956\source\Calamari\Commands\DeployPackageCommand.cs:line 103
12:05:12Error
at Calamari.Program.Execute(String[] args) in Y:\work\14ffc968155e4956\source\Calamari\Program.cs:line 38
12:05:13Error
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!
opened 02:56AM - 03 Feb 17 UTC
closed 05:50AM - 05 Nov 21 UTC
kind/enhancement
feature/migrator
feature/tentacle
size/small
area/core
Windows 10/Server 2016 introduced improvements in long path support.
Document⦠ation: https://octopus.com/docs/how-to/long-paths
Todo:
- [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?
Hi Dennis,
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.
This guide seemed to be fairly detailed on the required steps.
Regards,
Paul
1 Like
system
(system)
Closed
29 May 2023 11:59
4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.