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 _
Exception trace attached.
- is related to
-
JENKINS-19203 New job with whitespace in name fails
-
- Resolved
-
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.