-
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
x/tools/gopls: begins to fail after some use #32545
Comments
I’m sorry to hear you are encountering some issues. Would you be able to supply the logs and other diagnostic information suggested in the troubleshooting section here: |
Sure I will try to collect diagnostics |
this started to happen again (took some time today)
|
Looks like you were hitting the empty url issue that was fixed earlier today in https://go-review.googlesource.com/c/tools/+/181677 |
I was already on the tip.. I've reloaded all my VSCode windows. I'll report if (when) this happens again |
I'm not sure but this seems to happen when there are file movements (git pull, switch branch, renaming a file etc). But I'm not 100% sure |
When you switch branches, you will have to reload your instance of VSCode. We don't yet support watching files on disk, but you can track our work on that on #31553. Renaming a file will likely cause errors to appear though. LSP only tells us if a file has been closed or opened, so there is no clear way for us to detect that. Thanks for reporting, filed #32562. |
@stamblerre ah! that may be the cause. I was working on a huge refactoring and moved a tons of files again and again, which would explain these issues then. I will follow the 2 tickets mentioned above Thanks! |
Great, thank you for the report! Closing this issue then. Feel free to reopen if something else comes up. |
since last master, it's back. I have to restart gopls every 2m. It randomly stops working and says
|
this time I'm not moving any files around |
@primalmotion: Can you sync to the latest version of |
This is still happening. I still have to restart gopls every 2 or 3 minutes as it just stops working completely |
either I end up with an error at the top that says the file is not part of any package (I don't move files) or just plain nothing |
Are you able to share the |
Sure, I will next time it happens |
The error displayed is
|
Does |
It works a bit. Then as I write it find some syntax errors. When I'm done typing, then gopls stays stuck. |
Hm, from the logs it seems like it breaks immediately. What is the output of |
I'm not using go modules (I tried, go modules are completely missing the point and are a plain nightmare, but that's another discussion...)
|
The errors in your logs plus the A smaller way to repro would be to run |
@zikaeroh: Based on your logs, your issue seems to be different from @primalmotion's. Do you mind filing a separate issue? |
@primalmotion: I think you are encountering the current instabilities of |
@stamblerre ok perfect. thanks! |
@stamblerre I'll file another issue when I can reproduce it. I saved my repo as it was when things broke, but going back to it doesn't have the same result anymore. Perhaps some build cache got populated or something. I'll wait and see... |
I continue to experience regular failures of gopls, manifesting as a red squiggle under the
Killing gopls and having VS Code automatically restart it fixes the issue for a short while. I'm not sure which issue is the right place to report these failures anymore. |
@peterbourgon: This issue works. Would you be able to share your full logs? You will need to add |
It seems to happen randomly, usually after working in a project for more than 10 or 15 minutes. I'll add those flags and send the full logs when it happens again. |
I'm also having this same problem as @peterbourgon, but with
I'll try getting some trace logs when I get a chance |
@stamblerre Forgive the long delay, I've finally got a complete debug log for a session where this occurred. Due to its size (3.7MB, 36k lines) and some potentially sensitive project-related details, I'd prefer to send it to you in a non-public way. Can you give me some instructions for that, either here, via Twitter DM @peterbourgon, or Keybase peterbourgon? edit: also congrats on your talk today 🎉 |
@peterbourgon: Thanks! That would be great. If you're able to redact the sensitive content, that might be easier, but if you prefer to just send it privately, you can send it via email: rstambler@golang.org. |
@stamblerre I've sent you the output from the original project I was talking about via email, but it's just happened to me again on a less-sensitive project, which I can post here. The errors seem to be slightly different, but the effect in the editor is the same: features stop working, and a red squiggle under the |
@peterbourgon: It looks like you are using an older version of |
I have updated, but I hope you can still extract useful signal from the existing reports. |
We have made a number of stability improvements since |
Lucky (in a sense) — immediately after upgrading and starting a coding session, I hit the same problem again. Here are the logs. To contextualize things a bit, I was going along fine, and renamed a file at around 7:30pm, after which VS Code complained that the types in that file were previously defined elsewhere—presumably confused with the file I had just renamed from. I restarted gopls via
|
Renaming a file is a particularly tricky case in LSP, which is why we don't handle it well yet. Had you opened the |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Timeout after 6 days? Looks like a mistake, @gopherbot! |
@Xjs: The timeout is calculated based on the time since the last response by the OP. I will re-open this issue, since I am still waiting on a response from @peterbourgon. |
For the record I have been trying to get a repro case of what happened before, but getting precisely those events to line up again has been difficult. However: there have been plenty of times where similar things have occurred, i.e. I perform some action and one or more Go source files become permanently mis-parsed by gopls. The original problem (whatever.go is not part of a package) is one of the manifestations but I've seen others, incorrect claims that types are defined twice, that types aren't defined at all, others I'm forgetting. Would providing logs and that |
Yes, that would be useful. These all sound like different issues (types defined twice usually implies build tags, etc.), so if you'd be willing to file an issue when you encounter a problem, that would be very helpful. All you would need to provide is the output of the It might be easiest if I close this issue for now since it's so long, and we can discuss again once you encounter a new problem. Thanks so much for your help! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I pulled latest after a week or two
What did you expect to see?
Gopls to work
What did you see instead?
Using VSCode, I have to reload everything for gopls to work every 2m or so. Otherwise I get random errors:
I don't do anything special and all of this was working pretty well 2 weeks ago. It has become mostly unusable for me :(
The text was updated successfully, but these errors were encountered: