Red Gate forums :: View topic - Show path that causes "path too long" failure
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

Show path that causes "path too long" failure

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
isme



Joined: 12 Jun 2012
Posts: 72
Location: Edinburgh

PostPosted: Thu Dec 05, 2013 8:09 pm    Post subject: Show path that causes "path too long" failure Reply with quote

My deployment failed with a "path too long" error.

Code:

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.

Code:

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
Back to top
View user's profile Send private message
isme



Joined: 12 Jun 2012
Posts: 72
Location: Edinburgh

PostPosted: Thu Dec 05, 2013 8:12 pm    Post subject: Reply with quote

While you're here, please vote for this Microsoft Connect Item to fix the problem. Apparently it's a limitation of the .NET Framework.
_________________
Iain Elder, Skyscanner
Back to top
View user's profile Send private message
isme



Joined: 12 Jun 2012
Posts: 72
Location: Edinburgh

PostPosted: Thu Dec 05, 2013 8:32 pm    Post subject: Reply with quote

I shorted the package name to ApiBackDB, and the deployment is working normally again.

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.
_________________
Iain Elder, Skyscanner
Back to top
View user's profile Send private message
csmith



Joined: 30 Jun 2011
Posts: 114
Location: Cambridge

PostPosted: Fri Dec 06, 2013 11:53 am    Post subject: Reply with quote

Hi

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
_________________
Chris Smith
Project Manager
Deployment Manager
Back to top
View user's profile Send private message
isme



Joined: 12 Jun 2012
Posts: 72
Location: Edinburgh

PostPosted: Fri Dec 06, 2013 2:45 pm    Post subject: Reply with quote

You can follow these steps to find the problem paths.

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:

Code:

$ Get-ChildItem


    Directory: C:\Users\iain\Downloads\ApiServices-backend-database.0.139


Mode                LastWriteTime     Length Name                                                                               
----                -------------     ------ ----                                                                               
d----        06/12/2013     12:14            db                                                                                 
d----        06/12/2013     12:14            package                                                                             
d----        06/12/2013     12:14            RedGate                                                                             
d----        06/12/2013     12:14            _rels                                                                               
-----        05/12/2013     18:47        409 ApiServices-backend-database.nuspec                                                 
-----        05/12/2013     18:47        807 [Content_Types].xml                                                                 


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.

Code:

$DeploymentManagerBasePath = 'G:\Temp\efvh0lxh.5t1\Packages\..\Applications\ApiServices DEV\ApiServices-backend-database\0.139'

Get-ChildItem -Recurse |

Resolve-Path -Relative |

% { $DeploymentManagerBasePath + $_.SubString(1) } |

? { $_.Length -gt 260 } |

% { "$($_.Length)`t$_" }


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:

Code:

280   G:\Temp\efvh0lxh.5t1\Packages\..\Applications\ApiServices DEV\ApiServices-backend-database\0.139\db\state\db\Stored%20Procedures\BackendLayerCustomerAdministrationTests.test%20uspMaintainCustomerPermissions%20throws%20error%20when%20PermissionValue%20is%20missing%20or%20empty.sql


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.

Code:

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 problem path was:

G:\Temp\efvh0lxh.5t1\Packages\..\Applications\ApiServices DEV\ApiServices-backend-database\0.139\db\state\db\Stored%20Procedures\BackendLayerCustomerAdministrationTests.test%20uspMaintainCustomerPermissions%20throws%20error%20when%20PermissionValue%20is%20missing%20or%20empty.sql

Exclude the file from the release or shorten its path.

_________________
Iain Elder, Skyscanner
Back to top
View user's profile Send private message
zalmax



Joined: 31 Jan 2014
Posts: 1

PostPosted: Fri Jan 31, 2014 12:35 pm    Post subject: Reply with quote

Well, you can use Long Path Tool for such issues, it works good.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group