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

Cannot trigger Jenkins Workflow DSL jobs with jenkins-cli

    Details

    • Similar Issues:

      Description

      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
      

        Attachments

          Issue Links

            Activity

            rawlingsj James Rawlings created issue -
            rawlingsj James Rawlings made changes -
            Field Original Value New Value
            Description 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
            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}
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-28071 [ JENKINS-28071 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            corngood David McFarland made changes -
            Comment [ What can I do to move this along? ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 164903 ] JNJira + In-Review [ 197577 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            abayer Andrew Bayer made changes -
            Labels jenkins workflow jenkins pipeline workflow
            abayer Andrew Bayer made changes -
            Labels jenkins pipeline workflow jenkins pipeline

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: