Show path that causes "path too long" failure
isme
Posts: 119
My deployment failed with a "path too long" error.
The path in the output is only 96 characters long.
Is it one of my scripts that failing, or part of DM?
Because I don't know the problem path, I'm unsure how to proceed.
To try to work around this, I'll shorten the name of the package (ApiServices-backend-database) and the name of the environment (ApiServices DEV).
Those elements appear to be part of the problem path, so shortening them might buy me enough space.
2013-12-05 18:48:39 +00:00 INFO Installing package ApiServices-backend-database.0.139 from uploaded package cache into G:\Temp\efvh0lxh.5t1\Packages\..\Applications\ApiServices DEV\ApiServices-backend-database\0.139 2013-12-05 18:48:40 +00:00 INFO Installing 'ApiServices-backend-database 0.139'. 2013-12-05 18:48:40 +00:00 ERROR 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.
The path in the output is only 96 characters long.
G:\Temp\efvh0lxh.5t1\Packages\..\Applications\ApiServices DEV\ApiServices-backend-database\0.139
Is it one of my scripts that failing, or part of DM?
Because I don't know the problem path, I'm unsure how to proceed.
To try to work around this, I'll shorten the name of the package (ApiServices-backend-database) and the name of the environment (ApiServices DEV).
Those elements appear to be part of the problem path, so shortening them might buy me enough space.
Iain Elder, Skyscanner
Comments
In the long run I'd like to follow our naming convention of Organization.Product.Component.
Currently deployment manager doesn't have space to support that.
I'm deploying a SQL Server package, in case that's relevant.
As you suggested, we think this is due to the framework's 260 char limit. The path being complained about is inside the G:\Temp\efvh0lxh.5t1\Packages\..\Applications\ApiServices DEV\ApiServices-backend-database\0.139 directory.
Your database package contains sub-folders and files from your database schema and these will have been unpackaged to that location. So if the combination of the base folder path, plus your schema name, sub-folder and object name exceeds 260 chars, then you'll get this error.
Best regards,
Chris
Redgate Software
1. Download the failing package from the TeamCity server.
2. Extract the package to your Downloads directory.
3. Navigate to the new directory in PowerShell.
Your working location should look like this:
4. Run this script to find the problem paths.
Set the value of $DeploymentManagerBasePath to the installation path of the package on the Deployment Manager server. You'll find it in the deployment log before the error message.
The script computes the what the full path would have been at deployment time for every file in the package.
It prints the length and full path of any files that exceed the 260-character limit.
5. Inspect the output.
For me it printed one path:
A whopping 280 characters!
----
The file contains a tSQLt unit test called [BackendLayerCustomerAdministrationTests].[test uspMaintainCustomerPermissions throws error when PermissionValue is missing or empty].
We can name that test more succinctly to avoid the issue.
Thanks for your help!
It would be great if you could make Deployment manager produce output like this when .NET raises the error.