Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17587

Slave label expressions with multiple quoted slave names joined by logical operators are no longer recognised

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core

      After an upgrade from 1.505 to 1.510 Job Label expressions like this are no longer working:

      "Slave1(box1)"||"Slave3(box3)"

      This gives the message:
      There's no slave/cloud that matches this assignment. Did you mean 'Slave3(box3)' instead of 'Slave1(box1)"||"Slave3(box3)'?

      A scan of recent fixes suggests issue JENKINS-17128 maybe related (as it concerned unquoting label expressions)...

          [JENKINS-17587] Slave label expressions with multiple quoted slave names joined by logical operators are no longer recognised

          Daniel Beck added a comment -

          Reproduced on Jenkins 1.567:
          Label: "s1(b1)" || "s2(b2)"
          Message: There’s no slave/cloud that matches this assignment. Did you mean ‘s1(b1)’ instead of ‘s1(b1)" || "s2(b2)’?

          Daniel Beck added a comment - Reproduced on Jenkins 1.567: Label: "s1(b1)" || "s2(b2)" Message: There’s no slave/cloud that matches this assignment. Did you mean ‘s1(b1)’ instead of ‘s1(b1)" || "s2(b2)’?

          Keith Johnson added a comment - - edited

          This is still an issue as of Jenkins 2.138.4.

          With a minimal Jenkinsfile and an executor with labels 'a' and 'b':

          node('"a" || "b"') {
          }

          Output:
          [Pipeline] node
          Still waiting to schedule task
          There are no nodes with the label ‘a" || "b’

          So it appears the entire label expression is being 'unquoted', but it's really two separate pairs of quotes:

          "a" || "b"  --> a" || "b

          An easy workaround is to just add parentheses around the whole label expression:

          node('("a" || "b")') {
          }

          Keith Johnson added a comment - - edited This is still an issue as of Jenkins 2.138.4. With a minimal Jenkinsfile and an executor with labels 'a' and 'b': node('"a" || "b"') { } Output: [Pipeline] node Still waiting to schedule task There are no nodes with the label ‘a" || "b’ So it appears the entire label expression is being 'unquoted', but it's really two separate pairs of quotes: "a" || "b"  --> a" || "b An easy workaround is to just add parentheses around the whole label expression: node('("a" || "b")') { }

            Unassigned Unassigned
            cowplater Paul Harris
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: