question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'MANIFEST_INVALID' when uploading to Artifactory

See original GitHub issue

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 mvn to 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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:39 (16 by maintainers)

github_iconTop GitHub Comments

6reactions
Hi-Ficommented, Aug 24, 2018

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:

private final List history = new ArrayList();

  private static class History implements JsonTemplate {
        private String author = "Bazel";
        private String created = "1970-01-01T00:00:00:Z";
        private String created_by = "bazel_build ...";
  }

public void addLayerDiffId(DescriptorDigest diffId) {
    history.add(new History());
    rootfs.diff_ids.add(diffId);
  }
3reactions
zhzhmcommented, Aug 30, 2018

Tested with Artifactory 6.0.2, works well. Big Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker push fails : manifest invalid - Stack Overflow
Publishing my artifacts into artifactory failed with the same reason manifest invalid: manifest invalid due to the previous docker image ...
Read more >
Docker push fails due to missing "created" field in the config file
Issue: Docker images are unsuccessfully uploaded to Artifactory due to a manifest invalid: manifest invalid error. After enabling the Docker debug logger, ...
Read more >
[RTFACT-9957] docker push throws "manifest invalid - Atlassian
This error seems to happen when we run docker push for the second time for an artifact with the same SHA. This causes...
Read more >
2030532 – Update Service release image digest mismatch ...
Mirror openshift release images to a private jfrog artifactory registry 2. ... The manifest uploaded to Artifactory was v2, so Artifactory should be...
Read more >
JFrog Artifactory Docker Registry - Palo Alto Networks
date for all image and manifest files of all the images in the registry. Requirements: JFrog Artifactory version 7.21.3 and later.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found