Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Slaves die randomly during build. #628

Closed
BlueMesaDev opened this issue Feb 26, 2018 · 16 comments · Fixed by #693
Closed

Docker Slaves die randomly during build. #628

BlueMesaDev opened this issue Feb 26, 2018 · 16 comments · Fixed by #693

Comments

@BlueMesaDev
Copy link

BlueMesaDev commented Feb 26, 2018

Docker Plugin versions:
1.1.3 and 1.2 SNAPSHOT

Jenkins Version:
2.89.4

Docker Version:
Version: 17.03.2-ce
API version: 1.27 (minimum version 1.12)
Go version: go1.7.5
Git commit: f5ec1e2
Built: Tue Jun 27 02:21:36 2017

Possibly related issue:
#621

My actual problem

I created a basic freestyle test project. This just prints out a directory listing, touches a file (to make sure mounting volumes works correctly), but doesn't run for >60 seconds.
This always completes correctly.

With all versions of the plugin, what happens, other than for the trivial "Test" job, all jobs fail before completion.

All failing jobs are Maven based.

  • Some can run for 30 seconds then fail while cloning the git repository.
  • Some can die after 5 minutes. The last stack trace below shows this. I'm only building a single bundle, as it's gets frustrating when the build fails 2 minutes before the end of a 50 minute release, so by using just one bundle, it fails more quickly.
  • Some can run for 45 minutes, and then fail when Jenkins is cleaning up. The same job which gave the last stack trace normally fails after 10 minutes (give or take)

When they die, they are always cleaned up correctly, and the next job always starts correctly.

I upgraded to 1.2 SNAPSHOT after I saw the possibly related issue above, but it made no difference.

Infrastructure is a single VM, dual core 8Gb RAM, 100Gb HDD running the docker server + JFrog artifactory.

There is no old data present currently. I had an issue with old maven data being present, but that's been removed.

Relevant Jenkins Config

Template is configured to communicate via Attaching to Docker Container. This is because if I connect via SSH, something, somewhere has an issue, and the SSH key is passed from the Docker Plugin>Docker Container to the Container>GIT repository, which causes an authentication failure. I can't build a JNLP image on our server here, due to missing files, so I'm kind of stuck with the SSH image for now.

Configuration for the Jenkins Template is below. idleMinutes is set to 10, but it seems to make no difference if I set it to 60.

Clouds configuration is attached as clouds.txt.

Installation History
Version 1.1.2 was already installed on the box when I took over managing it. I then upgraded to 1.1.3. As far as I know, version 0.16.x or earlier has never been installed on this Jenkins.

I've installed 1.2 SNAPSHOT to see if it helped.

Stack Traces:
All stack traces are along the lines of the blocks below. I've not supplied the full build logs, as most of these are >1Mb, and don't actually give much information.

14:00:49 Archiving artifacts
14:00:52 ERROR: Failed to archive artifacts: Installer/MiddlewareInstallerKarafAssembly/.exe, Installer/MiddlewareInstallerKarafAssembly/.run, Installer/MiddlewareInstallerKarafAssembly/AutoInstallScript.txt, Middleware-Parent/karaf-assembly/license.txt
14:00:52 java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 4
14:00:52 at io.jenkins.docker.client.DockerMultiplexedInputStream.readInternal(DockerMultiplexedInputStream.java:45)
14:00:52 at io.jenkins.docker.client.DockerMultiplexedInputStream.read(DockerMultiplexedInputStream.java:25)
14:00:52 at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:91)
14:00:52 at hudson.remoting.ChunkedInputStream.readHeader(ChunkedInputStream.java:72)
14:00:52 at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:103)
14:00:52 at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
14:00:52 at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
14:00:52 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
14:00:52 Caused: java.io.IOException
14:00:52 at hudson.remoting.FastPipedInputStream.read(FastPipedInputStream.java:169)
14:00:52 at hudson.util.HeadBufferingStream.read(HeadBufferingStream.java:61)
14:00:52 at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:175)
14:00:52 at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106)
14:00:52 at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:614)
14:00:52 at java.io.InputStream.read(Unknown Source)
14:00:52 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
14:00:52 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
14:00:52 at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
14:00:52 at hudson.util.IOUtils.copy(IOUtils.java:40)
14:00:52 at hudson.FilePath.readFromTar(FilePath.java:2307)
14:00:52 Also: <cycle to java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 4>
14:00:52 Caused: hudson.remoting.RequestAbortedException
14:00:52 at hudson.remoting.Request.abort(Request.java:329)
14:00:52 at hudson.remoting.Channel.terminate(Channel.java:992)
14:00:52 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:96)
14:00:52 Caused: java.util.concurrent.ExecutionException
14:00:52 at hudson.remoting.Request$1.get(Request.java:308)
14:00:52 at hudson.remoting.Request$1.get(Request.java:229)
14:00:52 at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59)
14:00:52 at hudson.FilePath.copyRecursiveTo(FilePath.java:2224)
14:00:52 Caused: java.io.IOException: Failed to extract /home/jenkins/workspace/Middleware_Develop/transfer of 4 files
14:00:52 at hudson.FilePath.readFromTar(FilePath.java:2317)
14:00:52 at hudson.FilePath.copyRecursiveTo(FilePath.java:2221)
14:00:52 at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
14:00:52 at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:245)
14:00:52 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
14:00:52 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
14:00:52 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
14:00:52 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
14:00:52 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1073)
14:00:52 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
14:00:52 at hudson.model.Run.execute(Run.java:1749)
14:00:52 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
14:00:52 at hudson.model.ResourceController.execute(ResourceController.java:97)
14:00:52 at hudson.model.Executor.run(Executor.java:429)
14:00:52 Build step 'Archive the artifacts' changed build result to FAILURE

14:19:47 ERROR: Build step failed with exception
14:19:47 java.lang.NullPointerException: no workspace from node io.jenkins.docker.DockerTransientNode[docker-298a19d5038f4] which is computer DockerComputer{name=docker-298a19d5038f4, slave=io.jenkins.docker.DockerTransientNode[docker-298a19d5038f4]} and has channel null
14:19:47 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:88)
14:19:47 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
14:19:47 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
14:19:47 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
14:19:47 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
14:19:47 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:896)
14:19:47 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
14:19:47 at hudson.model.Run.execute(Run.java:1724)
14:19:47 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
14:19:47 at hudson.model.ResourceController.execute(ResourceController.java:97)
14:19:47 at hudson.model.Executor.run(Executor.java:429)
14:19:47 Build step 'Execute shell' marked build as failure
14:19:47 ERROR: Failed to parse POMs
14:19:47 java.io.IOException: Failed to extract /home/jenkins/workspace/Middleware_Develop/Middleware-Parent/karaf-assembly/transfer of 3 files
14:19:47 at hudson.FilePath.readFromTar(FilePath.java:2317)
14:19:47 at hudson.FilePath.copyRecursiveTo(FilePath.java:2221)
14:19:47 at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
14:19:47 at hudson.maven.MavenBuild$ProxyImpl.performArchiving(MavenBuild.java:512)
14:19:47 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:881)
14:19:47 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
14:19:47 at hudson.model.Run.execute(Run.java:1724)
14:19:47 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
14:19:47 at hudson.model.ResourceController.execute(ResourceController.java:97)
14:19:47 at hudson.model.Executor.run(Executor.java:429)
14:19:47 Suppressed: java.util.concurrent.ExecutionException: hudson.remoting.RequestAbortedException: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 7
14:19:47 at hudson.remoting.Request$1.get(Request.java:308)
14:19:47 at hudson.remoting.Request$1.get(Request.java:229)
14:19:47 at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59)
14:19:47 at hudson.FilePath.copyRecursiveTo(FilePath.java:2224)
14:19:47 ... 8 more
14:19:47 Caused by: hudson.remoting.RequestAbortedException: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 7
14:19:47 at hudson.remoting.Request.abort(Request.java:329)
14:19:47 at hudson.remoting.Channel.terminate(Channel.java:992)
14:19:47 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:96)
14:19:47 Caused by: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 7
14:19:47 at io.jenkins.docker.client.DockerMultiplexedInputStream.readInternal(DockerMultiplexedInputStream.java:45)
14:19:47 at io.jenkins.docker.client.DockerMultiplexedInputStream.read(DockerMultiplexedInputStream.java:25)
14:19:47 at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:91)
14:19:47 at hudson.remoting.ChunkedInputStream.readHeader(ChunkedInputStream.java:72)
14:19:47 at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:103)
14:19:47 at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
14:19:47 at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
14:19:47 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
14:19:47 Caused by: java.io.IOException: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 7
14:19:47 at hudson.remoting.FastPipedInputStream.read(FastPipedInputStream.java:169)
14:19:47 at hudson.util.HeadBufferingStream.read(HeadBufferingStream.java:61)
14:19:47 at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:175)
14:19:47 at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106)
14:19:47 at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:614)
14:19:47 at java.io.InputStream.read(Unknown Source)
14:19:47 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
14:19:47 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
14:19:47 at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
14:19:47 at hudson.util.IOUtils.copy(IOUtils.java:40)
14:19:47 at hudson.FilePath.readFromTar(FilePath.java:2307)
14:19:47 ... 9 more
14:19:47 [CIRCULAR REFERENCE:java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 7]
14:19:48 ERROR: Step ‘JIRA: Update relevant issues’ failed: no workspace for Middleware_Develop #42

20:20:36 Waiting for Jenkins to finish collecting data
20:20:36 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/qrc-firmware-manager/pom.xml to com.te.quareosimulator.firmware/qrc-firmware-manager/2.2.5-RELEASE/qrc-firmware-manager-2.2.5-RELEASE.pom
20:20:36 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/qrc-firmware-manager/target/qrc-firmware-manager.jar to com.te.quareosimulator.firmware/qrc-firmware-manager/2.2.5-RELEASE/qrc-firmware-manager-2.2.5-RELEASE.jar
20:21:01 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/config-rest-interface/pom.xml to com.te.quareosimulator.endpoint/config-rest-endpoints/2.2.5-RELEASE/config-rest-endpoints-2.2.5-RELEASE.pom
20:21:01 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/config-rest-interface/target/config-rest-endpoints.jar to com.te.quareosimulator.endpoint/config-rest-endpoints/2.2.5-RELEASE/config-rest-endpoints-2.2.5-RELEASE.jar
20:21:02 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/quareo-device-cache/pom.xml to com.te.quareosimulator.device/quareo-device-cache/2.2.5-RELEASE/quareo-device-cache-2.2.5-RELEASE.pom
20:21:02 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/quareo-device-cache/target/quareo-device-cache.jar to com.te.quareosimulator.device/quareo-device-cache/2.2.5-RELEASE/quareo-device-cache-2.2.5-RELEASE.jar
20:21:03 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/karaf-assembly/pom.xml to com.te.quareosimulator.karaf/karaf-assembly/2.2.5-RELEASE/karaf-assembly-2.2.5-RELEASE.pom
20:21:03 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/karaf-assembly/pom.xml to com.te.quareosimulator.karaf/karaf-assembly/2.2.5-RELEASE/karaf-assembly-2.2.5-RELEASE.karaf-assembly
20:21:03 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/karaf-assembly/target/karaf-assembly-2.2.5-RELEASE.tar.gz to com.te.quareosimulator.karaf/karaf-assembly/2.2.5-RELEASE/karaf-assembly-2.2.5-RELEASE.tar.gz
20:21:03 [JENKINS] Archiving /home/jenkins/workspace/Quareo-Simulator_QS-Release/karaf-assembly/target/karaf-assembly-2.2.5-RELEASE.zip to com.te.quareosimulator.karaf/karaf-assembly/2.2.5-RELEASE/karaf-assembly-2.2.5-RELEASE.zip
20:21:05 ERROR: Failed to parse POMs
20:21:05 java.io.IOException: Failed to extract /home/jenkins/workspace/Quareo-Simulator_QS-Release/karaf-assembly/transfer of 4 files
20:21:05 at hudson.FilePath.readFromTar(FilePath.java:2317)
20:21:05 at hudson.FilePath.copyRecursiveTo(FilePath.java:2221)
20:21:05 at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
20:21:05 at hudson.maven.MavenBuild$ProxyImpl.performArchiving(MavenBuild.java:512)
20:21:05 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:881)
20:21:05 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
20:21:05 at hudson.model.Run.execute(Run.java:1724)
20:21:05 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
20:21:05 at hudson.model.ResourceController.execute(ResourceController.java:97)
20:21:05 at hudson.model.Executor.run(Executor.java:429)
20:21:05 Suppressed: java.util.concurrent.ExecutionException: hudson.remoting.RequestAbortedException: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1
20:21:05 at hudson.remoting.Request$1.get(Request.java:308)
20:21:05 at hudson.remoting.Request$1.get(Request.java:229)
20:21:05 at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59)
20:21:05 at hudson.FilePath.copyRecursiveTo(FilePath.java:2224)
20:21:05 ... 8 more
20:21:05 Caused by: hudson.remoting.RequestAbortedException: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1
20:21:05 at hudson.remoting.Request.abort(Request.java:329)
20:21:05 at hudson.remoting.Channel.terminate(Channel.java:992)
20:21:05 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:96)
20:21:05 Caused by: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1
20:21:05 at io.jenkins.docker.client.DockerMultiplexedInputStream.readInternal(DockerMultiplexedInputStream.java:45)
20:21:05 at io.jenkins.docker.client.DockerMultiplexedInputStream.read(DockerMultiplexedInputStream.java:25)
20:21:05 at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:91)
20:21:05 at hudson.remoting.ChunkedInputStream.readHeader(ChunkedInputStream.java:72)
20:21:05 at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:103)
20:21:05 at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
20:21:05 at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
20:21:05 at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
20:21:05 Caused by: java.io.IOException: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1
20:21:05 at hudson.remoting.FastPipedInputStream.read(FastPipedInputStream.java:169)
20:21:05 at hudson.util.HeadBufferingStream.read(HeadBufferingStream.java:61)
20:21:05 at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:175)
20:21:05 at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106)
20:21:05 at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:614)
20:21:05 at java.io.InputStream.read(Unknown Source)
20:21:05 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
20:21:05 at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
20:21:05 at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
20:21:05 at hudson.util.IOUtils.copy(IOUtils.java:40)
20:21:05 at hudson.FilePath.readFromTar(FilePath.java:2307)
20:21:05 ... 9 more
20:21:05 [CIRCULAR REFERENCE:java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1]
20:21:05 ERROR: Step ‘Archive the artifacts’ failed: no workspace for Quareo-Simulator_QS-Release #67

This stack trace shows it happening 5 minutes after the start of the build...

Started by user Smith, Peter (Pete)
[EnvInject] - Loading node environment variables.
Building remotely on docker-29a83953db3cf on docker (docker-Middleware_Develop) in workspace /home/jenkins/workspace/Middleware_Develop

/usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
/usr/bin/git config remote.origin.url http://cdcaimgitp1.commscope.com/root/QuareoMiddleware.git # timeout=10
Fetching upstream changes from http://cdcaimgitp1.commscope.com/root/QuareoMiddleware.git
/usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials Gitlab Checkout
/usr/bin/git fetch --tags --progress http://cdcaimgitp1.commscope.com/root/QuareoMiddleware.git +refs/heads/:refs/remotes/origin/ # timeout=30
/usr/bin/git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
/usr/bin/git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Checking out Revision 5f95be55e3327417cea16f2cf418bad7fa91b705 (refs/remotes/origin/develop)
/usr/bin/git config core.sparsecheckout # timeout=10
/usr/bin/git checkout -f 5f95be55e3327417cea16f2cf418bad7fa91b705
Commit message: "AIMQS-155 Further changes to config files"
/usr/bin/git rev-list --no-walk 5f95be55e3327417cea16f2cf418bad7fa91b705 # timeout=10
Parsing POMs
Established TCP socket on 44360
maven3-agent.jar already up to date
maven3-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[Middleware-Parent] $ /usr/lib/jvm/java-8-oracle//bin/java -cp /home/jenkins/maven3-agent.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven /home/jenkins/remoting-3.14.jar /home/jenkins/maven3-interceptor.jar /home/jenkins/maven3-interceptor-commons.jar 44360
<===[JENKINS REMOTING CAPACITY]===>���channel started
Executing Maven: -B -f /home/jenkins/workspace/Middleware_Develop/Middleware-Parent/pom.xml clean install -rf karaf-feature -P apiDocBuilder,buildInstaller,karaf-assembly -DskipTests=true -Dproduct.name=QuareoMiddleware -Dbuild-info.buildNumber=Middleware_Develop-43 -Dhostname=docker-29a83953db3cf
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.codehaus.izpack:IzPack:pom:4.3.5
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-install-plugin is missing. @ line 102, column 13
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.te.middleware.installer.karaf:MiddlewareInstallerKarafAssembly:jar:3.0.2-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-dependency-plugin @ line 71, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] Initializing Artifactory Build-Info Recording
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Quareo Middleware :: Karaf Feature
[INFO] Quareo Middleware :: Karaf Runtime
[INFO] IzPack Standalone Compiler
[INFO] Quareo Middleware Installer Parent
[INFO] Quareo Middleware Installer
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
[HUDSON] Collecting dependencies info
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
[HUDSON] Collecting dependencies info
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
[HUDSON] Collecting dependencies info
[HUDSON] Collecting dependencies info
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
[HUDSON] Collecting dependencies info
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
Notifying upstream projects of job completion
Join notifier requires a CauseAction
ERROR: Build step failed with exception
java.lang.NullPointerException: no workspace from node io.jenkins.docker.DockerTransientNode[docker-29a83953db3cf] which is computer DockerComputer{name=docker-29a83953db3cf, slave=io.jenkins.docker.DockerTransientNode[docker-29a83953db3cf]} and has channel null
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:88)
at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:896)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1724)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Execute shell' marked build as failure
ERROR: Failed to parse POMs
java.io.IOException: Backing channel 'docker-29a83953db3cf' is disconnected.
at hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:212)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:281)
at com.sun.proxy.$Proxy98.isAlive(Unknown Source)
at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1138)
at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:166)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:879)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1724)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1
at io.jenkins.docker.client.DockerMultiplexedInputStream.readInternal(DockerMultiplexedInputStream.java:45)
at io.jenkins.docker.client.DockerMultiplexedInputStream.read(DockerMultiplexedInputStream.java:32)
at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:99)
at hudson.remoting.ChunkedInputStream.read(ChunkedInputStream.java:46)
at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:97)
at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
ERROR: Step ‘JIRA: Update relevant issues’ failed: no workspace for Middleware_Develop #43
ERROR: Step ‘Publish Cobertura Coverage Report’ failed: no workspace for Middleware_Develop #43
Notifying upstream projects of job completion
Finished: FAILURE

The underlying Jenkins log error for the stack trace above is

Feb 26, 2018 9:50:09 AM SEVERE hudson.remoting.SynchronousCommandTransport$ReaderThread run
I/O error in channel Channel to Maven [/usr/lib/jvm/java-8-oracle//bin/java, -cp, /home/jenkins/maven3-agent.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar, org.jvnet.hudson.maven3.agent.Maven3Main, /usr/share/maven, /home/jenkins/remoting-3.14.jar, /home/jenkins/maven3-interceptor.jar, /home/jenkins/maven3-interceptor-commons.jar, 44360]
java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header, got 1
at io.jenkins.docker.client.DockerMultiplexedInputStream.readInternal(DockerMultiplexedInputStream.java:45)
at io.jenkins.docker.client.DockerMultiplexedInputStream.read(DockerMultiplexedInputStream.java:32)
Caused: java.io.IOException
at hudson.remoting.FastPipedInputStream.read(FastPipedInputStream.java:169)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at hudson.remoting.FlightRecorderInputStream.read(FlightRecorderInputStream.java:99)
at hudson.remoting.ChunkedInputStream.read(ChunkedInputStream.java:46)
at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:97)
at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)

clouds.txt

logs.zip
This set of log files covers the docker inspect for the slave I'm building on, the docker logs (effectively empty), the Jenkins log, showing the underlying problem, and a trunated version of the Build console for the failed build.

If I can provide any information you think I've missed, please just respond and I'll try to provide it.

Many thanks.

Pete.

@ndeloof
Copy link
Contributor

ndeloof commented Feb 26, 2018

Broken communication with docker daemon (http hijacked connexion)
Can you please give more details on your docker setup ? Are you using a local docker daemon or remote host ? Any proxy involved ?

@BlueMesaDev
Copy link
Author

Hi.

Our Jenkins box is on one part of our corporate network (in Chicago), and the build node is local to our building (UK).

The build node is behind a firewall (red zone) that stops outgoing connections from being made, but allows all incoming connections.

The hijacked connection is interesting thought. I'd never have been able to figure that out from the stack trace.

I'm not familiar with the internal connections between our red zone and the green zone. I could imagine that the connection may be hijacked.

I'll look at spinning up a Jenkins docker on the docker host tomorrow. Sadly, the Jenkins box we already have on this network is v1.6, so way too old for docker!

For now, I've spun up 4 slaves with a modified config to allow them to behave as a normal Jenkins slave, and they seem to work as expected.

I'll update the ticket tomorrow, as soon as I have any findings.

Thanks for the assistance.

Pete

@ndeloof
Copy link
Contributor

ndeloof commented Feb 26, 2018

IIUC you can't use a jnlp connection as your build node can't connect back to master.
'attached' connector is experimental, I guess it's not well supported for such a transcontinental network with (probably) various http proxies which won't allow a long lived http connection.
Last option is for you to use ssh (which requires adequate docker image being setup)

@BlueMesaDev
Copy link
Author

Sadly, I can't use the SSH connection in the standard form as it uses an SSH private key. There's a bug in one of the plugins which means the SSH key used initially is then used on any other SSH connection, including the one to gitlab.

I'll also try using the modified docker image which has username/password based login to see if that improves the reliability.

Thanks again for the assistance.

Pete

@ndeloof
Copy link
Contributor

ndeloof commented Feb 27, 2018

There's a bug in one of the plugins which means the SSH key used initially is then used on any other SSH connection, including the one to gitlab.

any reference ?
docker-plugin can configure sshd to use an ssh key injected at runtime, based on master's identity key

@BlueMesaDev
Copy link
Author

Hi.

The ones I found are a Stack Overflow and a Jenkins bug.

https://stackoverflow.com/questions/16721629/jenkins-returned-status-code-128-with-github
https://issues.jenkins-ci.org/browse/JENKINS-40217

All I know is that if I connect via SSH Key injection, I can't then connect to our Gitlab server, as it rejects our SSH key. If I switch back to

I'm rebuilding our base image to allow connection via SSH using username & password, and I'll see if that helps the connection hijacking.

In parallel, I'm setting up a docker based Jenkins instance on the same box to see if that makes any difference (just in case the SSH connection doesn't fix it).

Thanks.

Pete.

@pjdarton
Copy link
Member

Have you tried using SSH key injection with the public Jenkins slave docker image?
That should work, and you can then use that as a basis for further investigations.

Also, when using SSH, make sure you set the key verification strategy to non-verifying or it'll reject most things.

@BlueMesaDev
Copy link
Author

Hi.

I've already done this. On a simple test (freestyle) project, it works correctly.

When I extend this to one of my maven projects, it connects, but fails to pull the code from the repository.

It appears that when I log in via SSH, even though the GitLab integration has a username and password, this username and password is completely ignored, e.g. if we log in via an SSH key injection as "root", and the GitLab pull is configured to use hudson/password, the root/no password is passed into gitlab, and it fails.

I think at this stage I've used up enough of your time. I think my connection problems are probably because I'm using the experimental docker connection. If I can figure out how to configure Jenkins to honour the username and password specified in the configuration when pulling, rather than the one used to log in, I'll see where I get.

Please feel free to close the issue.

Thanks for your help.

Pete.

@BlueMesaDev
Copy link
Author

Hopefully the last update.

I've built 4 static docker based slaves.

  • These build correctly (i.e. the Git Plugin pulls the code correctly) when the SSH client logs in as "jenkins".
  • These do not build correctly (the Git plugin returns a status code 128) when the SSH client logs in as "root"

If I build a dynamic docker slave (using the docker plugin), none of the jobs work. They all fail with the Git plugin returning a status code 128.

This sort of behaviour is mentioned in the "Gotchas" section of https://plugins.jenkins.io/git-client.

I can't explain why the Jenkins user (elevated to root status) would pass, when the root user would fail.

I also can't explain why the Jenkins user would pass when using a static docker container, when it fails when using a dynamic container, based on exactly the same image.

At this stage, I don't know if it's a problem with the Git plugin, or something else.

As I said before, please feel free to close the issue, and thanks for your help.

Pete.

@ndeloof ndeloof closed this as completed Feb 27, 2018
@ReyChavez
Copy link

I ran across this post while trouble-shooting the same issue, my Jenkins Docker builds would die with the following lines always appearing in the build log: "Expected n bytes application/vnd.docker.raw-stream header...". Figured the following might be helpful...

I'm not sure if this was the ultimate cause, but I was building on a laptop with a wifi connection that was super-flaky. Once I realized this might be the cause I switched over to an ethernet connection, turned off the wifi on the laptop, then reconfigured the Jenkins docker cloud to use the ethernet if address and the issue stopped happening. Again, this could be just a coincidence, but since I saw very few posts regarding the "Expected n bytes" error, I thought this might be helpful to anyone else who comes across this. Cheers.

@pjdarton
Copy link
Member

pjdarton commented Jun 5, 2018

@ReyChavez Flaky network connections are a pain in most environments, but in Jenkins then a momentary drop in network connectivity that results in TCP connections closing will be fatal to just about all operations - not just docker.
Windows is especially prone to this due to the "different" way it handles transient network outages - it force-closes all network connections, causing brief outages to manifest as fatal application errors. All other operating systems I've encountered treat transient issues as transient issues and allow normal TCP retries etc to do their job, but not Microsoft Windows.

So, if you're running anything on Windows, make sure that the operating system only ever sees a perfect network environment because Windows makes any minor outage into a fatal error which Jenkins will report as a build error etc.

@a-ba
Copy link
Contributor

a-ba commented Oct 23, 2018

Hi,
this issue is caused by an incomplete read in the DockerMultiplexedInputStream,
I pushed a PR (#693) that fixes it

@pjdarton pjdarton reopened this Oct 23, 2018
@jakub-bochenski
Copy link

This started happening to me out of the blue.
Is this specific to using the "attach" slave mode or does it affect all connection modes?

Are there any know workaround other than getting a better network connection?

BTW my network connection seems to be pretty OK:

226 packets transmitted, 225 received, 0% packet loss, time 225320ms
rtt min/avg/max/mdev = 47.276/47.590/52.087/0.518 ms

@pjdarton
Copy link
Member

This issue is specific to the "attach" method.
There may be other issues that are specific to SSH and/or JNLP connection modes (and I've lost count of the number of days I've lost to debugging such issues myself, both for docker and other kinds of nodes), but this one is purely about the docker "attach" method.

If you're suffering from this, you could try downloading the .hpi file that the jenkinsci build server auto-builds from #693 and see if that fixes it for you (that build is just the latest code + the bugfix).

@jakub-bochenski
Copy link

jakub-bochenski commented Oct 25, 2018

@pjdarton thanks for the clarification, I will definitely try out the PR build (too bad there is no way to automate it for jenkinsci/docker actually you can download it via incrementals repo).

I'm wondering if this failure is related. Most of the time I get the Expected 8 bytes application/vnd.docker.raw-stream header, got X but once I got this:

16:58:21 ERROR: Issue with creating launcher for agent docker-000nuu2ie6szi. The agent is being disconnected
16:58:21 Building remotely on docker-000nuu2ie6szi on cloud (docker) (java) in workspace /home/jenkins/workspace/foo
16:58:21 [WS-CLEANUP] Deleting project workspace...
16:58:27 ERROR: [WS-CLEANUP] Cannot delete workspace: Channel "unknown": Remote call on docker-000nuu2ie6szi failed. The channel is closing down or has closed down
16:58:27 ERROR: Cannot delete workspace: Channel "unknown": Remote call on docker-000nuu2ie6szi failed. The channel is closing down or has closed down

@eoinverling
Copy link

Hi, thanks for the tip ... I was getting this error, plugin 1.1.5, "attach" method, running jenkins in rancher (ie docker in docker) Expected 8 bytes application/vnd.docker.raw-stream header, got X, got the latest .hpi file and installed it ... error is now gone

thanks alot!!

pjdarton pushed a commit that referenced this issue Nov 23, 2018
* Fixes bug #628.
* e.g. "java.io.IOException: Expected 8 bytes application/vnd.docker.raw-stream header".
* Improve debug logging.
* Add unit tests for DockerMultiplexedInputStream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants