• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • docker-plugin
    • None
    • docker.io/jenkins 1.609.2 0c79d0a394dc
      docker.io/evarga/jenkins-slave latest 8880612971b0
      docker-plugin 0.11.0

      After scheduling a job that should run in the container, the jenkins.log starts getting filled with

      Aug 09, 2015 11:37:22 AM com.nirima.jenkins.plugins.docker.DockerCloud provision
      INFO: Asked to provision 1 slave(s) for: test
      Aug 09, 2015 11:37:22 AM com.nirima.jenkins.plugins.docker.DockerCloud provision
      INFO: Will provision '8880612971b0e41ecc5de6943c9680bb8dc08027dbae4d3a275ac827293cbf2e', for label: 'test', in cloud: 'autodocker'
      Aug 09, 2015 11:37:22 AM com.nirima.jenkins.plugins.docker.DockerCloud addProvisionedSlave
      INFO: Provisioning '8880612971b0e41ecc5de6943c9680bb8dc08027dbae4d3a275ac827293cbf2e' number '0' on 'autodocker'; Total containers: '1'
      Aug 09, 2015 11:37:22 AM hudson.slaves.NodeProvisioner$StandardStrategyImpl apply
      INFO: Started provisioning Image of 8880612971b0e41ecc5de6943c9680bb8dc08027dbae4d3a275ac827293cbf2e from autodocker with 1 executors. Remaining excess workload: 0
      Aug 09, 2015 11:37:22 AM com.nirima.jenkins.plugins.docker.DockerCloud$1 call
      SEVERE: Error in provisioning; template='DockerTemplate{configVersion=2, labelString='test', launcher=com.nirima.jenkins.plugins.docker.launcher.DockerComputerSSHLauncher@79f5b686, remoteFsMapping='', remoteFs='/home/jenkins', instanceCap=1, mode=NORMAL, retentionStrategy=com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy@4d6c87d2, numExecutors=1, dockerTemplateBase=DockerTemplateBase{image=8880612971b0e41ecc5de6943c9680bb8dc08027dbae4d3a275ac827293cbf2e}, removeVolumes=false, pullStrategy=PULL_NEVER}' for cloud='autodocker'
      java.lang.NullPointerException
      	at java.util.Objects.requireNonNull(Objects.java:203)
      	at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
      	at java.util.Arrays.asList(Arrays.java:3800)
      	at com.nirima.jenkins.plugins.docker.DockerCloud$2.apply(DockerCloud.java:308)
      	at com.nirima.jenkins.plugins.docker.DockerCloud$2.apply(DockerCloud.java:305)
      	at shaded.com.google.common.collect.Iterators.indexOf(Iterators.java:778)
      	at shaded.com.google.common.collect.Iterators.any(Iterators.java:684)
      	at shaded.com.google.common.collect.Iterables.any(Iterables.java:623)
      	at com.nirima.jenkins.plugins.docker.DockerCloud.pullImage(DockerCloud.java:305)
      	at com.nirima.jenkins.plugins.docker.DockerCloud.provisionWithWait(DockerCloud.java:334)
      	at com.nirima.jenkins.plugins.docker.DockerCloud.access$000(DockerCloud.java:55)
      	at com.nirima.jenkins.plugins.docker.DockerCloud$1.call(DockerCloud.java:219)
      	at com.nirima.jenkins.plugins.docker.DockerCloud$1.call(DockerCloud.java:216)
      	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      
      

      no container seems to be getting started. Changin the Pull strategy doesn't help.

          [JENKINS-29868] NullPointerException in DockerCloud.pullImage

          Kanstantsin Shautsou added a comment - https://github.com/jenkinsci/docker-plugin/blob/master/CONTRIBUTING.md

          Jaroslav Henner added a comment - - edited

          Sorry, I have acidentaly removed the container with my jenkins, but I managed to get some of the information from my consoles:

           ls /var/jenkins_home/plugins/
          DotCi                          credentials.jpi.pinned               docker-traceability         github-oauth.jpi     matrix-auth          ssh-credentials.bak
          DotCi.jpi                      cvs                                  docker-traceability.jpi     javadoc              matrix-auth.jpi      ssh-credentials.jpi
          ant                            cvs.jpi                              dockerhub-notification      javadoc.jpi          matrix-project       ssh-credentials.jpi.pinned
          ant.jpi                        docker-build-publish                 dockerhub-notification.jpi  jclouds-jenkins      matrix-project.jpi   ssh-slaves
          antisamy-markup-formatter      docker-build-publish.jpi             durable-task                jclouds-jenkins.jpi  maven-plugin         ssh-slaves.jpi
          antisamy-markup-formatter.jpi  docker-build-step                    durable-task.jpi            junit                maven-plugin.jpi     subversion
          async-http-client              docker-build-step.jpi                external-monitor-job        junit.jpi            pam-auth             subversion.jpi
          async-http-client.jpi          docker-build-step.jpi.disabled       external-monitor-job.jpi    kubernetes           pam-auth.jpi         token-macro
          authentication-tokens          docker-commons                       git                         kubernetes.jpi       rebuild              token-macro.jpi
          authentication-tokens.jpi      docker-commons.jpi                   git-client                  ldap                 rebuild.jpi          translation
          compound-slaves                docker-custom-build-environment      git-client.jpi              ldap.jpi             scm-api              translation.jpi
          compound-slaves.jpi            docker-custom-build-environment.jpi  git.jpi                     mailer               scm-api.jpi          windows-slaves
          credentials                    docker-plugin                        github-api                  mailer.bak           script-security      windows-slaves.jpi
          credentials.bak                docker-plugin.bak                    github-api.jpi              mailer.jpi           script-security.jpi
          credentials.jpi                docker-plugin.jpi                    github-oauth                mailer.jpi.pinned    ssh-credentials
          

          The config.xml

             <com.nirima.jenkins.plugins.docker.DockerCloud plugin="docker-plugin@0.11.0">
                <name>autodocker</name>
                <templates>
                  <com.nirima.jenkins.plugins.docker.DockerTemplate>
                    <configVersion>2</configVersion>
                    <labelString>test</labelString>
                    <launcher class="com.nirima.jenkins.plugins.docker.launcher.DockerComputerSSHLauncher">
                      <sshConnector plugin="ssh-slaves@1.9">
                        <port>22</port>
                        <credentialsId>47b628df-8125-4e72-958d-01c856f6b274</credentialsId>
                        <jvmOptions></jvmOptions>
                        <javaPath></javaPath>
                        <maxNumRetries>0</maxNumRetries>
                        <retryWaitTime>0</retryWaitTime>
                      </sshConnector>
                    </launcher>
                    <remoteFsMapping></remoteFsMapping>
                    <remoteFs>/home/jenkins</remoteFs>
                    <instanceCap>1</instanceCap>
                    <mode>NORMAL</mode>
                    <retentionStrategy class="com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy">
                      <idleMinutes>10</idleMinutes>
                      <idleMinutes defined-in="com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy">10</idleMinutes>
                    </retentionStrategy>
                    <numExecutors>1</numExecutors>
                    <dockerTemplateBase>
                      <image>8880612971b0e41ecc5de6943c9680bb8dc08027dbae4d3a275ac827293cbf2e</image>
                      <dockerCommand></dockerCommand>
                      <lxcConfString></lxcConfString>
                      <hostname></hostname>
                      <dnsHosts/>
                      <volumes/>
                      <volumesFrom2/>
                      <environment/>
                      <bindPorts></bindPorts>
                      <bindAllPorts>false</bindAllPorts>
                      <privileged>false</privileged>
                      <tty>false</tty>
                      <extraHosts class="java.util.Collections$UnmodifiableRandomAccessList" resolves-to="java.util.Collections$UnmodifiableList">
                        <c class="list"/>
                        <list reference="../c"/>
                      </extraHosts>
                    </dockerTemplateBase>
                    <removeVolumes>false</removeVolumes>
                    <pullStrategy>PULL_NEVER</pullStrategy>
                  </com.nirima.jenkins.plugins.docker.DockerTemplate>
                </templates>
                <serverUrl>http://xx.yy.zz.aa:2375</serverUrl>
                <connectTimeout>5</connectTimeout>
                <readTimeout>15</readTimeout>
                <version>1.5.0</version>
                <credentialsId></credentialsId>
                <containerCap>10</containerCap>
              </com.nirima.jenkins.plugins.docker.DockerCloud>
          

          I am not getting NPE after creating new container with my jenkins, and configuring it similar way (with the difference that port 5000 is being exported now).

          Jaroslav Henner added a comment - - edited Sorry, I have acidentaly removed the container with my jenkins, but I managed to get some of the information from my consoles: ls /var/jenkins_home/plugins/ DotCi credentials.jpi.pinned docker-traceability github-oauth.jpi matrix-auth ssh-credentials.bak DotCi.jpi cvs docker-traceability.jpi javadoc matrix-auth.jpi ssh-credentials.jpi ant cvs.jpi dockerhub-notification javadoc.jpi matrix-project ssh-credentials.jpi.pinned ant.jpi docker-build-publish dockerhub-notification.jpi jclouds-jenkins matrix-project.jpi ssh-slaves antisamy-markup-formatter docker-build-publish.jpi durable-task jclouds-jenkins.jpi maven-plugin ssh-slaves.jpi antisamy-markup-formatter.jpi docker-build-step durable-task.jpi junit maven-plugin.jpi subversion async-http-client docker-build-step.jpi external-monitor-job junit.jpi pam-auth subversion.jpi async-http-client.jpi docker-build-step.jpi.disabled external-monitor-job.jpi kubernetes pam-auth.jpi token-macro authentication-tokens docker-commons git kubernetes.jpi rebuild token-macro.jpi authentication-tokens.jpi docker-commons.jpi git-client ldap rebuild.jpi translation compound-slaves docker-custom-build-environment git-client.jpi ldap.jpi scm-api translation.jpi compound-slaves.jpi docker-custom-build-environment.jpi git.jpi mailer scm-api.jpi windows-slaves credentials docker-plugin github-api mailer.bak script-security windows-slaves.jpi credentials.bak docker-plugin.bak github-api.jpi mailer.jpi script-security.jpi credentials.jpi docker-plugin.jpi github-oauth mailer.jpi.pinned ssh-credentials The config.xml <com.nirima.jenkins.plugins.docker.DockerCloud plugin="docker-plugin@0.11.0"> <name>autodocker</name> <templates> <com.nirima.jenkins.plugins.docker.DockerTemplate> <configVersion>2</configVersion> <labelString>test</labelString> <launcher class="com.nirima.jenkins.plugins.docker.launcher.DockerComputerSSHLauncher"> <sshConnector plugin="ssh-slaves@1.9"> <port>22</port> <credentialsId>47b628df-8125-4e72-958d-01c856f6b274</credentialsId> <jvmOptions></jvmOptions> <javaPath></javaPath> <maxNumRetries>0</maxNumRetries> <retryWaitTime>0</retryWaitTime> </sshConnector> </launcher> <remoteFsMapping></remoteFsMapping> <remoteFs>/home/jenkins</remoteFs> <instanceCap>1</instanceCap> <mode>NORMAL</mode> <retentionStrategy class="com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy"> <idleMinutes>10</idleMinutes> <idleMinutes defined-in="com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy">10</idleMinutes> </retentionStrategy> <numExecutors>1</numExecutors> <dockerTemplateBase> <image>8880612971b0e41ecc5de6943c9680bb8dc08027dbae4d3a275ac827293cbf2e</image> <dockerCommand></dockerCommand> <lxcConfString></lxcConfString> <hostname></hostname> <dnsHosts/> <volumes/> <volumesFrom2/> <environment/> <bindPorts></bindPorts> <bindAllPorts>false</bindAllPorts> <privileged>false</privileged> <tty>false</tty> <extraHosts class="java.util.Collections$UnmodifiableRandomAccessList" resolves-to="java.util.Collections$UnmodifiableList"> <c class="list"/> <list reference="../c"/> </extraHosts> </dockerTemplateBase> <removeVolumes>false</removeVolumes> <pullStrategy>PULL_NEVER</pullStrategy> </com.nirima.jenkins.plugins.docker.DockerTemplate> </templates> <serverUrl>http://xx.yy.zz.aa:2375</serverUrl> <connectTimeout>5</connectTimeout> <readTimeout>15</readTimeout> <version>1.5.0</version> <credentialsId></credentialsId> <containerCap>10</containerCap> </com.nirima.jenkins.plugins.docker.DockerCloud> I am not getting NPE after creating new container with my jenkins, and configuring it similar way (with the difference that port 5000 is being exported now).

          Olaf Flebbe added a comment -

          I was able to reproduce this: While debugging the issue I found the root of the problem I had: I typed in a "1" into the "docker version" of the "cloud" part of the configuration. it was not clear to me that I can leave it blank.

          In DockerCloud pullImage() method image.getRepoTags() is used. Since Docker API Version 1 does not fill in the repo tags values, this will be null every time and Arrays.asList() will create a NPE.

          The not-so-obvious fix for me was to remove the 1 from the API Version.

          BTW: Why is this a user setting at all? The API contract is between docker-plugin and docker server assuming a certain API level range between them, and not between user and docker. So I am assuming that this setting should not be needed at all. If really needed, please move it to some "expert settings"...

          Olaf Flebbe added a comment - I was able to reproduce this: While debugging the issue I found the root of the problem I had: I typed in a "1" into the "docker version" of the "cloud" part of the configuration. it was not clear to me that I can leave it blank. In DockerCloud pullImage() method image.getRepoTags() is used. Since Docker API Version 1 does not fill in the repo tags values, this will be null every time and Arrays.asList() will create a NPE. The not-so-obvious fix for me was to remove the 1 from the API Version. BTW: Why is this a user setting at all? The API contract is between docker-plugin and docker server assuming a certain API level range between them, and not between user and docker. So I am assuming that this setting should not be needed at all. If really needed, please move it to some "expert settings"...

          As i understand docker supports some API versions and docker-java allows set it. I have many errors about it and i want remove it from user at all...

          Kanstantsin Shautsou added a comment - As i understand docker supports some API versions and docker-java allows set it. I have many errors about it and i want remove it from user at all...

          Not working anymore on this plugin.

          Kanstantsin Shautsou added a comment - Not working anymore on this plugin.

            ndeloof Nicolas De Loof
            jhenner Jaroslav Henner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: