[gradle] (flaky?) Jackson-related error when building image
See original GitHub issueDescription of the issue: Got a random jackson exception when building with jib
.
Exception when building image. Retrying the same build worked.
404 not found
seems to be the root cause, which I’m assuming is flakiness when accessing gcr.io
. I want to just get the log out here, but there might not be anything to do here. It’s why I’m keeping this issue lightweight.
Step #3 - "curio-generated-build-all": Caused by: com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException: Build image failed
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.plugins.common.BuildStepsRunner.build(BuildStepsRunner.java:269)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.gradle.BuildImageTask.buildImage(BuildImageTask.java:119)
Step #3 - "curio-generated-build-all": at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Step #3 - "curio-generated-build-all": at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Step #3 - "curio-generated-build-all": at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Step #3 - "curio-generated-build-all": at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
Step #3 - "curio-generated-build-all": ... 50 more
Step #3 - "curio-generated-build-all": Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.google.cloud.tools.jib.registry.json.ErrorResponseTemplate` (although at least one Creator exists): no int/Int-argument constructor/factory method to deserialize from Number value (404)
Step #3 - "curio-generated-build-all": at [Source: (String)"404 page not found
Step #3 - "curio-generated-build-all": "; line: 1, column: 1]
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1343)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1032)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromInt(ValueInstantiator.java:262)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromInt(StdValueInstantiator.java:356)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromNumber(BeanDeserializerBase.java:1324)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:173)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4013)
Step #3 - "curio-generated-build-all": at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3004)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.json.JsonTemplateMapper.readJson(JsonTemplateMapper.java:101)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:248)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.callWithAllowInsecureRegistryHandling(RegistryEndpointCaller.java:152)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:142)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:339)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest(RegistryClient.java:200)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest(RegistryClient.java:208)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.pullBaseImage(PullBaseImageStep.java:197)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call(PullBaseImageStep.java:168)
Step #3 - "curio-generated-build-all": at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call(PullBaseImageStep.java:56)
Step #3 - "curio-generated-build-all": at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
Step #3 - "curio-generated-build-all": at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
Step #3 - "curio-generated-build-all": at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
Expected behavior:
Retries so the build doesn’t fail? Or possibly provides a clearer exception message
Steps to reproduce:
Running a jib build
Environment: Linux, Gradle 5.0-rc-4, Java 11
jib-gradle-plugin
Configuration:
A relatively standard configuration that pushes to Google Container Registry
Log output:
Additional Information:
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Introducing flaky test mitigation tools - The Gradle Blog
This post introduces a new Gradle plugin and build scans improvements aimed at mitigating your flaky tests.
Read more >Gradle build is failing [Could not resolve all dependencies for ...
The real error is this: Connection to http://repo1.maven.org refused. Gradle needs to download the dependencies listed in the error message to be able...
Read more >Improve Gradle & Maven Flaky Test Management ... - YouTube
Is the test flaky only on certain build hosts? ... Deal with Unexpected Build Failures 00:02:11 - Using Gradle Enterprise Failure Analytics ...
Read more >Gradle Enterprise Flaky Test Detection Guide
Gradle Enterprise provides Test Failure Analytics which gives you tools for ... flaky tests analysis becomes available in Build Scans and in the...
Read more >Java: How to run component tests with code coverage, using ...
provide quick feedback to errors or problems introduced by changes. ... With these additions to the build.gradle file, if you refresh your ...
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
Yeah, looks like
gcr.io
was not responding correctly once.On our side, it may be worth catching
JsonParseException
andJsonMappingException
and report that the registry is not behaving.Looking through the caller
https://github.com/GoogleContainerTools/jib/blob/211efee9d244fb4f79488d382bc28fbeec0fdc15/jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryEndpointCaller.java
It seems like it parses the JSON even for error status codes. This probably makes sense for well behaved registries but it seems too optimistic as a user error (wrong registry URL) or transient server error (I can only assume the flakiness I saw with gcr.io has something to do with the routing of the load balancer not hitting a backend) won’t have JSON and the error message is very cryptic when that happens.
Isn’t it good to add exception handling to the JSON parsing and provide a clearer error message?