You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[JENKINS-30502] Unable to delete project with trailing whitespace in name #21407
I renamed a (maven) project in Jenkins and the new name ended in a whitespace: "name ".
A directory "name" (*without *the trailing whitespace) was created under jenkins jobs directory.
Now the project cannot be deleted because Jenkins fails with the following message:
Trailing char < > at index 51: C:\Program Files (x86)\Jenkins\jobs\aaaaaaaaaaaaaaa _
I renamed a (maven) project in Jenkins and the new name ended in a whitespace: "name ".
A directory "name" (*without *the trailing whitespace) was created under jenkins jobs directory.
Now the project cannot be deleted because Jenkins fails with the following message:
Trailing char < > at index 51: C:\Program Files (x86)\Jenkins\jobs\aaaaaaaaaaaaaaa _
I've verified that once a job is renamed to a string with a trailing space, it can be neither deleted nor renamed again (through the UI). Part of the problem is that the initial rename (to a string with a trailing space) fails to rename the job directory.
This problem occurs only when renaming a job, and not when initially creating a job, because job names are trimmed when first created. It seems a sensible solution would be simply to trim the given job for rename operations as well, so that the name-setting behavior is consistent across create/update operations and inadvertent leading/trailing whitespace is removed before it can cause problems.
I've verified that once a job is renamed to a string with a trailing space, it can be neither deleted nor renamed again (through the UI). Part of the problem is that the initial rename (to a string with a trailing space) fails to rename the job directory.
This problem occurs only when renaming a job, and not when initially creating a job, because job names are trimmed when first created. It seems a sensible solution would be simply to trim the given job for rename operations as well, so that the name-setting behavior is consistent across create/update operations and inadvertent leading/trailing whitespace is removed before it can cause problems.
If a job is renamed to a string with trailing whitespace, exceptions are
thrown as the application attempts to rename the job directory in the
file system, and the job can be neither deleted nor renamed again
through the UI. This problem occurs only when renaming a job, and not
when initially creating a job, because job names are trimmed when first
created. This change trims the job name for rename operations as well,
so that the name-setting behavior is consistent across create/update
operations and inadvertent leading/trailing whitespace is removed before
it can cause problems.
If a job is renamed to a string with trailing whitespace, exceptions are
thrown as the application attempts to rename the job directory in the
file system, and the job can be neither deleted nor renamed again
through the UI. This problem occurs only when renaming a job, and not
when initially creating a job, because job names are trimmed when first
created. This change trims the job name for rename operations as well,
so that the name-setting behavior is consistent across create/update
operations and inadvertent leading/trailing whitespace is removed before
it can cause problems.
Integrated in jenkins_main_trunk #4328[FIXED JENKINS-30502] trim job name upon rename (Revision 89ce85dfc88b21cdb7a8bc95d89b24259b987d19)
Noting JENKINS-30502 from #1855 (Revision 3bc0f447efd5b5abca466881949106f19c8b9ebf)
Activity
jenkins-infra-bot commentedon Oct 5, 2015
Raw content of original comment:
I've verified that once a job is renamed to a string with a trailing space, it can be neither deleted nor renamed again (through the UI). Part of the problem is that the initial rename (to a string with a trailing space) fails to rename the job directory.
This problem occurs only when renaming a job, and not when initially creating a job, because job names are trimmed when first created. It seems a sensible solution would be simply to trim the given job for rename operations as well, so that the name-setting behavior is consistent across create/update operations and inadvertent leading/trailing whitespace is removed before it can cause problems.
Fixed in PR #1855.
jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
Code changed in jenkins
User: Christopher Simons
Path:
core/src/main/java/hudson/model/Job.java
test/src/test/java/hudson/model/JobTest.java
http://jenkins-ci.org/commit/jenkins/89ce85dfc88b21cdb7a8bc95d89b24259b987d19
Log:
[FIXED JENKINS-30502] trim job name upon rename
If a job is renamed to a string with trailing whitespace, exceptions are
thrown as the application attempts to rename the job directory in the
file system, and the job can be neither deleted nor renamed again
through the UI. This problem occurs only when renaming a job, and not
when initially creating a job, because job names are trimmed when first
created. This change trims the job name for rename operations as well,
so that the name-setting behavior is consistent across create/update
operations and inadvertent leading/trailing whitespace is removed before
it can cause problems.
jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
Code changed in jenkins
User: Oleg Nenashev
Path:
core/src/main/java/hudson/model/Job.java
test/src/test/java/hudson/model/JobTest.java
http://jenkins-ci.org/commit/jenkins/67879ab2327f0a3fd4015f5f9ff53cf0a5b7ef08
Log:
Merge pull request #1855 from csimons/fix-rename-trailing-whitespace
[FIXED JENKINS-30502] trim job name upon rename
Compare: a0eb564...67879ab
jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
Code changed in jenkins
User: Oleg Nenashev
Path:
changelog.html
http://jenkins-ci.org/commit/jenkins/3bc0f447efd5b5abca466881949106f19c8b9ebf
Log:
Noting
JENKINS-30502from #1855jenkins-infra-bot commentedon Oct 17, 2015
Raw content of original comment:
o.v.nenashev : 3bc0f447efd5b5abca466881949106f19c8b9ebf Files :
Integrated in
jenkins_main_trunk #4328
[FIXED JENKINS-30502] trim job name upon rename (Revision 89ce85d)
Noting
JENKINS-30502from #1855 (Revision 3bc0f44)Result = SUCCESS
christopherleesimons : 89ce85dfc88b21cdb7a8bc95d89b24259b987d19
Files :
o.v.nenashev : 3bc0f447efd5b5abca466881949106f19c8b9ebf
Files :
jenkins-infra-bot commentedon Nov 24, 2025
[Original
relates_tofrom Jira: JENKINS-19203]