-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
docker hub credentials 401 Unauthorized #1256
Comments
Hi @mhamdisemah , do the same credentials work if you used |
docker login work well with my credentials but jib give me this error it seems credentials problems, can you explain more |
Hello, I have similar problem when Jib is pushing the image.
I have configured the plugin like this:
|
@rschlick the exception shows that you are communicating with your registry over HTTP instead of HTTPS. Jib does not send credentials over HTTP, unless you set the system property |
Thanks for the info. It's working now :) |
@mhamdisemah is it possible that your password has some values that need to be encoded to be placed in XML? Jib will use your Docker credentials ( |
Hello all, I execute 'docker pull' and 'docker push' in command line without error. In my pom.xml
When I execute the command: [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.0.0:build (default-cli) on project myimage: Build image failed, perhaps you should make sure you have permissions for privateDockerRegistry:5000/myimage: Unauthorized for privateDockerRegistry:5000/myimage: 403 Forbidden Thanks very much. |
In my environment, I also need to go out pass through proxy server. I had tried with -Dhttps.proxyHost=... -Dhttps.proxyPort-... -Dhttp.proxyHost=... -Dhttp.proxyPort= |
I think your private registry at port 5000 is HTTP (not HTTPS). Did you set the system property And we don't recommend using an insecure or HTTP registry. |
Hello @chanseokoh No, I didn't set |
Hmm... that's interesting. If the registry has no password at all, it's puzzling that it's returning 403 Forbidden. |
It'd be worth trying the system property |
I try with
|
@yanhongwang are you sure your HTTP and HTTPS proxy is on the same port? That 403 error looks like it's being reported by your proxy rather than the registry. Can you check your proxy logs? |
And could you please try to obtain a network trace? |
Hello @briandealwis Yes, in my case, HTTP and HTTPS are the same URL and port.
|
@yanhongwang I think it's the Squid proxy server that's denying the proxy request, and the error has nothing to do with the registry authentication. (
Seems like it's the Squid output that says its access control configuration prevents your proxy request.
And I think this happens only for internal access, for example. The proxy works when requesting I suggest you consult your network administrator to figure out what's going on. I believe they will be able to help you out after looking at the log. |
The call to fetch So I suspect that you shouldn't be accessing your registry through the proxy. You should be be able to set |
@chanseokoh @briandealwis Before doing that. I always set proxy by environment variable in shell (http_proxy, https_proxy and no_proxy), Now I try to set up proxy (http, https and no_proxy) in /root/.m2/settings.xml
And why does that show error? [ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:1.0.0:build (default-cli) on project myservice: Build image failed, perhaps you should make sure that the registry you configured exists/is spelled properly: Unknown host gcr.io -> [Help 1] |
The implementation reads proxy info from the system properties you've been using. It doesn't pick up any particular environment variables for proxy info (unless you provide the system properties through a JVM-wide environment variables by, e.g., setting I don't find anything particularly wrong with |
You are right. It works now. Thanks very much. |
Closing a stale issue. For those who encounter 401 (Unauthorized) or 403 (Forbidden, DEFINED), check out these FAQs: |
jib-maven-plugin
Configuration:Log output:
Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.10.0:build (default-cli) on project demo_jib_docker: Build image failed, perhaps you should make sure your credentials for 'registry.hub.docker.com' are set up correctly: Unauthorized for registry.hub.docker.com/mhamdisemah/demo-jib: 401 Unauthorized
[ERROR] {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":[{"Type":"repository","Class":"","Name":"mhamdisemah/demo-jib","Action":"pull"},{"Type":"repository","Class":"","Name":"mhamdisemah/demo-jib","Action":"push"}]}]}
The text was updated successfully, but these errors were encountered: