Jenkins Job Creating Multiple Workspaces

3,627 views
Skip to first unread message

Leah

unread,
Dec 12, 2014, 6:35:47 PM12/12/14
to jenkins...@googlegroups.com
Hi, I have a Jenkins freestyle job that is creating a new workspace each time I run it. Each workspace is named workspace@<number>. I am not sure how to eliminate this procedure as I have trying to attach a file from the original workspace and it is not possible when it build in a new workspace each time. Does anyone know why this is happening?


--
Skype: lchristina26


Mark Waite

unread,
Dec 12, 2014, 6:43:24 PM12/12/14
to jenkins...@googlegroups.com
That form of workspace naming is typically used by Jenkins when more than one build of the same job is running at the same time.  If you've enabled concurrent builds for that job, then you may see workspace names with numbers appended.

Mark Waite

--
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/CAL0pqZ34q2rW9n1utWL9XUH4iu1h9%3D2svBHWJwiU25%2B%2B3B7a2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Thanks!
Mark Waite

Daniel Beck

unread,
Dec 12, 2014, 6:57:13 PM12/12/14
to jenkins...@googlegroups.com
This should only happen if you configured the job to run multiple builds in parallel.

If that's not the case:

0. Make sure Jenkins is up to date. This one should be really obvious. If you're on 1.560 or lower, this may be JENKINS-21622.

1. Check the system log at the URL /log/all to see whether there are errors related to the affected job/node getting logged. The build log may give you a hint as well.

2. Run the following script in Manage Jenkins » Script Console. It may give you a hint as to who/what allocated the workspaces.
----
( [] + Jenkins.instance + Jenkins.instance.nodes ).each {
println it.displayName
println it.toComputer()?.workspaceList?.inUse
}
return
----
This is also close to what can also be used to release the workspace leases, but tampering with internals like these should probably be reserved for cases where all else fails.

Eric Pyle

unread,
Dec 12, 2014, 11:02:38 PM12/12/14
to Jenkins Users

Check and see if you have allowed concurrent builds on this job. That's what Jenkins will do to avoid workspace collisions with concurrent builds.

Eric

lc

unread,
Dec 13, 2014, 8:31:13 PM12/13/14
to jenkins...@googlegroups.com
Thanks, I think I must have been building multiple jobs at the same time. It's no longer an issue, so it must have been while I was configuring the job and running the job very frequently to test my configurations and scripts. It's now building in one workspace and not creating new ones. 

Reply all
Reply to author
Forward
0 new messages