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.

Fails to pull image from registry - registry.redhat.io

See original GitHub issue

Issue

We cannot pull an image from the registry.redhat.io as jib is returning an error 403 even if we pass the parameters -Djib.from.auth.username and -Djib.from.auth.password

Error

Caused by: org.apache.maven.plugin.MojoExecutionException: Build image failed, perhaps you should make sure you have permissions for registry.redhat.io/redhat-openjdk-18/openjdk18-openshift and set correct credentials. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-forbidden-or-denied for help
    at com.google.cloud.tools.jib.maven.BuildImageMojo.execute (BuildImageMojo.java:162)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    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:305)
    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:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: com.google.cloud.tools.jib.api.RegistryUnauthorizedException: Unauthorized for registry.redhat.io/redhat-openjdk-18/openjdk18-openshift
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call (RegistryEndpointCaller.java:279)
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.callWithAllowInsecureRegistryHandling (RegistryEndpointCaller.java:175)
    at com.google.cloud.tools.jib.registry.RegistryEndpointCaller.call (RegistryEndpointCaller.java:152)
    at com.google.cloud.tools.jib.registry.RegistryClient.callRegistryEndpoint (RegistryClient.java:470)
    at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest (RegistryClient.java:299)
    at com.google.cloud.tools.jib.registry.RegistryClient.pullManifest (RegistryClient.java:304)
    at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.pullBaseImage (PullBaseImageStep.java:212)
    at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call (PullBaseImageStep.java:169)
    at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call (PullBaseImageStep.java:60)
    at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly (TrustedListenableFutureTask.java:125)
    at com.google.common.util.concurrent.InterruptibleTask.run (InterruptibleTask.java:69)
    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: 403 Forbidden
<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>
An error occurred while processing your request.<p>
Reference&#32;&#35;199&#46;c5f7ef50&#46;1572258213&#46;23b79840
</BODY></HTML>

Steps to reproduce

mvn compile com.google.cloud.tools:jib-maven-plugin:build -Djib.from.image=registry.redhat.io/redhat-openjdk-18/openjdk18-openshift -Dimage=dabou/spring-boot-jib -Djib.from.auth.username=xxxxx -Djib.from.auth.password=yyyyy

Docker login

The command docker login -u xxxxx -p yyyyy registry.redhat.io works without issues as I can pull the image

docker login registry.redhat.io -u xxxxx -p yyyyy
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
docker pull registry.redhat.io/redhat-openjdk-18/openjdk18-openshift
Using default tag: latest
latest: Pulling from redhat-openjdk-18/openjdk18-openshift
Digest: sha256:873f79531ffa5b0783c0ffe6cdbdb05f1bcc0485d27b1aace16a9b062fc5bd77
Status: Image is up to date for registry.redhat.io/redhat-openjdk-18/openjdk18-openshift:latest
registry.redhat.io/redhat-openjdk-18/openjdk18-openshift:latest

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:23 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
cmoulliardcommented, Oct 28, 2019

Many thanks for your help and quick reply/return 😃

1reaction
cmoulliardcommented, Jan 29, 2020

I did a test and that works

[INFO] Containerizing application to quay.io/cmoulliard/hello-sb...
[WARNING] Base image 'registry.redhat.io/redhat-openjdk-18/openjdk18-openshift' does not use a specific image digest - build may not be reproducible
[INFO] Using credentials from Docker config (/Users/dabou/.docker/config.json) for quay.io/cmoulliard/hello-sb
[INFO] The base image requires auth. Trying again for registry.redhat.io/redhat-openjdk-18/openjdk18-openshift...
[INFO] Using credentials from <from><auth> for registry.redhat.io/redhat-openjdk-18/openjdk18-openshift
[INFO] Using base image with digest: sha256:9dab23924157b0c588f738c97b2a1f434315175b0be4156e1877028fa44360a8
[INFO] Executing tasks:
[INFO] [================              ] 53,6% complete
[INFO] > launching layer pushers
[INFO] > pulling base image layer sha256:00f17e0b37b05...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to import and pull images through registry.redhat.io
Building image from Dockerfile where the base image is specified to pull from registry.redhat.io is not able to authenticate using ...
Read more >
RHOCP Failed to pull image from "registry.redhat.io"
Issue. Getting image pullback error for pod(s) when downloading image(s) from registry.redhat.io. Environment. Red Hat OpenShift Container Platform (RHOCP).
Read more >
Red Hat Customer Portal
Failed to pull image "registry.redhat.io/redhat/redhat-operator-index" on OpenShift Container Platform 4. No translations currently exist.
Read more >
Failed to pull image with i/o timeout - Red Hat Customer Portal
... After retrying 2 times, Pull image still failed due to error: while pulling "docker://registry.access.redhat.com/ubi8/ubi-minimal:8.1" ...
Read more >
Unable to pull images from internal image registry using ...
Issue. Unable to pull image using an alternative service name: Raw. Error: 17m Warning Failed pod/maven-zqqnh Failed to pull image ...
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