2

I am trying to pull a repository using Jenkins, by default Jenkins create a long and unreadable workspace name. I am getting this error because of that :

Caused by: com.microsoft.tfs.core.exceptions.TECoreException: 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.

Could any one please help me how can I resolve this issue, does adding any parameter in config file will help?

Mukul Kazla
  • 65
  • 1
  • 8
  • Change in git installation setup helped in my case https://stackoverflow.com/a/63367093/7616517 – miedza Aug 11 '20 at 22:17

2 Answers2

1

Found the solution, just add this argument in jenkins.xml and restart jenkins and issue will be resolved.

-Djenkins.branch.workspaceLocatorImpl.PATH_MAX=0 
Mukul Kazla
  • 65
  • 1
  • 8
0

Anecdotal thoughts, but two options would be:

  • Ensure you check out the repo files 'closer' to the root of the underlying filesystem so the repo can contain longer filenames/paths (e.g. use C:\code and not something like C:\company\project\jenkins...)

  • Consider anything in your repo that is causing such a long filename - personally I've seen this when using NodeJS and the node_modules folder is tracked in source control, going multiple folders deep

mikeskaife
  • 24
  • 5
  • We can shorten the workspace name by adding an argument in jenkins.xml file but i am unable to find it, any idea on that? – Mukul Kazla Mar 01 '18 at 12:07