-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: hangs with ssh timeouts for https-hosted repo #54371
Comments
Thank you for reporting!
Generally speaking, our initial |
It is pretty curious, may be the problem is with some other tool, not gopls. Basically, I've got an auto-generated package of a form "some.url/repo.git/package/autogenerated". Those used to work until recently with both "gopls" and "go mod tidy -e" (the former adds squiggles, the later reports an error). Now I can see "go mod tidy" being stuck and the following processes extant:
"some.url/repo.git" is something that actually exists, only the package is auto generated. Yet, it has no ssh support in there, only https. |
Does |
Upon doing further diagnostics I discovered the situation below (I think "some.url" in my case is hosted on AWS)
On one hand, now I understand this to not be a problem with go tools, but some funny AWS config, recently implemented. On the other hand, this may affect any sort of package hosted in a similar AWS setup. I don't have the details for the setup, but I know that the repo is supposed to be served on HTTPS, there's no SSH in there. So, possibly, go should not wait on ssh to complete before trying https, but either try https first, or try them in parallel. |
Thanks for the details. CC @bcmills to see if there's anything actionable here for cmd/go. |
My present work around for the issue was to edit the global
Clearly, this is far from perfect, but it gets gopls going. :-) |
|
My git config, until very recently, was trivially simple. The problem has something to do with this: go/src/cmd/go/internal/vcs/vcs.go Line 242 in d922c0a
Namely, it appears to be trying the protocols from this slice in reverse order. In general, it's a bad idea to do unsolicited calls on other people ssh ports. To name one example, sshd is often used in combination with fail2ban: the later will add the client IP to the iptables blacklist if too many unsuccessful login attempts. There should be a syntax of some sort, possibly in go.mod, to specify the exact protocol to use with each repo. |
I shall also add, that "GIT_ALLOW_PROTOCOL=https" also works for me, owning to #17299. Yet, I do think that ability to specify a specific protocol for each package will be a valuable addition to go tooling. Contemporary internet is not a happy place by any measure, with all the networking malice and security countermeasures going around. |
There is: the It is true that we don't have a way to specify the URL scheme when bypassing the |
Yes, and sometimes it's even supported by various vendors (I think gitlab had added some automatic Go friendly redirects into their system). But in a simple case people may want to simply expose some git repo without bothering too much with additional secure http endpoints. I do appreciate the fact that Go is very open source friendly language trying to encourage people to host their packages openly in public repos. Alas, this world is less than perfect. :-) |
gopls 0.9.1/go 1.18.4
This is not a new issue, but it appears to be a regression not seen in quite some time.
When trying to open a workspace folder containing many references to normally "unresolvable" packages, gopls gets totally stuck and unable to function while also spamming the VS Code status bar with the error message "context deadline exceeded".
The deadline is exceeded because "git ls-remote " is unable to complete (for whatever unrelated reason). In quite a few preceding gopls versions it was not a problem (the "bad" packages will get a red squiggle and everything else just works), but 0.9.1 somehow gets very upset.
The text was updated successfully, but these errors were encountered: