question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jobs failing when "Expose DOCKER_HOST" is checked

See original GitHub issue

Hello,

As the title says, jobs are failing when the “Expose DOCKER_HOST” is checked in the global settings, the job console shows the following stack trace:

FATAL: null
java.lang.NullPointerException
	at com.nirima.jenkins.plugins.docker.DockerBuildVariableContributor.buildVariablesFor(DockerBuildVariableContributor.java:34)
	at hudson.model.AbstractBuild.getBuildVariables(AbstractBuild.java:1000)
	at org.jenkinsci.plugins.envinject.util.RunHelper.getBuildVariables(RunHelper.java:80)
	at org.jenkinsci.plugins.envinject.util.RunHelper.getBuildVariables(RunHelper.java:154)
	at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironmentWithoutJobPropertyObject(EnvInjectListener.java:235)
	at org.jenkinsci.plugins.envinject.EnvInjectListener.setUpEnvironment(EnvInjectListener.java:51)
	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:534)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:454)
	at hudson.model.Run.execute(Run.java:1737)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:419)
Finished: FAILURE

“Computer log”:

[10/11/17 01:14:34] [SSH] Opening SSH connection to 10.96.14.31:36850.
Connection refused (Connection refused)
SSH Connection failed with IOException: "Connection refused (Connection refused)".
java.io.IOException: There was a problem while connecting to 10.96.14.31:36850
	at com.trilead.ssh2.Connection.connect(Connection.java:834)
	at com.trilead.ssh2.Connection.connect(Connection.java:703)
	at com.trilead.ssh2.Connection.connect(Connection.java:617)
	at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1284)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:804)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:793)
	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)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:367)
	at com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:480)
	at com.trilead.ssh2.Connection.connect(Connection.java:774)
	... 9 more
[10/11/17 01:14:34] Launch failed - cleaning up connection
[10/11/17 01:14:34] [SSH] Connection closed.

And here’s the failed build.xml:

<?xml version='1.0' encoding='UTF-8'?>
<build>
  <actions>
    <hudson.model.CauseAction>
      <causeBag class="linked-hash-map">
        <entry>
          <hudson.model.Cause_-UserIdCause>
            <userId>ffarah</userId>
          </hudson.model.Cause_-UserIdCause>
          <int>1</int>
        </entry>
      </causeBag>
    </hudson.model.CauseAction>
    <jenkins.metrics.impl.TimeInQueueAction plugin="metrics@3.1.2.10">
      <queuingDurationMillis>3378</queuingDurationMillis>
    </jenkins.metrics.impl.TimeInQueueAction>
    <io.jenkins.blueocean.service.embedded.BlueOceanUrlAction plugin="blueocean-rest-impl@1.2.4">
      <blueOceanUrlObject class="io.jenkins.blueocean.service.embedded.BlueOceanUrlObjectImpl">
        <mappedUrl>blue/organizations/jenkins/Dev.eng-pst.devtools.test-jenkins/detail/Dev.eng-pst.devtools.test-jenkins/8</mappedUrl>
      </blueOceanUrlObject>
    </io.jenkins.blueocean.service.embedded.BlueOceanUrlAction>
    <org.jenkinsci.plugins.envinject.EnvInjectPluginAction plugin="envinject@2.1.4"/>
    <com.nirima.jenkins.plugins.docker.action.DockerBuildAction plugin="docker-plugin@0.17">
      <containerId>bd454f6d01f27b3c10e68bec511d07738875e8530cbcfc372b853f3ef30d1d4d</containerId>
      <remoteFsMapping>/var/lib/jenkins/workspace</remoteFsMapping>
    </com.nirima.jenkins.plugins.docker.action.DockerBuildAction>
  </actions>
  <queueId>56</queueId>
  <timestamp>1507684471855</timestamp>
  <startTime>1507684471862</startTime>
  <result>FAILURE</result>
  <duration>101</duration>
  <charset>US-ASCII</charset>
  <keepLog>false</keepLog>
  <builtOn>Docker-10a216054f4921</builtOn>
  <hudsonVersion>2.73.1</hudsonVersion>
  <scm class="hudson.scm.NullChangeLogParser"/>
  <culprits class="com.google.common.collect.EmptyImmutableSortedSet"/>
</build>

Any idea why this is happening? When I uncheck the option the build succeeds.

Fadi

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ndeloofcommented, Oct 12, 2017
0reactions
farahfacommented, Oct 12, 2017

Oh my bad, I thought the fix was in 0.18.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker in Docker is failing with error - Cannot connect to the ...
We are using self hosted Gitlab and Runner and trying to use dind to run CI/CD builds but all my jobs are failing...
Read more >
ERROR: Job failed (system failure): Cannot connect to the ...
1. Launch the runner, specify and forward the address to reach the host Docker daemon · 2. Register the runner with privileged ·...
Read more >
Docker Context - Docker Documentation
It is configured to talk to an endpoint exposed on a local Unix socket at /var/run/docker.sock ( Endpoints.docker.Host ), and requires TLS verification ......
Read more >
Docker connection refused between two containers
When creating the image of container n2 i exposed port 5000. ... Check to make sure they're both on the same network. They...
Read more >
Deploy services to a swarm - Docker Documentation
If the worker fails to pull the image, the service fails to deploy on that ... If an external host connects to that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found