Jenkins on Windows Server w/ short-workspace-path-plugin (path too long error)

1,911 views
Skip to first unread message

Patrick Hummer

unread,
Jan 29, 2016, 11:06:12 AM1/29/16
to Jenkins Users
Hi,

We currently are running Jenkins on a Windows Server box and a couple of our projects are getting the "Path too long" error.  I realize this is a limitation of Windows but from looking around there are a couple options to get around this in Jenkins.

The one we are trying is the short-workspace-path-plugin.  By default the system property for BUILD_PATH_LENGTH in this plugin is set to 512.  I was able to modify this property via the Jenkins.xml file and have verified that the value is being set.  We set the value below the Windows maximum path length however we are still receiving an error.

The error in our build we are seeing:

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 system property value we are setting it is:

-Dorg.jenkinsci.plugins.shortwspath.BUILD_PATH_LENGTH=248

And as seen in the "System Information" section:












Any direction would be greatly appreciated.

Thank you,
Patrick

Ginga, Dick

unread,
Jan 29, 2016, 11:18:14 AM1/29/16
to jenkins...@googlegroups.com

There are 2 ways to make the resultant workspace path shorter. The path is made up of the workspace root and your source code structure.

 

1.       Change the “Workspace Root Directory” under System Configuration. My windows master workspace resolves to: C:\Program Files (x86)\Jenkins\jobs\JOBNAME\workspace. But I do very, very little building on the master.
 
2.       In some SCM’s you can change the mapping to eliminate common root folders. We use Perforce and I could map:
//depot/aaa/bbb/ccc/ddd/eee/ProjA/… //workspace/ProjA/…

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6cbee678-9f67-49d1-9523-d270e0bf0555%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

geoffroy...@gmail.com

unread,
Jan 30, 2016, 5:38:17 PM1/30/16
to Jenkins Users
Hi

For what i've read about the plugin your using "The plugin has currently no effect on master node and never places short workspaces out of slave's workspace root."

Does Jenkins supports windows ntfs 32k file path long names, like \\?\c:\dir\file" ? (https://serverfault.com/questions/163419/window-256-characters-path-name-limitation) I've never tried it...
In the same serverfault thread, there are others possible solutions, like creating symlinks of your long path folders using mklink (which does not require root access like subst).

You can also start your jenkins with "JENKINS_HOME=c:\j" for example ;) but this is only a short term solution as your paths keep getting longer and longer.

Good luck

Patrick Hummer

unread,
Feb 1, 2016, 9:46:10 AM2/1/16
to Jenkins Users
Thanks for the info everyone.  I was able to temporarily fix by setting custom workspace path like suggested.  I will look into the additional resources to see how we can solve this on a more system level.

Thanks!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages