Path Too Long Exception

We are using version 3.2.6.
I have a NuGet package called “WebApplication.Mvc” that contains an ASP.NET 5 webiste.
I have a bog standard NuGet package step in octopus - with no optional features enabled.
Happy to upload the package if need be, it’s around 20MB.

When octopus attempts to deploy this package, the deployment fails with the following output:

Deploying package ‘C:\Octopus\Files\feeds-team-city\WebApplication.Mvc.1.0.490_BEAB07188F5368488DD92E42381CC0FE.nupkg’ to machine 'https://rchdevweb01:10933/'
12:51:17Info
Deploying package: C:\Octopus\Files\feeds-team-city\WebApplication.Mvc.1.0.490_BEAB07188F5368488DD92E42381CC0FE.nupkg
12:51:21Error
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:51:21Error
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
12:51:21Error
at System.IO.Path.GetDirectoryName(String path)
12:51:21Error
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

Seeing that this is some path length problem, I changed the tentacle’s “app” directory to be something short: “E:/app” and then retried the deployment. It has proceeded to extract some of the package contents to “E:/App/Dev/WebApplication.Mvc/1.0.490” but still fails with the same error.

My question is, how can I get this to work? I tried setting a custom installation directory on the package step - but that doesn’t work either, because octopus still tries to extract it to this directory first, before then copying it to the custom install directory - and its this first extraction process that is falling over… I have also tried the step in both package aquisiton modes, i.e uploaded via octopus server, and grabbed directly from the nuget feed by the tentacle - same exception occurs in either case.

Have raised an issue on github here because I think this could be viewed as a dev issue: https://github.com/OctopusDeploy/Issues/issues/2217

Hi Darrell,

Thanks for the reporting this. One of the reasons I did close your issue (apart from not accepting user contributions in GitHub) was because its a NuGet limitation. You found the very basic workaround, but we cannot change NuGet. So instead we are expanding Octopus to accept more than NuGet, ie Zip files, which will mean you can have this issue resolved by not using NuGet.
This functionality will be part of our 3.3 release in the new year.

We are also waiting for ASP.NET 5 tools to stabilize before we have a full solution. Hopefully as well this will be in the new year.

Hope that helps!
Vanessa

The exact tool for resolving the problem is Long path Tool.

I’m running into this issue. I can’t use zip files, as we’re using a nuget server (ProGet) to distribute the packages. Is there some way to change the path that the tentacle extracts the file to?

@erickt - yes you can change the folder that the tentacle installs apps too, see the docs here: http://docs.octopusdeploy.com/display/OD/Move+the+Octopus+Home+folder+and+the+Tentacle+Home+and+Application+folders - specifically the section “Move the Tentacle Home and Application folders”

I found though, that even once I did this (apps were installed under “E:\App” the extracted package was still too long. I had to also change the nuget package name itself to something shorter and that just about did it.

Hi Erick,

Darrell is absolutely correct. Thanks Darrell!
You shouldn’t need to move the Home folder just the App folder for this. Keeping your environment names, project names and release names will all also help!

Vanessa

Thanks to both of you. I ended up going with an alternate solution. I zipped the contents of the package, then build the package with the zip, and added a PostDeploy to unzip the file to the correct location. Not very pretty, but it does work.

Thanks,
Erick

Hi Erick,

Ah what fun things have to be invented sometimes to get around architecture. Glad you found a workable solution :slight_smile:

Vanessa

“Long Path Tool” is very helpful for this error !
You can use to solve this problem

Long Path Tool help me a lot when i have an issue like file deleting or renaming the file. Also good to use if file name and file extension is too long.

I used to have similar problems too, but after using “long path tool” everything was solved. Try this software and you would be glad you did.

Hi Samantha,

Thanks so much for the tip!

Vanessa

“Long Path Tool” is very helpful for this error !
You can use to solve this problem

“Long Path Tool” is very helpful for this error !
You can use to solve this problem

Closing this thread to stop the spam :slight_smile: