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

Maven project failed with "Connection refused" when built in a docker Container

      Building a "Maven project" in a Docker container fails with a "connection refused" error message whereas the same build is successful in a "Freestyle project" (also build in a Docker container plugin).

      [ael.validate-in-docker-mvnproject] $ docker exec --tty --user 500: dc69be1aed975dbff977348d060329d75d1377ecbefaf929a269a11fc5e40373 env ANT_HOME=/opt/apache-ant-1.8.2 CLASSPATH= EXECUTOR_NUMBER=0 JAVA_HOME=/opt/jdk1.7.0_45 JENKINS_HOME=/data/EDT/jenkins M2_HOME=/opt/apache-maven-3.0.4 MAVEN_HOME=/opt/apache-maven-3.0.4 "MAVEN_OPTS=-Xms1g -Xmx1g -XX:MaxPermSize=256m -Dfile.encoding=Cp1252" no_proxy=/var/run/docker.sock ORACLE_HOME=/opt/oracle11/product/11.2.0/client/ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk1.7.0_45/bin:/opt/apache-ant-1.8.2/bin:/opt/apache-maven-3.0.4/bin TERM=xterm WORKSPACE=/data/EDT/jenkinsSlave_recette_1/c3f621fe/workspace/ael.validate-in-docker-mvnproject java -cp /data/EDT/jenkinsSlave_recette_1/c3f621fe/maven3-agent.jar:/opt/apache-maven-3.0.4/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main /opt/apache-maven-3.0.4 /data/EDT/jenkinsSlave_recette_1/slave.jar /data/EDT/jenkinsSlave_recette_1/c3f621fe/maven3-interceptor.jar /data/EDT/jenkinsSlave_recette_1/c3f621fe/maven3-interceptor-commons.jar 44848
      Exception in thread "main" java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:579)
      at java.net.Socket.connect(Socket.java:528)
      at java.net.Socket.<init>(Socket.java:425)
      at java.net.Socket.<init>(Socket.java:208)
      at org.jvnet.hudson.maven3.agent.Maven3Main.main(Maven3Main.java:136)
      at org.jvnet.hudson.maven3.agent.Maven3Main.main(Maven3Main.java:70)
      Stopping Docker container after build completion

          [JENKINS-32542] Maven project failed with "Connection refused" when built in a docker Container

          Sylvie Carrier created issue -

          clausfod added a comment -

          +1

          clausfod added a comment - +1

          Daniel Beck added a comment -

          Is this a regression?

          Daniel Beck added a comment - Is this a regression?

          No. We always had this behaviour. So we currently progress with freestyle job only...

          Sylvie Carrier added a comment - No. We always had this behaviour. So we currently progress with freestyle job only...

          Steven Dwyer added a comment -

          Having same issue.

          Steven Dwyer added a comment - Having same issue.
          Sylvie Carrier made changes -
          Environment Original: Jenkins ver. 1.625.3.1
          Plugin Version: 1.6.4
          New: Jenkins ver. 1.625.3.1
          Plugin Version: 1.6.5

          is your jenkins slave itself running in a docker container ?

          Nicolas De Loof added a comment - is your jenkins slave itself running in a docker container ?

          No the jenkins slave is "classic".
          Jenkins master (Linux RHEL) => jenkins slave (another Linux RHEL)

          Thomas Collignon added a comment - No the jenkins slave is "classic". Jenkins master (Linux RHEL) => jenkins slave (another Linux RHEL)

          Aaron Corley added a comment -

          My company almost exclusively uses Maven projects, and we are seeing this error. I'd really like to use this plugin but without Maven job support it is pretty much useless to us.

          Aaron Corley added a comment - My company almost exclusively uses Maven projects, and we are seeing this error. I'd really like to use this plugin but without Maven job support it is pretty much useless to us.

          Aaron Corley added a comment -

          I discovered a workaround: changing the advanced setting "Network bridge" to "host" caused the error to go away and the build to proceed normally.

          Aaron Corley added a comment - I discovered a workaround: changing the advanced setting "Network bridge" to "host" caused the error to go away and the build to proceed normally.

            Unassigned Unassigned
            scarrier Sylvie Carrier
            Votes:
            10 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated: