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

Migrating from DockerHub Jenkinsci to Jenkins/jenkins:lts images breaks while running the image

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: docker
    • Labels:
      None
    • Similar Issues:

      Description

      As the jenkinsci docker hub was deprectaed I had to move to jenkins/jenkins:lts version of jenkins docker image which is of version 2.121.2.  Earlier I was at 2.89.3. And now while I run the jenkins docker jenkins:lts image with custom plugins using install_plugins.sh the image is being built but it fails to launch jenkins on container run with err:

      // code placeholder
      
      PORT0 is set to Running from: /usr/share/jenkins/jenkins.war webroot: EnvVars.masterEnvVars.get("JENKINS_HOME") Jul 20, 2018 7:41:19 PM org.eclipse.jetty.util.log.Log initialized INFO: Logging initialized @909ms to org.eclipse.jetty.util.log.JavaUtilLog Jul 20, 2018 7:41:20 PM winstone.Logger logInternal INFO: Beginning extraction from war file Jul 20, 2018 7:41:22 PM org.eclipse.jetty.server.handler.ContextHandler setContextPath WARNING: Empty contextPath Jul 20, 2018 7:41:22 PM winstone.Logger logInternal INFO: Jetty shutdown successfully java.io.IOException: Failed to start a listener: winstone.HttpConnectorFactory at winstone.Launcher.spawnListener(Launcher.java:209) at winstone.Launcher.<init>(Launcher.java:148) at winstone.Launcher.main(Launcher.java:354) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at Main._main(Main.java:312) at Main.main(Main.java:136) Caused by: java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:592) at java.lang.Integer.parseInt(Integer.java:615) at winstone.cmdline.Option.intArg(Option.java:294) at winstone.cmdline.Option$OInt.get(Option.java:206) at winstone.HttpConnectorFactory.start(HttpConnectorFactory.java:30) at winstone.Launcher.spawnListener(Launcher.java:207) ... 8 more Jul 20, 2018 7:41:22 PM winstone.Logger logInternal SEVERE: Container startup failed java.io.IOException: Failed to start a listener: winstone.HttpConnectorFactory at winstone.Launcher.spawnListener(Launcher.java:209) at winstone.Launcher.<init>(Launcher.java:148) at winstone.Launcher.main(Launcher.java:354) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at Main._main(Main.java:312) at Main.main(Main.java:136) Caused by: java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:592) at java.lang.Integer.parseInt(Integer.java:615) at winstone.cmdline.Option.intArg(Option.java:294) at winstone.cmdline.Option$OInt.get(Option.java:206) at winstone.HttpConnectorFactory.start(HttpConnectorFactory.java:30) at winstone.Launcher.spawnListener(Launcher.java:207) ... 8 more

      You can recreate the issue with [1] [2][3]

      1. https://github.com/DevAuto/Jenkins-Docker/blob/master/Dockerfile

      2. docker build -t  jenkins <path to dockerfile> .

      3. docker run -p 3000:8080 -p 50000:50000 jenkins

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          It seems it is caused by the Shell you use in https://github.com/DevAuto/Jenkins-Docker/blob/master/jenkins_entrypoint.sh . When PORT0 is not passed, you pass an empty string to the command line. And it seems that in your case it leads to injection of the string with quotes since the string itself is not quoted. You can use "${JENKINS_OPTS}" in the command line, and it could help. But TBH I would rather recommend passing PORT0 so that you can bind the http port

          Show
          oleg_nenashev Oleg Nenashev added a comment - It seems it is caused by the Shell you use in https://github.com/DevAuto/Jenkins-Docker/blob/master/jenkins_entrypoint.sh . When PORT0 is not passed, you pass an empty string to the command line. And it seems that in your case it leads to injection of the string with quotes since the string itself is not quoted. You can use "${JENKINS_OPTS}" in the command line, and it could help. But TBH I would rather recommend passing PORT0 so that you can bind the http port
          Hide
          pruthvi6767 Pruthvi Raj Reddy Chukkannagari added a comment -

          That worked thank you for the help Oleg Nenashev ..!

          Show
          pruthvi6767 Pruthvi Raj Reddy Chukkannagari added a comment - That worked thank you for the help  Oleg Nenashev  ..!

            People

            • Assignee:
              csanchez Carlos Sanchez
              Reporter:
              pruthvi6767 Pruthvi Raj Reddy Chukkannagari
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: