Skip to content
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

Fetching Image From Public Registry Results in HTTP 401 on Windows 11 Under WSL2 Through Rancher Desktop #1589

Open
1 task
donmai2024 opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working triage New issues or PRs to be acknowledged by maintainers

Comments

@donmai2024
Copy link

What happened in your environment?

Hello,

oras fails authorization when ran via WSL2 through Rancher Desktop to pull from a public GitHub container registry.

Example CLI log:

/mnt/wsl/rancher-desktop/run/data/ # oras manifest fetch --debug --verbose ghcr.io/jonashackt/hello-world:latest
DEBU[0000] Request #0
> Request URL: "https://ghcr.io/v2/jonashackt/hello-world/manifests/latest"
> Request method: "GET"
> Request headers:
   "Accept": "application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, application/vnd.oci.artifact.manifest.v1+json"
   "User-Agent": "oras/1.2.1"
DEBU[0000] Response #0
< Response Status: "401 Unauthorized"
< Response headers:
   "Content-Length": "73"
   "X-Github-Request-Id": "C778:3ED69D:CE2642:E9A965:67603DE8"
   "Content-Type": "application/json"
   "Www-Authenticate": "Bearer realm=\"https://ghcr.io/token\",service=\"ghcr.io\",scope=\"repository:jonashackt/hello-world:pull\""
   "Date": "Mon, 16 Dec 2024 14:49:12 GMT"
Error: failed to fetch the content of "ghcr.io/jonashackt/hello-world:latest": GET "https://ghcr.io/v2/jonashackt/hello-world/manifests/latest": exit status 28

docker config.json

{
  "credsStore": "rancher-desktop"
}

What did you expect to happen?

The manifest and images to be pulled to my local workstation.

How can we reproduce it?

  1. Install Rancher Desktop on a Windows 11 host machine
  2. Install WSL2
  3. Use rancher-desktop as your distribution for WSL2
  4. Use docker login in the Windows host, so that your credentials are in the Windows Credential Manager
  5. Run oras manifest fetch in the WSL2 shell against a public image of your choice

What is the version of your ORAS CLI?

/mnt/wsl/rancher-desktop/run/data # oras version
Version:        1.2.1
Go version:     go1.23.4
Git commit:     a0228556766b6276010d8feb937af512e8a50808
Git tree state: clean

What is your OS environment?

Windows 11, WSL2, Rancher-Desktop

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.
@donmai2024 donmai2024 added bug Something isn't working triage New issues or PRs to be acknowledged by maintainers labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues or PRs to be acknowledged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant