Premature end of chunk coded message body after upgrading to 3.1.3
See original GitHub issueEnvironment:
- Jib version: 3.1.3
- Build tool: Gradle 7.1 (using jib plugin 3.1.3)
- OS: Linux via Gitlab pipelines
Description of the issue: Upgraded from 3.1.2 to 3.1.3 and now getting an error when pulling an image from GCR
I/O error for image [eu.gcr.io/***]:
org.apache.http.ConnectionClosedException
Premature end of chunk coded message body: closing chunk expected
I/O error for image [eu.gcr.io/***]:
org.apache.http.ConnectionClosedException
Premature end of chunk coded message body: closing chunk expected
This causes it to completely fail
Expected behavior:
It would still work the same from 3.1.2
Steps to reproduce:
- Upgrade to 3.1.3 and it breaks
jib-gradle-plugin
Configuration:
jib {
from {
image = "eu.gcr.io/***"
}
to {
image = System.getenv("CONTAINER_IMAGE") ?: "***"
tags = ["latest", System.getenv("CI_PIPELINE_ID") ?: "dev", System.getenv("CI_COMMIT_SHA") ?: "local"]
}
container {
mainClass = "com.***.Application"
args = ["server", System.getenv("DROPWIZARD_CONFIG") ?: "development"]
jvmFlags = [
"-XX:+UseG1GC",
"-XX:+UseStringDeduplication",
"-Dcontrast.dir=/tmp/contrast",
"-javaagent:contrast.jar",
"-Dcontrast.assess.sampling.enable=true",
"-Dcontrast.assess.sampling.baseline=1",
"-Dcontrast.assess.sampling.request_frequency=1200",
"-Dcontrast.assess.sampling.window_ms=30000",
]
ports = ["8080", "8081"]
}
}
Log output:
Containerizing application to eu.gcr.io/***, eu.gcr.io/***, eu.gcr.io/***, eu.gcr.io/***...
Base image 'eu.gcr.io/***' does not use a specific image digest - build may not be reproducible
Getting manifest for base image eu.gcr.io/***...
Building dependencies layer...
Building project dependencies layer...
Building classes layer...
Building jvm arg files layer...
Using Google Application Default Credentials for eu.gcr.io/***
The base image requires auth. Trying again for eu.gcr.io/***...
Using Google Application Default Credentials for eu.gcr.io/***
I/O error for image [eu.gcr.io/***]:
org.apache.http.ConnectionClosedException
Premature end of chunk coded message body: closing chunk expected
I/O error for image [eu.gcr.io/***]:
org.apache.http.ConnectionClosedException
Premature end of chunk coded message body: closing chunk expected
Using base image with digest: ***
Container entrypoint set to [java, -Xms4g, -Xmx8g, -XX:+UseG1GC, -cp, @/app/jib-classpath-file, ***]
I/O error for image [eu.gcr.io/***]:
org.apache.http.ConnectionClosedException
Premature end of chunk coded message body: closing chunk expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':maintenance:jib'.
> com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Premature end of chunk coded message body: closing chunk expected
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:40 (20 by maintainers)
Top Results From Across the Web
Premature end of chunk coded message body: closing chunk ...
This won't work! The Fix is obvious. Arrange the code so that the response isn't used after closing it: CloseableHttpClient httpclient = HttpClients....
Read more >Getting errror : Premature end of chunk coded message body
Since your request has no body (that's okay if you're not uploading something on the POST) then the chunked exception is coming from...
Read more >Premature end of chunk coded message body getChunkSize ...
The back-end server is not sending the expected zero-length closing chunk resulting in this error. Resolution. CA Access Gateway (SPS) will ...
Read more >Script failed with error: Premature end of chunk coded ...
It can be a networking issue than. Say, content length header's value is different from the actual length. This can be checked with...
Read more >JRebel Changelog | JRebel & XRebel by Perforce
jar setting did not apply to the application servers. Bug fix: fixed an integration issue with the VS Code extension that failed to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@rmaclean-ee @ChristianCiach @steven-sheehy @danilofnmoreira @abithgs @creekpld @yuri-sergiichuk @nhmarujo @ikorolev93 @olivierchedru @osigida
We just released Jib plugins 3.1.4 which downgraded Google HTTP libraries to 1.34.0. I expect the new release will avoid the issue, unless Gradle overrides the versions. If Gradle overrides them (which often happens unfortunately), one option is to force versions.
Incredible… I can reproduce the issue, but only with ancient Apache httpd versions (up to
2.4.18
, works starting with2.4.20
(there doesn’t seem to be a2.4.19
)) and only when using SSL (dummy certs work fine to reproduce the issue).It has nothing to do with the nginx or the registry. Even when just serving files, Google-HttpClient requesting https://localhost:8443 running an ancient Apache httpd will trigger the issue:
Of course, I had to hack your client from https://github.com/chanseokoh/docker-hub-upload-speed-test to ignore the invalid ssl cert:
I don’t know how to interpret this. The issue only appears with ancient HTTP servers with SSL enabled, but this doesn’t necessarily mean that the server is at fault.
You should be able to easily reproduce this example following these steps: