-
Notifications
You must be signed in to change notification settings - Fork 340
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
Metals through VS Code reproducibly stops working #1644
Comments
I'm experiencing a very similar problem and I was about to create an issue myself. What I see is a general freeze of the features of metals like the autocompletion not working, the errors not updating while I can compile the code succesfully from SBT console. I do not have a list of steps to reproduce the issue because it seems it happens randomly and I can solve it by removing For me this issue started with the upgrade from 0.8.3 to 0.8.4 Installation:
Screenshot: |
/cc @adamgfraser, who I know has had this issue as well. |
Thanks for reporting! Fixing this is certainly a priority, since we did notice it happening more frequently. @ColOfAbRiX You can revert the server version to |
I had some recurring problem with Metals as well and I remember that stopping the Bloop service and restarting it with I believe that the incremental compilation in Bloop with Metals is a serious candidate. I would like to reproduce it and investigate further. @jdegoes could you please share with us:
|
@adpi2 I was looking at this during this week and the current action plan I came up with is:
|
Sorry if this isn't related but I often get this:
Nothing happens after that. Running the command again gives the same output. |
We've already done some improvements and I personally haven't encountered any hanging compilations on 0.9.0 version. Please do report if anything like that happens again, otherwise I will close this issue in the next two weeks. @davidpdrsn I think this might have something to do with running CLI and Metals at the same time. Could you run
As a current workaround you could try to do |
I am on version 0.9.0 and still getting these errors. This is the output of
Just let me know if this is a separate issue from what OP is seeing and if I should make a new issue. |
@davidpdrsn Looks like a separate issue, would you mind reporting it in scalacenter/bloop ? |
Yes will do 👍 |
Looks like issue was fixed in Bloop. Haven't encountered it since the last release, but feel free to report if anything like this happens again. |
This issue is most definitely not resolved, and in any of the code bases that I work on regularly (including ZIO), it has never been resolved (though frequency sometimes changes with Metals releases), and I have observed the same issue while pairing with > 10 developes during regular mentoring sessions across a variety of projects, each with its own build. To my knowledge, there are no finite and repeatable set of steps that can place Metals into this state, other than, "Use Metals with a project like ZIO for some minutes to some hours". However, it will always end up in this state and the steps needed to momentarily reverse it can become quite drastic. |
I closed the issues since there didn't seem to be any of those logs about
You mentioned multiple issues in your original report regarding compilation that wasn't stopping. Is that error the same one you're continually seeing? Could you be more specific on the exact errors you're experiencing? You mention > 10 other developers, were you all on the same OS? Were you all using Bloop as your build server? Did you experience the same with sbt? The more information you can provide, the easier it is for us to look into. Would be cool to run We are also working on some more reporting mechanisms so that it's easier to catch some transient errors, if you have any ideas for scenarios where things might break (any logs etc. we can add some reporting around there). |
Sometimes I do not see any errors in the log. Metals is frozen and nothing appears to function (including restarting the server); and often any compiler errors appear frozen in VS Code. I regularly pair with dozens of Scala developers, a good number of which run into this issue in different circumstances (different code bases): I'd say 90% of them are on Mac. I encounter more problems on Windows than Mac, but it's difficult to say where in the chain those issues lie (for example, opening the ZIO project on a Windows machine has often resulted in thousands of errors appearing everywhere, even though the code compiles fine with SBT). It would help me and other developers to submit bug reports if there is a set of well-defined artifacts that we can give you that can help you get closer to understanding what's going on. For example:
It would be wonderful if Metals had an action along the lines of Non-deterministic 'hangs' cannot be reproduced deterministically in a finite series of steps; they often occur after working for 10 minutes or 3 hours; tying the defects to this action or that action or doing any sort of minimization is not feasible. |
I will add that I've had a lot of these experiences as well though I'd add that anecdotally it's gotten much better over the past year. I would love a "Generate Bug Report". I've spent a lot of time trying to dig through lsp/bsp traces, I think realistically we need something like cats-effect Fiber Dump (https://typelevel.org/cats-effect/docs/core/fiber-dumps) where you can send a signal to the metals process to dump as much information about it's internal state as possible. Can it talk to the BSP? Is it awaiting a response from something, etc. I don't know enough about the internals to enumerate all the data. Obviously if that can be exposed to Metals Doctor even better but for now, crowd-sourcing these reports would certainly help pinpoint where the problems lie. Is it Metals? Is it Bloop? Is it SBT BSP? I almost never use SBT FWIW. |
@jdegoes @matthughes When you have these issues, does Metals use sbt or Bloop as the Build Server? Have you tried switching from one to the other? Has that changed the behavior with regards to reliability etc.? |
I only use Bloop as the build server (as do most developers that I know). I will give SBT a try to see there is any change. |
Bloop is great for compiling multiple projects at the same time, but is getting less maintenance than sbt itself. We are trying to up out game on that front, but it's always good to try out sbt as the alternative. You can Metals + sbtn to have the best experience. We are thinking of Maybe switching to sbt as the default if it proves more reliable. Alternatively, for Bloop there should be two steps to fix things:
Removing things (.bloop/.metals) most likely will not help and if both these will not work it means it's something reproducible in that state and we can try running So in reality when using Bloop there can be 4 layers of problems:
We are looking into that in #4924 so please add any ideas on what to include. This should help out figuring out the problems of users with any transient issues and reduce the need for restart/clean-compile. |
I will report back when I have had a chance to thoroughly test it. In the meantime, I received reports from two people claiming (separately) that:
These do not explain most situations but perhaps they can be helpful to isolating a problem in one of the 4 layers (2 sounds like Bloop). |
Another report:
|
Describe the bug
Metals stops compiling ZIO after anywhere from a few hours to a few days of continuous use.
To Reproduce
Steps to reproduce the behavior:
I have observed this to happen with smaller repositories, as well as larger ones like ZIO.
To fix this problem, it is often necessary to:
rm -rf .bloop .metals
Sometimes, only some of these steps are necessary to restore a working environment.
Expected behavior
Ideally, Metals should continue to work for hours and days of use at a time.
Screenshots
An example of the kind of error messages produced by Metals:
In the above, no amount of waiting solves the problem:
This is not always the error produced (other times there are other errors).
It's not clear if these errors have anything to do with the issue.
Installation:
Additional context
Search terms
The text was updated successfully, but these errors were encountered: