argo-cd
argo-cd copied to clipboard
Failed to sync: unexpected client error: unexpected requesting status code 301
Checklist:
- [x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- [x] I've included steps to reproduce the bug.
- [x] I've pasted the output of
argocd version
.
Describe the bug
When trying to sync repos, I get rpc error: code = Unknown desc = unexpected client error: unexpected requesting "https://gitlab.com/criscola/capi-gce-demo-argocd/info/refs?service=git-upload-pack" status code: 301
I've had a look at this of course: https://github.com/argoproj/argo-cd/issues/2640 but it didn't solve my problem.
To Reproduce
I added my repository like that: argocd repo add [email protected]:criscola/capi-gce-demo-argocd.git --ssh-private-key-path ~/.ssh/id_ed25519
I then switched to using HTTPS and it worked. As you can see I've added the suffix .git
to the repo's URL.
Expected behavior
My Applications should sync fine.
Screenshots
Version
argocd: v2.3.4+unknown
BuildDate: 2022-05-20T05:06:57Z
GitCommit:
GitTreeState:
GitTag: 2.3.4
GoVersion: go1.18.2
Compiler: gc
Platform: linux/amd64
argocd-server: v2.3.4+ac8b7df
BuildDate: 2022-05-18T11:41:37Z
GitCommit: ac8b7df9467ffcc0920b826c62c4b603a7bfed24
GitTreeState: clean
GoVersion: go1.17.10
Compiler: gc
Platform: linux/amd64
Ksonnet Version: v0.13.1
Kustomize Version: v4.4.1 2021-11-11T23:36:27Z
Helm Version: v3.8.0+gd141386
Kubectl Version: v0.23.1
Jsonnet Version: v0.18.0
Logs
I think ArgoCD should automatically add .git
suffix if does not exist in repo's URL.
This error also occurs if the repo is empty and argocd is trying to connect to it (with .git in the url)
This also occurs after migrating my git host to a new domain. why doesn't it "simply" follow redirects?
This also happens when you try and use a private repo for which you don't have a credential secret defined.