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

Not able to run parameterized project job from CLI

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Blocker Blocker
    • cli
    • None

      Getting an error while running parameterized project job through Jenkins

       

      Error:
      Exception in thread "main" java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:568)
      at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
      Caused by: java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
      at GeneratorMain.main(GeneratorMain.java:21)
      ... 5 more
      Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
      at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
      ... 6 more

          [JENKINS-72864] Not able to run parameterized project job from CLI

          Mark Waite added a comment -

          I'm not able to duplicate the issue in my configuration. I'm running Jenkins 2.440.1 with latest plugins as described in my plugins.txt file. I have a parmeterized job that I'm able to run with the command:

          java -jar jenkins-cli.jar -auth $USER:$TOKEN -s http://localhost:8080 build -f -p BRANCH_TO_BUILD=1.4.x -v /Bugs-Individual/Bugs-20-000-to-29-999/JENKINS-21980-polling-parameterized
          

          Are you using the most recent version of the Jenkins command line jar file? You can download it from the /cli URL of your Jenkins controller.

          Are the plugins installed on your system the most recent releases? If not, is the problem resolved when you update to the most recent releases of the plugins?

          Please provide the detailed report of your Jenkins version and the installed plugins that is generated when you run the reporting script in the Jenkins script console from "Manage Jenkins".

          Mark Waite added a comment - I'm not able to duplicate the issue in my configuration. I'm running Jenkins 2.440.1 with latest plugins as described in my plugins.txt file . I have a parmeterized job that I'm able to run with the command: java -jar jenkins-cli.jar -auth $USER:$TOKEN -s http: //localhost:8080 build -f -p BRANCH_TO_BUILD=1.4.x -v /Bugs-Individual/Bugs-20-000-to-29-999/JENKINS-21980-polling-parameterized Are you using the most recent version of the Jenkins command line jar file? You can download it from the /cli URL of your Jenkins controller. Are the plugins installed on your system the most recent releases? If not, is the problem resolved when you update to the most recent releases of the plugins? Please provide the detailed report of your Jenkins version and the installed plugins that is generated when you run the reporting script in the Jenkins script console from "Manage Jenkins".

          Polu added a comment - - edited

          Hi markewaite ,

           

          I am able to run below command.

          java -jar jenkins-cli.jar -s http://ininilabsispw01:8080/ -auth user:pwd

          I am not running through cli

           

          Steps to reproduce the issue:

          1. Install the Jenkins
          2. Create the parametrized project through Jenkins UI
          3. trigger the new job in parametrized project.
          4. Getting an error as "
            Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException"

          Can we connect if you have some time?

           

          Thanks,

          Anand.

           

          Polu added a comment - - edited Hi markewaite ,   I am able to run below command. java -jar jenkins-cli.jar -s http://ininilabsispw01:8080/ -auth user:pwd I am not running through cli   Steps to reproduce the issue: Install the Jenkins Create the parametrized project through Jenkins UI trigger the new job in parametrized project. Getting an error as " Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException" Can we connect if you have some time?   Thanks, Anand.  

          Mark Waite added a comment - - edited

          I am able to run below command.

          java -jar jenkins-cli.jar -s http://ininilabsispw01:8080/ -auth user:pwd

          I am not running through cli

          The jenkins-cli.jar that you are running is the Jenkins command line interface. It can be downloaded from the /cli URL of the Jenkins controller.

          I followed the steps that you described and am unable to duplicate the issue. You'll need to provide the details from the reporting script in hopes that the issue can be duplicated with those additional details.

          Steps that I took:

          1. Create a shell script run-jenkins.sh that downloads Jenkins 2.440.1 and the plugin installation manager tool
          2. Create an empty file plugins.txt that will cause no additional plugins to be installed
          3. Run the shell script run-jenkins.sh, install no additional plugins, and create a user for myself
          4. Define an access token in my user account in that Jenkins controller
          5. Create a parameterized freestyle project "has-a-param" with a choice parameter "CHOSEN_LETTER" with allowed values "A", "B", and "C"
          6. Run the parameterized freestyle project from the Jenkins user interface and confirm it passes
          7. Download the Jenkins CLI jar file with the command wget http://localhost:8080/jnlpJars/jenkins-cli.jar
          8. Run the Jenkins CLI jar file with the command
            java -jar jenkins-cli.jar -s http://localhost:8080 -auth mwaite:$TOKEN build -p CHOSEN_LETTER=C /has-a-param
          9. Confirm that the parameterized job ran as expected

          I ran the same checks with the most recent weekly release, Jenkins 2.449 and saw the same results. Parameterized jobs run from the command line with jenkins-cli.jar.

          Can we connect if you have some time?

          No, I don't provide private support, especially for issues that I cannot duplicate based on the instructions from the submitter.

          Mark Waite added a comment - - edited I am able to run below command. java -jar jenkins-cli.jar -s http://ininilabsispw01:8080/ -auth user:pwd I am not running through cli The jenkins-cli.jar that you are running is the Jenkins command line interface. It can be downloaded from the /cli URL of the Jenkins controller. I followed the steps that you described and am unable to duplicate the issue. You'll need to provide the details from the reporting script in hopes that the issue can be duplicated with those additional details. Steps that I took: Create a shell script run-jenkins.sh that downloads Jenkins 2.440.1 and the plugin installation manager tool Create an empty file plugins.txt that will cause no additional plugins to be installed Run the shell script run-jenkins.sh , install no additional plugins, and create a user for myself Define an access token in my user account in that Jenkins controller Create a parameterized freestyle project "has-a-param" with a choice parameter "CHOSEN_LETTER" with allowed values "A", "B", and "C" Run the parameterized freestyle project from the Jenkins user interface and confirm it passes Download the Jenkins CLI jar file with the command wget http://localhost:8080/jnlpJars/jenkins-cli.jar Run the Jenkins CLI jar file with the command java -jar jenkins-cli.jar -s http://localhost:8080 -auth mwaite:$TOKEN build -p CHOSEN_LETTER=C /has-a-param Confirm that the parameterized job ran as expected I ran the same checks with the most recent weekly release, Jenkins 2.449 and saw the same results. Parameterized jobs run from the command line with jenkins-cli.jar. Can we connect if you have some time? No, I don't provide private support, especially for issues that I cannot duplicate based on the instructions from the submitter.

          Mark Waite added a comment -

          Closing after months with no response.

          Mark Waite added a comment - Closing after months with no response.

            Unassigned Unassigned
            anandavardan Polu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: