Failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: unexpected status: 401 Unauthorized

Solved!

I had same problem, it has fixed by logging in again using docker login command

1 Like

I was solved!
BY docker loginmy docker user’s name and password. Hope this would help you!

1 Like

I would like to say thanks for this informative topic.

In my case, VPN connection was cause of the problem.
When I off VPN, it works again.

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Post “https://auth.docker.io/token”: dial tcp: lookup auth.docker.io on 192.168.13.1:53: read udp 192.168.3.1:63499->192.168.13.1:53: i/o timeout

M1 Mac book pro

1 Like

This worked for me. Thank you.

Is there a conclusive solution to this problem? I keep having this issue where docker build fails with the message

failed to fetch oauth token: Post “https://auth.docker.io/token”:

After a few attempts (over a few hours) it miraculously starts working again - this without any changes to any configuration whatsoever.
@DockerSupport kindly suggest what’s happening here and what can be done to avoid this irritating glitch

I get similar error even with docker login, disabling buildkit with docker desktop version 4.15.0. Also I wonder why fetch oauth token uses Post method

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch oauth token: Post "https://registry-url/token": x509: certificate signed by unknown authority

@DockerSupport Appreciate your advice.

This topic is in the Docker Hub category. In your error message the registry url is not docker.io. Do you have problem with Docker Hub or with your self-hosted Docker registry?

Had the same issue. Restart your docker daemon

Turning off the VPN also helped me, thank you very much!

I had the same problem. I changed my internet connection to mobile hotspot and it worked.