Skip to content

authentication failure with oci images when logged into multiple registries on the same domain at different subpaths #11286

Open

Description

@mmerickel

Repro steps:

$ helm registry login example.com/group1/helm-charts
$ helm registry login example.com/group2/helm-charts
$ helm pull oci://example.com/group2/helm-charts/myapp
Error: GET "https://example.com/v2/group2/helm-charts/myapp/tags/list": unexpected status code 401: unauthorized: authentication required
$ helm registry logout example.com/group1/helm-charts
$ helm pull oci://example.com/group2/helm-charts/myapp
Pulled: example.com/group2/helm-charts/myapp:0.0.45

Basically note that after logging out of the unneeded group1 that helm is happy again. It seems to be picking credentials based on domain instead of the most specific subpath.

I'm experiencing this issue from argocd 2.4.11 but I repro'd it locally without argocd as well.

Output of helm version:

version.BuildInfo{Version:"v3.9.4", GitCommit:"dbc6d8e20fe1d58d50e6ed30f09a04a77e4c68db", GitTreeState:"clean", GoVersion:"go1.19"}

Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.13", GitCommit:"a43c0904d0de10f92aa3956c74489c45e6453d6e", GitTreeState:"clean", BuildDate:"2022-08-17T18:22:57Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"darwin/arm64"}
Server Version: version.Info{Major:"1", Minor:"22+", GitVersion:"v1.22.11-eks-18ef993", GitCommit:"b9628d6d3867ffd84c704af0befd31c7451cdc37", GitTreeState:"clean", BuildDate:"2022-07-06T18:06:23Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"linux/amd64"}

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

EKS

Activity

  1. added
    bug
    on Sep 13, 2022
  2. github-actions commented on Dec 12, 2022

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  3. mmerickel commented on Dec 13, 2022

    @mmerickel
    Author

    not stale

  4. tuananh commented on Feb 8, 2023

    @tuananh

    not stale

  5. added
    oci
    on Feb 8, 2023
  6. mawatech commented on Mar 27, 2023

    @mawatech

    This one is really annoying because we also have different credentials for different groups in our company registry...

  7. falk-w commented on Mar 29, 2023

    @falk-w

    +1 can confirm this is an issue.

  8. SgtCoDFish commented on Jun 26, 2023

    @SgtCoDFish
    Contributor

    I encountered something like this as well.

    I logged into eu.gcr.io/company-name to pull some charts.

    Then I logged into eu.gcr.io/company-name/charts to pull other charts, with different credentials. Helm seems to not be able to tell which registry to use, meaning that attempts to pull from eu.gcr.io/company-name/charts would sometimes fail if they use the credentials under the eu.gcr.io/company-name key or succeed if they used the eu.gcr.io/company-name/charts key.

    Other tools have a different approach here. docker login for the two different registry paths will only store one set of credentials.

    $ helm version
    version.BuildInfo{Version:"v3.12.1", GitCommit:"f32a527a060157990e2aa86bf45010dfb3cc8b8d", GitTreeState:"clean", GoVersion:"go1.20.5"
  9. cuisongliu commented on Jul 18, 2023

    @cuisongliu
    Contributor

    #12237 This pr seems to fix the issue

  10. github-actions commented on Oct 17, 2023

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  11. none0nfg commented on Oct 17, 2023

    @none0nfg

    #12237 This pr seems to fix the issue

    Doesn't help me

  12. 4 remaining items

  13. github-actions commented on Apr 18, 2024

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  14. added and removed
    bug
    on May 20, 2024
  15. github-actions commented on Aug 19, 2024

    @github-actions

    This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

  16. patrikbeno commented on Sep 25, 2024

    @patrikbeno

    not stale

  17. Tehsmash commented on Sep 19, 2025

    @Tehsmash

    Run into this today, and managed to narrow it down to how helm uses Oras for remote registry access. There is an issue raised there to handle it but they don't seem to be prioritizing it: oras-project/oras-go#840

  18. TerryHowe commented on Oct 14, 2025

    @TerryHowe
    Contributor

    I have a PR on oras-go oras-project/oras-go#1008 for registries.conf support

    From the other PR:

    The helm registry command uses the OSX Keychain to store credentials, the issue is that if you store 2 credentials for the same registry, such as:

    Credential A - https://myregistry.com/

    Credential B - https://myregistry.com/my-cool-project

    If Credential A expires but persists in the keychain, helm will always try to use this credential even when pushing to the project that was enrolled with Credential B, furthermore if you inspect the config.json file, you will only see one set of credentials (Credential B).

    I am not sure if this is a limitation of the OSX Keychain or simply the implementation here but it would be nice to have a mechanism where multiple projects from the same registry could have their credentials managed and used appropriately.

    #13237

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurekeep openoci

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions