jib: 'MANIFEST_INVALID' when uploading to Artifactory
Description of the issue: When running jib as part of a maven goal, I get the following:
[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.2:build (build-docker-image) on project jengel-service: Build image failed: Tried to push image manifest for $OUR_REGISTRY/sre/jengel-test:jib but failed because: manifest invalid (something went wrong) | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new: 400 Bad Request
[ERROR] {"errors":[{"code":"MANIFEST_INVALID","message":"manifest invalid","detail":{"description":"null"}}]}
When looking at the artifactory logs, it seems like the manifest being uploaded is null:
2018-07-10 19:55:25,650 [http-nio-8081-exec-55] [INFO ] (o.a.e.UploadServiceImpl:360) - Deploy to 'et-docker-local:sre/jengel-test/_uploads/49928209-6f48-451f-8bd3-57a329be6880' Content-Length: unspecified
2018-07-10 19:55:25,748 [http-nio-8081-exec-66] [INFO ] (o.j.r.d.v.r.h.DockerV2LocalRepoHandler:257) - Deploying docker manifest for repo 'sre/jengel-test' and tag 'jib' into repo 'et-docker-local'
2018-07-10 19:55:25,761 [http-nio-8081-exec-66] [ERROR] (o.j.r.d.v.r.h.DockerV2LocalRepoHandler:298) - Error uploading manifest: 'null'
Expected behavior: The image should be uploaded to artifactory 😄
Steps to reproduce:
- Add an artifactory repo as your
<to><image>block - Execute
mvnto publish image - Receive error ):
Environment:
- Current trying on macOS 10.13.5
- mvn 3.5.3
- jib 0.9.2
- Artifactory 6.0.1
jib-maven-plugin Configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>0.9.2</version>
<configuration>
<from>
<image>$OUR_REGISTRY/frolvlad/alpine-oraclejdk8:slim</image>
</from>
<to>
<image> $OUR_REGISTRY/sre/jengel-test:jib</image>
</to>
<container>
<jvmFlags>
...
</jvmFlags>
<format>OCI</format>
</container>
</configuration>
<executions>
<execution>
<id>build-docker-image</id>
<goals>
<goal>build</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
Log output: See description above for relevant logs
Additional Information:
Tried running as well with the -X flag in maven with nothing else extreme helpful. I do actually see part of the image layers in an _uploads folder in artifactory, but no manifest.json like I’d expect from an image. Happy to provide additional information if needed!
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 39 (16 by maintainers)
Confirmed: Adding as many history elements as there’s layers make container push to Artifactory. Red Hat Container Registry still throws error with this quick try, so it might still require something else.
But Artifactory works when there’s equal number of (non-empty-layer) history elements than layers.
For test I only added static ones to
jib-core/src/main/java/com/google/cloud/tools/jib/image/json/ContainerConfigurationTemplate.java:Tested with Artifactory 6.0.2, works well. Big Thanks!
Version
0.9.10has been released!@jainishshah17 @jbaruch
I used a method decompiler and walked through Artifactory’s
ManifestSchema2Deserializerclass while attempting to push up an image from Jib. The problem occurs inManifestSchema2Deserializer#applyAttributesFromContent().Basically this code walks through the layers and creates blob infos for each layer. Although it attempts to support containers with no history (which is allowed by the spec, and which Jib does not produce), it does not increment
layerIndexwhen there is no history. The code looks something like:It seems to me that either the conditional marked with
!!!should be expanded to includehistoryLayer == null?For the Artifactory issue: from the Artifactory server log in the above Artifactory service ticket (https://www.jfrog.com/jira/browse/RTFACT-17134) created by @mzagar, I am suspecting it’s the Artifactory JSON manifest parser that is breaking. Also from the log, Artifactory does seem like it’s capable of handling manifest schema 2.
Made some tcpdumping to see what’s different. Results below (haven’t yet figured out what is the thing causing the issue). Also not sure if (without clearing up those messages) the put should work twice or long after the other things are uploaded. But at least some differences can be seen from those.
Hi all, fyi I created a ticket for jfrog Artifactory trying to get more info as to what is causing this issue: https://www.jfrog.com/jira/browse/RTFACT-17134