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

agentCommand is empty after creating a node with command launcher through rest api

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • core
    • None
    • jenkins version: 1.549

      create a node with command launcher method by rest api, but launch command is empty.

      The decoded json should be:
      {"launcher":

      {"stapler-class": "hudson.slaves.CommandLauncher", "agentCommand": ""/home/jenkins/launch_slave.sh" "root" "/home/nodepool/.ssh/id_rsa" "10.145.81.65" "192.168.100.35""}

      , "numExecutors": 1, "nodeProperties":

      {"stapler-class-bag": "true"}

      , "name": "centos-dev-testcloud-dev-118", "retentionStrategy":

      {"stapler-class": "hudson.slaves.RetentionStrategy$Always"}

      , "remoteFS": "/home/jenkins", "type": "hudson.slaves.DumbSlave$DescriptorImpl", "nodeDescription": "Dynamic single use centos-dev node", "labelString": "centos-dev", "mode": "EXCLUSIVE"}

      The raw http packet capture:

      GET /openstackcijenkins/computer/doCreateItem?json=%7B%22launcher%22%3A+%7B%22stapler-class%22%3A+%22hudson.slaves.CommandLauncher%22%2C+%22agentCommand%22%3A+%22%26quot%3B%2Fhome%2Fjenkins%2Flaunch_slave.sh%26quot%3B+%26quot%3Broot%26quot%3B+%26quot%3B%2Fhome%2Fnodepool%2F.ssh%2Fid_rsa%26quot%3B+%26quot%3B10.145.81.65%26quot%3B+%26quot%3B192.168.100.35%26quot%3B%22%7D%2C+%22numExecutors%22%3A+1%2C+%22nodeProperties%22%3A+%7B%22stapler-class-bag%22%3A+%22true%22%7D%2C+%22name%22%3A+%22centos-dev-testcloud-dev-118%22%2C+%22retentionStrategy%22%3A+%7B%22stapler-class%22%3A+%22hudson.slaves.RetentionStrategy%24Always%22%7D%2C+%22remoteFS%22%3A+%22%2Fhome%2Fjenkins%22%2C+%22type%22%3A+%22hudson.slaves.DumbSlave%24DescriptorImpl%22%2C+%22nodeDescription%22%3A+%22Dynamic+single+use+centos-dev+node%22%2C+%22labelString%22%3A+%22centos-dev%22%2C+%22mode%22%3A+%22EXCLUSIVE%22%7D&type=hudson.slaves.DumbSlave%24DescriptorImpl&name=centos-dev-testcloud-dev-118 HTTP/1.1

      Accept-Encoding: identity

      Host: 10.145.81.234

      Connection: close

      Authorization: Basic YWRtaW46NmIxMTJiZGNlZGIzOTliOTJlMjUxOGRjMDhiOWNlZDc=

      User-Agent: Python-urllib/2.7

      HTTP/1.1 302 Found

      Date: Fri, 06 Jun 2014 22:07:08 GMT

      Server: Jetty(8.y.z-SNAPSHOT)

      Location: http://10.145.81.234/openstackcijenkins/computer/

      Content-Length: 0

      Connection: close

      Content-Type: text/plain

          [JENKINS-23354] agentCommand is empty after creating a node with command launcher through rest api

          Daniel Beck added a comment -

          That is not part of the API, it's simply where the web browser sends its requests. You're free to emulate that, but if it works in a browser, but not this way – something's wrong with your emulation of the web browser.

          Therefore not a bug in Jenkins.

          Daniel Beck added a comment - That is not part of the API, it's simply where the web browser sends its requests. You're free to emulate that, but if it works in a browser, but not this way – something's wrong with your emulation of the web browser. Therefore not a bug in Jenkins.

          jerry zhao added a comment -

          Thank you for pointing that out, but an expected message format would be helpful. Could you see anything wrong with the json file?
          ssh launcher works for me though.

          jerry zhao added a comment - Thank you for pointing that out, but an expected message format would be helpful. Could you see anything wrong with the json file? ssh launcher works for me though.

          jerry zhao added a comment -

          found the issue:
          the command key word should be 'command' instead of 'agentCommand'

          jerry zhao added a comment - found the issue: the command key word should be 'command' instead of 'agentCommand'

            Unassigned Unassigned
            jerryz jerry zhao
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: