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

Update error message to accommodate OCI: "Registry may not support Image Manifest Version 2, Schema 2" #1646

Closed
awsbamboo115 opened this issue Apr 19, 2019 · 12 comments · Fixed by #1707

Comments

@awsbamboo115
Copy link

awsbamboo115 commented Apr 19, 2019

Registry may not support Image Manifest Version 2, Schema 2 
at com.google.cloud.tools.jib.registry.RegistryErrorExceptionBuilder.build(RegistryErrorExceptionBuilder.java:108)
	at com.google.cloud.tools.jib.registry.ManifestPusher.handleHttpResponseException(ManifestPusher.java:119)
	at com.google.cloud.tools.jib.registry.ManifestPusher.handleHttpResponseException(ManifestPusher.java:39)
	at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:258)
	at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.fallBackToHttp(RegistryEndpointCaller.java:210)
	at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.callWithAllowInsecureRegistryHandling(RegistryEndpointCaller.java:180)
	at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:161)
	at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint(RegistryClient.java:356)
	at com.google.cloud.tools.jib.registry.RegistryClient.pushManifest(RegistryClient.java:225)
	at com.google.cloud.tools.jib.builder.steps.PushImageStep.lambda$afterAllPushed$0(PushImageStep.java:162)
	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.google.api.client.http.HttpResponseException: 400 Bad Request
{"errors":[{"code":"MANIFEST_INVALID","message":"manifest invalid","detail":{}}]}

	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1102)
	at com.google.cloud.tools.jib.http.Connection.send(Connection.java:200)
	at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call(RegistryEndpointCaller.java:251)
	... 12 more
@loosebazooka
Copy link
Member

What registry are you trying to build to?

@chanseokoh
Copy link
Member

Probably a duplicate of #601?

@awsbamboo115
Copy link
Author

maven jib-maven-plugin version 1.1.1 format OCI

@chanseokoh
Copy link
Member

Registry may not support Image Manifest Version 2, Schema 2

format OCI

Perhaps you are a bit confused between the OCI manifest and the Docker Manifest V2.2.

The OCI manifest is of media type application/vnd.oci.image.manifest.v1+json, while the Docker Image Manifest Version 2, Schema 2 is of type application/vnd.docker.distribution.manifest.v2+json.

So, it could be simply that the registry does not support OCI.

What registry are you trying to build to? (For example, Docker Hub, Quay, private Harbor, etc.)

@awsbamboo115
Copy link
Author

private Harbor registry v1.7.4
Harbor registry does not support OCI.

format Docker BUILD SUCCESS

@awsbamboo115
Copy link
Author

I can push to Harbor registry v1.7.4 by manual (format OCI) and running docker image
but can't push by maven jib-maven-plugin version 1.1.1 format OCI

@chanseokoh
Copy link
Member

Harbor registry does not support OCI.

If Harbor does not support OCI, you probably shouldn't have <format>OCI</format> in the Jib configuration.

I can push to Harbor registry v1.7.4 by manual (format OCI) and running docker image

Whatever manual methods or tools you use, my guess is that the initial OCI manifest is converted to Docker manifest at some point before the image is pushed to Harbor. I guess Harbor will just return INVALID_MANIFEST if gets an OCI manifest.

So, if you want to make Jib push to Harbor that doesn't support OCI, I think you should remove <format>OCI. We don't intend to automatically creating a Docker manifest when <format>OCI is specified and the registry doesn't accept it.

@hendrikhalkow
Copy link

I had the same with Quay.io. It supports Docker, but not OCI format. When I have format = 'OCI' in build.gradle and try to build using gradle jib, I get the misleading message Registry may not support Image Manifest Version 2, Schema 2. With format = 'Docker' everything works fine after you are whitelisted by Quay for V2.2 support.

Can we make the error message more useful like Registry may not support Image Manifest Version 2, Schema 2 or container image format ${format}?

@chanseokoh
Copy link
Member

Ah, "Registry may not support Image Manifest Version 2, Schema 2" was a message coming from Jib. Yeah, the error message is misleading when format = 'OCI'. We need to improve the message.

@chanseokoh chanseokoh changed the title Registry may not support Image Manifest Version 2, Schema 2 Update error message to accommodate OCI: "Registry may not support Image Manifest Version 2, Schema 2" May 6, 2019
@chanseokoh
Copy link
Member

Reopening, to track updating the misleading error message in the case of OCI push.

@Schachte
Copy link

I get this regardless of specifying the format.

support pushing OCI Manifest or Docker Image Manifest Version 2

I'm using gradle.

....
       tags = [inputTag, 'latest']
    }
    container {
        creationTime = 'USE_CURRENT_TIMESTAMP'
        format = 'Docker'
    }

@chanseokoh
Copy link
Member

@Schachte probably the root cause is irrelevant of the format but that your registry refuses to accept a valid manifest for some reason. There can be multiple different reasons, but here's one: #3215

What's the response you get from your registry? Providing --stacktrace will give you more details. (--debug also works, but it may output too much detail.)

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.

5 participants