System.IO.PathTooLongException

Using Octopus Deploy 2.6.2.845, I get System.IO.PathTooLongException failures the second (and subsequent) time I try to deploy to an environment. The first time the package deploys just fine.

Hi,

Is then when you deploy the same package multiple times?
Would it be possible to include a task log for a deployment that is failing.

Thanks
Shane

From: Shane Gill [mailto:tender2+d07ec28ba6@tenderapp.com]
Sent: Thursday, October 29, 2015 11:11 PM
To: Randy Kaylor rkaylor@ezesoft.com
Subject: Re: System.IO.PathTooLongException [Problems #41370]

Hi Shane. My initial conclusion was incorrect; I had thought the problem was limited to cases where I was deploying to the same target folder multiple times. But then the problem began occurring even for the first deployment. The package in question is fairly deeply nested, maximum relative path length is around 170 characters. But if I just download and install the package using Nuget, it unpacks fine.

The log entry is below.

==============================================

2015-10-29 16:03:44.3650 19 ERROR Error in TentaclePackageDeployment-ew-Aopio_ao6w@SQ-DW2-RKAYLOR-DD053636 while receiving 861823c2-7e80-11e5-a69a-000acd220ab5

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 Octopus.Shared.Packages.LightweightPackageExtractor.Install(String packageFile, String directory, ILog log, Boolean suppressNestedScriptWarning, Int32& filesExtracted) in y:\work\refs\heads\master\source\Octopus.Shared\Packages\LightweightPackageExtractor.cs:line 50

at Octopus.Tentacle.Deployment.Packages.PackageInstaller.InstallPackageUsingNuGet(StoredPackage package, String packageInstallationPath, Boolean suppressNestedScriptWarnings, ILog log) in y:\work\refs\heads\master\source\Octopus.Tentacle\Deployment\Packages\PackageInstaller.cs:line 87

at Octopus.Tentacle.Deployment.Packages.PackageInstaller.Install(StoredPackage package, PackageInstallationOptions options, ILog activityLog) in y:\work\refs\heads\master\source\Octopus.Tentacle\Deployment\Packages\PackageInstaller.cs:line 59

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.ExecuteDeployment() in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 163

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.Receive(AcquiredEvent message) in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 138

at Pipefish.Actor.OnReceivingTyped[TBody](Message message) in y:\work\3cbe05672d69a231\source\Pipefish\Actor.cs:line 113

2015-10-29 16:03:44.3650 19 ERROR Could not write an entry to the deployment journal for a failed deployment.

System.ArgumentNullException: Value cannot be null.

Parameter name: variables

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.Failed() in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 421

2015-10-29 16:03:44.3650 23 ERROR Caught exception while receiving: Octopus.Tentacle.Orchestration.Deploy.Mutex.AcquiredEvent

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 Octopus.Shared.Packages.LightweightPackageExtractor.Install(String packageFile, String directory, ILog log, Boolean suppressNestedScriptWarning, Int32& filesExtracted) in y:\work\refs\heads\master\source\Octopus.Shared\Packages\LightweightPackageExtractor.cs:line 50

at Octopus.Tentacle.Deployment.Packages.PackageInstaller.InstallPackageUsingNuGet(StoredPackage package, String packageInstallationPath, Boolean suppressNestedScriptWarnings, ILog log) in y:\work\refs\heads\master\source\Octopus.Tentacle\Deployment\Packages\PackageInstaller.cs:line 87

at Octopus.Tentacle.Deployment.Packages.PackageInstaller.Install(StoredPackage package, PackageInstallationOptions options, ILog activityLog) in y:\work\refs\heads\master\source\Octopus.Tentacle\Deployment\Packages\PackageInstaller.cs:line 59

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.ExecuteDeployment() in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 163

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.Receive(AcquiredEvent message) in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 138

at Pipefish.Actor.OnReceivingTyped[TBody](Message message) in y:\work\3cbe05672d69a231\source\Pipefish\Actor.cs:line 113

2015-10-29 16:03:44.3780 24 ERROR Received a delivery failure in response to acquisition a204db18-7938-49ce-9106-7a823a601ef7

Pipefish.Errors.PipefishCommunicationException: The message could not be handled

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 Octopus.Shared.Packages.LightweightPackageExtractor.Install(String packageFile, String directory, ILog log, Boolean suppressNestedScriptWarning, Int32& filesExtracted) in y:\work\refs\heads\master\source\Octopus.Shared\Packages\LightweightPackageExtractor.cs:line 50

at Octopus.Tentacle.Deployment.Packages.PackageInstaller.InstallPackageUsingNuGet(StoredPackage package, String packageInstallationPath, Boolean suppressNestedScriptWarnings, ILog log) in y:\work\refs\heads\master\source\Octopus.Tentacle\Deployment\Packages\PackageInstaller.cs:line 87

at Octopus.Tentacle.Deployment.Packages.PackageInstaller.Install(StoredPackage package, PackageInstallationOptions options, ILog activityLog) in y:\work\refs\heads\master\source\Octopus.Tentacle\Deployment\Packages\PackageInstaller.cs:line 59

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.ExecuteDeployment() in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 163

at Octopus.Tentacle.Orchestration.Deploy.Package.TentaclePackageDeployment.Receive(AcquiredEvent message) in y:\work\refs\heads\master\source\Octopus.Tentacle\Orchestration\Deploy\Package\TentaclePackageDeployment.cs:line 138

at Pipefish.Actor.OnReceivingTyped[TBody](Message message) in y:\work\3cbe05672d69a231\source\Pipefish\Actor.cs:line 113

Long Path Tool is best solution and it is free

From: oxishmit [mailto:tender2+d07ec28ba6@tenderapp.com]
Sent: Saturday, October 31, 2015 5:27 PM
To: Randy Kaylor rkaylor@ezesoft.com
Subject: Re: System.IO.PathTooLongException [Problems #41370]

Are you referring to the Pri.LongPath package? If so, it is not clear to me (not a C# programmer) how this might be integrated into the Tentacle. Could you perhaps be a little more specific? As I mentioned, the package itself does not exceed the limit; I can download and unpack with NuGet just fine.

Hi,

Where are your NuGet packages being extracted to? Usually it would be C:\Octopus\Applications\Environment\Package\Version.

It sounds like the combined length of the extraction folder and the package contents exceeds the character limit. That might explain why you were getting the error on subsequent deployments as we append to the path a number to the path so it doesn’t conflict with the previous deployment.

Cheers
Shane

From: Shane Gill [mailto:tender2+d07ec28ba6@tenderapp.com]
Sent: Tuesday, November 03, 2015 9:16 PM
To: Randy Kaylor rkaylor@ezesoft.com
Subject: Re: System.IO.PathTooLongException [Problems #41370]

Thank you Shane. Knowing the extraction folder helped me identify the portion(s) of the package that were exceeding the limit. Even better, it turned out to be a part of the package that could be pruned.