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

Cannot trigger Jenkins Workflow DSL jobs with jenkins-cli

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • cli, pipeline
    • Kubernetes, Jenkernetes docker image

      Using the list command I can see the workflow jobs returned but when I try the build or console commands an error is returned saying the job could not be found. I created a test freestyle project and that can be triggered so it only affects the workflow jobs.

      bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8 list-jobs
      workflow-job1
      freestyle-job1
      

      Error:

      bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console workflow-job1
      No such job 'workflow-job1'; perhaps you meant 'freestyle-job1'?
      java -jar jenkins-cli.jar console JOB [BUILD] [-f] [-n N]
      Produces the console output of a specific build to stdout, as if you are doing 'cat build.log'
       JOB   : Name of the job
       BUILD : Build number or permalink to point to the build. Defaults to the last
               build
       -f    : If the build is in progress, stay around and append console output as
               it comes, like 'tail -f'
       -n N  : Display the last N lines
      

      The freestyle job works correctly..

      bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console freestyle-job1
      Started from command line by ha:AAAAmx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzOEgZ+/dLi1CL9xLz8vMrc/NJiAJjzDjjEAAAAanonymous
      Building in workspace /var/jenkins_home/jobs/freestyle-job1/workspace
      [workspace] $ /bin/sh -xe /tmp/hudson1774308920514103607.sh
      + echo worked
      worked
      Finished: SUCCESS
      

          [JENKINS-29826] Cannot trigger Jenkins Workflow DSL jobs with jenkins-cli

          James Rawlings created issue -
          James Rawlings made changes -
          Description Original: Using the list command I can see the workflow jobs returned but when I try the build or console commands an error is returned saying the job could not be found. I created a test freestyle project and that can be triggered so it only affects the workflow jobs.

          bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8 list-jobs
          workflow-job1
          freestyle-job1


          Error:

          bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console workflow-job1
          No such job 'workflow-job1'; perhaps you meant 'freestyle-job1'?
          java -jar jenkins-cli.jar console JOB [BUILD] [-f] [-n N]
          Produces the console output of a specific build to stdout, as if you are doing 'cat build.log'
           JOB : Name of the job
           BUILD : Build number or permalink to point to the build. Defaults to the last
                   build
           -f : If the build is in progress, stay around and append console output as
                   it comes, like 'tail -f'
           -n N : Display the last N lines



          The freestyle job works correctly..

          bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console freestyle-job1
          Started from command line by ha:AAAAmx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzOEgZ+/dLi1CL9xLz8vMrc/NJiAJjzDjjEAAAAanonymous
          Building in workspace /var/jenkins_home/jobs/freestyle-job1/workspace
          [workspace] $ /bin/sh -xe /tmp/hudson1774308920514103607.sh
          + echo worked
          worked
          Finished: SUCCESS
          New: Using the list command I can see the workflow jobs returned but when I try the build or console commands an error is returned saying the job could not be found. I created a test freestyle project and that can be triggered so it only affects the workflow jobs.
          {code}
          bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8 list-jobs
          workflow-job1
          freestyle-job1
          {code}

          Error:
          {code}
          bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console workflow-job1
          No such job 'workflow-job1'; perhaps you meant 'freestyle-job1'?
          java -jar jenkins-cli.jar console JOB [BUILD] [-f] [-n N]
          Produces the console output of a specific build to stdout, as if you are doing 'cat build.log'
           JOB : Name of the job
           BUILD : Build number or permalink to point to the build. Defaults to the last
                   build
           -f : If the build is in progress, stay around and append console output as
                   it comes, like 'tail -f'
           -n N : Display the last N lines
          {code}


          The freestyle job works correctly..
          {code}
          bash-4.3# java -jar jenkins-cli.jar -s http://jenkins.vagrant.f8/ console freestyle-job1
          Started from command line by ha:AAAAmx+LCAAAAAAAAP9b85aBtbiIQTGjNKU4P08vOT+vOD8nVc83PyU1x6OyILUoJzMv2y+/JJUBAhiZGBgqihhk0NSjKDWzXb3RdlLBUSYGJk8GtpzUvPSSDB8G5tKinBIGIZ+sxLJE/ZzEvHT94JKizLx0a6BxUmjGOUNodHsLgAzOEgZ+/dLi1CL9xLz8vMrc/NJiAJjzDjjEAAAAanonymous
          Building in workspace /var/jenkins_home/jobs/freestyle-job1/workspace
          [workspace] $ /bin/sh -xe /tmp/hudson1774308920514103607.sh
          + echo worked
          worked
          Finished: SUCCESS
          {code}
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-28071 [ JENKINS-28071 ]
          Jesse Glick made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          David McFarland made changes -
          Comment [ What can I do to move this along? ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 164903 ] New: JNJira + In-Review [ 197577 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Andrew Bayer made changes -
          Labels Original: jenkins workflow New: jenkins pipeline workflow
          Andrew Bayer made changes -
          Labels Original: jenkins pipeline workflow New: jenkins pipeline

            jglick Jesse Glick
            rawlingsj James Rawlings
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: