-
Bug
-
Resolution: Unresolved
-
Minor
-
Host: CentOS 7
Jenkins 1.642 (also seen on 1.625)
Plugin-versions:
Ant Plugin 1.2
Authentication Tokens API Plugin 1.2
conditional-buildstep 1.3.3
Credentials Plugin 1.24
Docker Commons Plugin 1.2
Environment Injector Plugin 1.92.1
External Monitor Job Type Plugin 1.4
Git Changelog 1.2
Git server plugin 1.6
Javadoc Plugin 1.3
Jenkins CVS Plug-in 2.12
Jenkins Git client plugin 1.19.1
Jenkins Git plugin 2.4.1
Jenkins Mailer Plugin 1.16
Jenkins Multijob plugin 1.20
Jenkins Parameterized Trigger plugin 2.30
Jenkins SSH Slaves plugin 1.10
Jenkins Subversion Plug-in 2.5.6
Jenkins Translation Assistance plugin 1.12
JUnit Plugin 1.10
Label Linked Jobs Plugin 4.0.3
LDAP Plugin 1.11
MapDB API Plugin 1.0.6.0
Matrix Authorization Strategy Plugin 1.2
Matrix Project Plugin 1.6
Maven Integration plugin 2.12.1
Nested View Plugin 1.14
OWASP Markup Formatter Plugin 1.3
PAM Authentication plugin 1.2
Run Condition Plugin 1.0
SCM API Plugin 1.0
Script Security Plugin 1.15
SSH Credentials Plugin 1.11
Token Macro Plugin 1.12.1
Windows Slaves Plugin 1.1
Host: CentOS 7 Jenkins 1.642 (also seen on 1.625) Plugin-versions: Ant Plugin 1.2 Authentication Tokens API Plugin 1.2 conditional-buildstep 1.3.3 Credentials Plugin 1.24 Docker Commons Plugin 1.2 Environment Injector Plugin 1.92.1 External Monitor Job Type Plugin 1.4 Git Changelog 1.2 Git server plugin 1.6 Javadoc Plugin 1.3 Jenkins CVS Plug-in 2.12 Jenkins Git client plugin 1.19.1 Jenkins Git plugin 2.4.1 Jenkins Mailer Plugin 1.16 Jenkins Multijob plugin 1.20 Jenkins Parameterized Trigger plugin 2.30 Jenkins SSH Slaves plugin 1.10 Jenkins Subversion Plug-in 2.5.6 Jenkins Translation Assistance plugin 1.12 JUnit Plugin 1.10 Label Linked Jobs Plugin 4.0.3 LDAP Plugin 1.11 MapDB API Plugin 1.0.6.0 Matrix Authorization Strategy Plugin 1.2 Matrix Project Plugin 1.6 Maven Integration plugin 2.12.1 Nested View Plugin 1.14 OWASP Markup Formatter Plugin 1.3 PAM Authentication plugin 1.2 Run Condition Plugin 1.0 SCM API Plugin 1.0 Script Security Plugin 1.15 SSH Credentials Plugin 1.11 Token Macro Plugin 1.12.1 Windows Slaves Plugin 1.1
Problem
If a newline is present in a Label description (), the matrix job configuration "Slaves' option will not be selectable (jenk3-slaves-problem.png). No error is seen in the log files.
To reproduce
1). Create a Jenkins slave (if needed). Add a label to that slave MY_LABEL. Edit the label's description as follows:
"This is a newline in the description"
2). Create a new Multi-configuration project
3). Attempt to add a "Slaves" axis. The expected dropdown will not appear and it won't be possible to add a Slaves axis.
Possible cause
in (JENKINS_HOME)/labels/label.xml, the tags <description> and </description> must be on the same line. The newline in the description adds a newline before the </description> tag above, which seems to cause the matrix job problem as described above. Please see attachments for an example.
Workaround
Avoid newlines in the Label description. HTML is permissable there.
Simple guideline: do not enter a newline when making a label description. One MAY use html <br> and other HTML tags.
Good:
This is <b>my</b> name,<br>Matt
Bad:
This is my name,
<a newline here causes this issue>
Matt
I just ran into this as well on Jenkins 1.646. It seems to me that the reason is that the hudson.Functions.jsStringEscape() function (https://github.com/jenkinsci/jenkins/blob/ac566a91e44e3482083355bd5cde3cf65610c4a3/core/src/main/java/hudson/Functions.java#L1333 called from hudson.matrix.LabelAxis.DescriptorImpl.buildLabelCheckBox() called from matrix-project-plugin/src/main/resources/hudson/matrix/LabelAxis/config.jelly) does not escape newlines, so that executing the generated JavaScript code fails with a syntax error. The following patch might therefore fix it (I have not tested this however and don’t have time to):
However, maybe showing only the first line of the description would be better – something like this (not tested either):