Google Jib throws UnknownManifestFormatException: Unknown mediaType: application/vnd.oci.image.index.v1+json when building the application
Asked Answered
D

4

5

Docker: 27.1.2 Java: 17.0.11 Maven: 3.8.6 Jib: 3.2.1 OS: Ubuntu 22.04.4

I am using a Jhipster Spring application. Until now, my application has been built and running without any problems. But suddenly today without anything changed, when I tried to build my application I got this error:

./mvnw -ntp verify -DskipTests -Pprod jib:dockerBuild

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project remember: Unknown mediaType: application/vnd.oci.image.index.v1+json -> [Help 1]

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project remember: Unknown mediaType: application/vnd.oci.image.index.v1+json -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.2.1:dockerBuild (default-cli) on project remember: Unknown mediaType: application/vnd.oci.image.index.v1+json at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:375) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:53) at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:152) at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:76) Caused by: org.apache.maven.plugin.MojoExecutionException: Unknown mediaType: application/vnd.oci.image.index.v1+json at com.google.cloud.tools.jib.maven.BuildDockerMojo.execute (BuildDockerMojo.java:167) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:568) at org.apache.maven.wrapper.BootstrapMainStarter.start (BootstrapMainStarter.java:53) at org.apache.maven.wrapper.WrapperExecutor.execute (WrapperExecutor.java:152) at org.apache.maven.wrapper.MavenWrapperMain.main (MavenWrapperMain.java:76) Caused by: com.google.cloud.tools.jib.image.json.UnknownManifestFormatException: Unknown mediaType: application/vnd.oci.image.index.v1+json at com.google.cloud.tools.jib.registry.AbstractManifestPuller.getManifestTemplateFromJson (AbstractManifestPuller.java:177) at com.google.cloud.tools.jib.registry.AbstractManifestPuller.handleResponse (AbstractManifestPuller.java:98) at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call (RegistryEndpointCaller.java:140) at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call (RegistryEndpointCaller.java:114) at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint (RegistryClient.java:623) at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest (RegistryClient.java:434) at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest (RegistryClient.java:439) at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.pullBaseImages (PullBaseImageStep.java:292) at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call (PullBaseImageStep.java:179) at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call (PullBaseImageStep.java:69) at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:131) at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:74) at com.google.common.util.concurrent.TrustedListenableFutureTask.run (TrustedListenableFutureTask.java:82) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635) at java.lang.Thread.run (Thread.java:842)

I tried remove everything unnecessary from docker with docker system prune

And removing the target directory and rebuilding the application with maven.

But nothing works for me

Doggone answered 19/10 at 6:27 Comment(0)
L
5

Update jib plugin version to latest i.e 3.4.3 (latest) Working for me.

Luxemburg answered 19/10 at 10:48 Comment(0)
R
3

I you're using JDK 17 then the maximum version you can use of the plugin is 3.3.1:

plugins {
...
    id "com.google.cloud.tools.jib" version "3.3.1"
...
} 
Recommend answered 21/10 at 14:22 Comment(2)
Could you please explain why 3.3.1 is the latest version of jib you can use for JDK 17? Is this mentioned somewhere in JIB documentation/release notes?Closeknit
I can only confirm, that it actually works. My project sits on Java 17 and the latest jib plugin for gradle didn't work with it.Oxen
D
1

Our project using the same version of jib started failing with the same error two days ago. We just had the base image eclipse-temurin:17-jdk and it seems like that Docker tag was updated around the same time the build started failing.

Setting the base image to the specific tag of the previous version (eclipse-temurin:17.0.11_9-jdk) solved the error for us without upgrading jib.

Downcomer answered 21/10 at 17:18 Comment(0)
H
0

For me upgrading to 3.4.2 worked well (3.4.3) did not work.

Hankypanky answered 21/10 at 13:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.