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

Could not parse repo URL #9440

Closed
3 tasks done
ragnarpa opened this issue May 18, 2022 · 9 comments · Fixed by #9836
Closed
3 tasks done

Could not parse repo URL #9440

ragnarpa opened this issue May 18, 2022 · 9 comments · Fixed by #9836
Labels
bug Something isn't working cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch regression Bug is a regression, should be handled with high priority

Comments

@ragnarpa
Copy link
Contributor

ragnarpa commented May 18, 2022

Checklist:

  • I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • I've included steps to reproduce the bug.
  • I've pasted the output of argocd version.

Describe the bug

SSH URL parsing of GitHub repos is failing.


To Reproduce

  1. Install Argo CD 2.4 RC
  2. Add a Git repo with SSH URL
  3. Deploy applications that reference the added repo
  4. Monitor Argo CD repo server logs
  5. You should see warnings like following
time="2022-05-18T08:06:28Z" level=warning msg="Could not parse repo URL 'git@github.com:my-account/my-repo.git': parse \"git@github.com:my-account/my-repo.git\": first path segment in URL cannot contain colon"

Expected behavior

No warnings in the logs. Current warnings are confusing and leave a user with an impression as if something is broken.

Screenshots

Version

Paste the output from `argocd version` here.

v2.4.0+68a0a83

Logs

Paste any relevant application logs here.
time="2022-05-18T08:06:28Z" level=warning msg="Could not parse repo URL 'git@github.com:my-account/my-repo.git': parse \"git@github.com:my-account/my-repo.git\": first path segment in URL cannot contain colon"
@ragnarpa ragnarpa added the bug Something isn't working label May 18, 2022
@booleanbetrayal
Copy link

Just a confirmation that we are seeing this as well in our logs.

@crenshaw-dev crenshaw-dev added regression Bug is a regression, should be handled with high priority cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch labels Jun 23, 2022
@kenchan0130
Copy link
Contributor

I have investigated this issue.

The origin of the WARN logs is due to a change in #8508.

There is a problem with the process of extracting the hostname from the repository URL and generating the file path of the certificate associated with the hostname.

As of v2.4.2, the Parse method of the net/url package is used to extract the hostname from the repository URL.

That method fails to parse if it receives a git@[GitRepo]:OrgOrUsername/reponame.git format.
Therefore, a WARN log is output.

Before that change, if it was not an HTTPS Scheme, it would simply return an empty string, so there was no WARN log for repository URLs of that format.


For now, if we want to enjoy the same behavior as before, it appears that we should just return an empty string when git.IsSSHURL is true.
This can be changed by me and a PR can be issued.

However, if we are using ssh scheme git repository URL, and the CA path is an empty string, then https://github.com/argoproj/argo-cd/blob/v2.4.2/pkg/apis/application/v1alpha1/repository_types.go#L 177, the return value of the getCAPath function at 177 will always be an empty character.

Therefore, I am not sure if fixing this degrade is really the right thing to do.

@qixiaobo
Copy link

The same problem

@hasland
Copy link

hasland commented Jul 29, 2022

Our ArgoCD server is showing this logs too but it doesn't look just a warning for us because our repos connection fail to connect from time to time. We can see it in Argo config > repositories - from time to time some repos got Failed status in Connection Status, then after sometime it connects back and change the status to Successfull

@mars64
Copy link

mars64 commented Aug 2, 2022

tldr; I hit this issue, and it was related to node egress security groups.

I ran into this issue using versions of argocd that previously worked in other clusters (2.4.5-2.4.8), and was confused why suddenly I started seeing this issue on 2.4.8. As it happened, a colleague had constructed an incomplete EKS configuration using the terraform-aws-eks provider -- by default, the provider only adds security groups for control plane communication -- no node-to-node or egress. By implementing the basic security groups as per the complete example, I was able to resolve this behavior.

Confirmed on at least ArgoCD v2.4.8+844f79e

@slamer59
Copy link

slamer59 commented Aug 8, 2022

Lose 4h... to see that it works even with the error message ...

@qixiaobo
Copy link

Lose 4h... to see that it works even with the error message ...

Time killer 😢

@kenchan0130
Copy link
Contributor

I have already made tentative corrections here.
I am waiting for your vote as it seems to be a low priority for review.

@crenshaw-dev
Copy link
Member

Thanks for y'alls patience! I just merged and cherry-picked the fix. I'll see if folks are okay with a release of 2.4.10 today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch regression Bug is a regression, should be handled with high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants