GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.58k stars 1.43k forks source link

maven jib unable to pull base image : The named manifest is not known to the registry. 404 #4153

Closed prashant82singh closed 9 months ago

prashant82singh commented 9 months ago

Hi I am trying to build image using maven-jib plugin and connecting to artifactory as docker-repo. But i am unable to pull the base-image as i get error " The named manifest is not known to the registry. 404" Below is full error [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.4.0:buildTar (default-cli) on project common: Tried to pull image manifest for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:latest but failed because: The named manifest is not known to the registry. 404 [ERROR] GET https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest [ERROR] {"errors":[{"code":"MANIFEST_UNKNOWN","message":"The named manifest is not known to the registry.","detail":{"manifest":"artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime"}}]}

below is the pom.xml snippet : pom_snippet

Below is the network logs: CONFIG: -------------- REQUEST -------------- GET https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.oci.image.index.v1+json Accept-Encoding: gzip User-Agent: jib 3.4.0 jib-maven-plugin Google-HTTP-Java-Client/1.42.2 (gzip)

Dec 10, 2023 8:49:20 AM com.google.api.client.http.HttpRequest execute CONFIG: curl -v --compressed -H 'Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.oci.image.index.v1+json' -H 'Accept-Encoding: gzip' -H 'User-Agent: jib 3.4.0 jib-maven-plugin Google-HTTP-Java-Client/1.42.2 (gzip)' -- 'https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest' Dec 10, 2023 8:49:21 AM com.google.api.client.http.HttpResponse CONFIG: -------------- RESPONSE -------------- HTTP/1.1 401 Date: Sun, 10 Dec 2023 03:19:21 GMT Content-Type: application/json;charset=ISO-8859-1 Content-Length: 87 Connection: keep-alive Docker-Distribution-Api-Version: registry/2.0 WWW-Authenticate: Bearer realm="https://myorg-docker-repo.artifactory.platform.myorginfra.net:443/artifactory/api/docker/myorg-docker-repo/v2/token",service="myorg-docker-repo.artifactory.platform.myorginfra.net:443",scope="repository:artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:pull"

Dec 10, 2023 8:49:21 AM com.google.api.client.util.LoggingByteArrayOutputStream close CONFIG: Total: 87 bytes Dec 10, 2023 8:49:21 AM com.google.api.client.util.LoggingByteArrayOutputStream close CONFIG: {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]}

[INFO] The base image requires auth. Trying again for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime... [INFO] Using credentials from Maven settings file for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime [DEBUG] WWW-Authenticate for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime: Bearer realm="https://myorg-docker-repo.artifactory.platform.myorginfra.net:443/artifactory/api/docker/myorg-docker-repo/v2/token",service="myorg-docker-repo.artifactory.platform.myorginfra.net:443",scope="repository:artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:pull" Dec 10, 2023 8:49:21 AM com.google.api.client.http.HttpRequest execute CONFIG: -------------- REQUEST -------------- GET https://myorg-docker-repo.artifactory.platform.myorginfra.net:443/artifactory/api/docker/myorg-docker-repo/v2/token?service=myorg-docker-repo.artifactory.platform.myorginfra.net:443&scope=repository:artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:pull Accept: / Accept-Encoding: gzip Authorization: User-Agent: jib 3.4.0 jib-maven-plugin Google-HTTP-Java-Client/1.42.2 (gzip)

Dec 10, 2023 8:49:21 AM com.google.api.client.http.HttpRequest execute CONFIG: curl -v --compressed -H 'Accept: /' -H 'Accept-Encoding: gzip' -H 'Authorization: ' -H 'User-Agent: jib 3.4.0 jib-maven-plugin Google-HTTP-Java-Client/1.42.2 (gzip)' -- 'https://myorg-docker-repo.artifactory.platform.myorginfra.net:443/artifactory/api/docker/myorg-docker-repo/v2/token?service=myorg-docker-repo.artifactory.platform.myorginfra.net:443&scope=repository:artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:pull' Dec 10, 2023 8:49:22 AM com.google.api.client.http.HttpResponse CONFIG: -------------- RESPONSE -------------- HTTP/1.1 200 Date: Sun, 10 Dec 2023 03:19:22 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive X-JFrog-Version: Artifactory/7.55.9 75509900 X-Artifactory-Id: 02e707c7f9a546da:-4a8a4701:1890f03f07e:-8000 X-Artifactory-Node-Id: shd-art-euw2-vm-tg6b

Dec 10, 2023 8:49:22 AM com.google.api.client.util.LoggingByteArrayOutputStream close CONFIG: Total: 848 bytes Dec 10, 2023 8:49:22 AM com.google.api.client.util.LoggingByteArrayOutputStream close CONFIG: {"token":"eyJ2ZXIiOiIyIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYiLCJraWQiOiJsTWZnQW.........","expires_in":9000} [DEBUG] bearer auth succeeded for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime Dec 10, 2023 8:49:22 AM com.google.api.client.http.HttpRequest execute CONFIG: -------------- REQUEST -------------- GET https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.oci.image.index.v1+json Accept-Encoding: gzip Authorization: User-Agent: jib 3.4.0 jib-maven-plugin Google-HTTP-Java-Client/1.42.2 (gzip)

Dec 10, 2023 8:49:22 AM com.google.api.client.http.HttpRequest execute CONFIG: curl -v --compressed -H 'Accept: application/vnd.oci.image.manifest.v1+json,application/vnd.docker.distribution.manifest.v2+json,application/vnd.docker.distribution.manifest.v1+json,application/vnd.docker.distribution.manifest.list.v2+json,application/vnd.oci.image.index.v1+json' -H 'Accept-Encoding: gzip' -H 'Authorization: ' -H 'User-Agent: jib 3.4.0 jib-maven-plugin Google-HTTP-Java-Client/1.42.2 (gzip)' -- 'https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest' Dec 10, 2023 8:49:24 AM com.google.api.client.http.HttpResponse CONFIG: -------------- RESPONSE -------------- HTTP/1.1 404 Date: Sun, 10 Dec 2023 03:19:24 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive X-JFrog-Version: Artifactory/7.55.9 75509900 X-Artifactory-Id: 02e707c7f9a546da:-4a8a4701:1890f03f07e:-8000 X-Artifactory-Node-Id: shd-art-euw2-vm-tg6b Docker-Distribution-Api-Version: registry/2.0

Dec 10, 2023 8:49:24 AM com.google.api.client.util.LoggingByteArrayOutputStream close CONFIG: Total: 185 bytes Dec 10, 2023 8:49:24 AM com.google.api.client.util.LoggingByteArrayOutputStream close CONFIG: {"errors":[{"code":"MANIFEST_UNKNOWN","message":"The named manifest is not known to the registry.","detail":{"manifest":"artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime"}}]} [DEBUG] TIMED Pulling base image manifest : 3749.0 ms [DEBUG] TIMING Preparing application layer builders [DEBUG] TIMED Preparing application layer builders : 1.0 ms [INFO] Building dependencies layer... [DEBUG] TIMING Building dependencies layer [DEBUG] TIMED Building dependencies layer : 34.0 ms [INFO] Building resources layer... [DEBUG] TIMING Building resources layer [DEBUG] TIMED Building resources layer : 4.0 ms [INFO] Building classes layer... [DEBUG] TIMING Building classes layer [DEBUG] TIMED Building classes layer : 34.0 ms [INFO] Building jvm arg files layer... [DEBUG] TIMING Building jvm arg files layer [DEBUG] TIMED Building jvm arg files layer : 1.0 ms [DEBUG] TIMED Building image tarball : 3901.0 ms [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.534 s [INFO] Finished at: 2023-12-10T08:49:24+05:30 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.4.0:buildTar (default-cli) on project common: Tried to pull image manifest for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:latest but failed because: The named manifest is not known to the registry. 404 [ERROR] GET https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest [ERROR] {"errors":[{"code":"MANIFEST_UNKNOWN","message":"The named manifest is not known to the registry.","detail":{"manifest":"artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime"}}]} [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.cloud.tools:jib-maven-plugin:3.4.0:buildTar (default-cli) on project common: Tried to pull image manifest for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:latest but failed because: The named manifest is not known to the registry.

Ques : as i see in the network logs its hitting URL : GET https://myorg-docker-repo.artifactory.platform.myorginfra.net/v2/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime/manifests/latest , but i dont have this path with "../v2/.../manifests/..." in my repo. From where is this path getting created ?

repo

prashant82singh commented 9 months ago

event tried with docker pull command, but not able to find manifest:

$ docker pull myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime Using default tag: latest Error response from daemon: manifest for myorg-docker-repo.artifactory.platform.myorginfra.net/artifactory/myorg-base-docker-snapshots/ubi8/openjdk8-runtime:latest not found: manifest unknown: The named manifest is not known to the registry.

prashant82singh commented 9 months ago

Corrected by referring actusl uri from properties of uploaded image on jfrog artifactory

prashant82singh commented 9 months ago

Closed