rancher: [BUG] authenticate to private git repository hosted on Azure DevOps using using HTTP Basic Auth with PAT fails when using it as Rancher Chart Repository since rancher 2.10.x
Rancher Server Setup
- Rancher version: 2.10.0
- Installation option: Helm
Information about the Cluster
- Kubernetes version:
- Cluster Type (Local/Downstream): Downstream, Imported, k3s 1.28.13
User Information
- What is the role of the user logged in? Admin/Cluster Owner
Describe the bug For a Rancher Chart repository created using “Git Repository” option, if the git repository is a private git repository hosted on https://dev.azure.com, the git clone will fail starting rancher 2.10.x
The git clone did not fail in 2.8.4
To Reproduce
- In Cluster Dashboard → Apps → Repositories, create a new Chart Repository:
- Select
Git repository containing Helm chart or cluster template definitions - For index URL: such as
https://dev.azure.com/sample-org/project/_git/repo-name - Create a new HTTP Basic Auth using “azure” as username, and Azure PAT as password.
- Select
- Save
Result The repository will then go to Error status, with following messages:
Head failure: git clone --depth=1 -n -- https://azure@dev.azure.com/sample-org/project/_git/repo-name management-state/git-repo/git-azure/fcbbf3098e5a1db4837249705873110484603daf98bdf83db1d668183aab1c4f error: exit status 128, detail: Cloning into 'management-state/git-repo/git-azure/fcbbf3098e5a1db4837249705873110484603daf98bdf83db1d668183aab1c4f'... fatal: unable to update url base from redirection: asked for: https://azure@dev.azure.com/sample-org/project/_git/repo-name/info/refs?service=git-upload-pack redirect: https://spsprodweu2.vssps.visualstudio.com/_signin?realm=dev.azure.com&reply_to=xxxxxxxxxxxxxxxxxxx . Will retry after 18m54s
Expected Result The Rancher chart repository based on Azure Devops Private git repository should be initialized successfully
Screenshots
Additional context The same setting works well in Rancher 2.8.4 The rancher server is then upgraded to 2.10.0
Tried to create a new repository in Rancher 2.10.0 resulted in the same error, so we don’t think it is related to the upgrade.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 4
- Comments: 17 (4 by maintainers)
Same issue here but when the repo is hosted by Bitbucket.
Update: SSH is working as expected it seems to be just an issue with basic auth
@rohitsakala no, there is two issues here, both with same cause/outcome. The http still does not work with azure devops private repos in Apps & Marketplace.
We are using v2.11.2 with v1.32.5+rke2r1, it still fails with http basic auth.
@rohitsakala can the issue be reopened until you validate it?
@johnwc I will look into this.
I could observe the same issue with Gitlab. For me using HTTPS + Basic Auth worked when using
https://<username>:<password>@my.git.server.com/repo/fancyproject.gitwith usingNoneas Authentification in Rancher.Like this:
Not ideal and quite hacky but it’s an alternative for everyone who can’t or don’t want to use SSH.
I hope the Rancher team fixes it in the next minor release. I think there is an issue in applying/using the password when doing the git clone. It seems like it just uses the username but not the password from the secret.
We use bitbucket but the form we used was
git@bitbucket.org:organisation/repo.git