code-server
code-server copied to clipboard
[Bug]: Scala[Metals] would report "failed to connect with build server."
Is there an existing issue for this?
- [X] I have searched the existing issues
OS/Web Information
- Web Browser: Edge
- Local OS: Windows 10
- Remote OS: Ubuntu 18
- Remote Architecture: x86_64
-
code-server --version
: 4.4.0
Steps to Reproduce
- open code-server
- install Scala[Metals] extension.
- open a scala project.
Expected
metals works.
Actual
Report "Failed to connect the build server, no functionality will work."
Logs
The metals would report as below.
2022.06.13 10:58:52 ERROR Failed to connect with build server, no functionality will work.
java.lang.NullPointerException
at scala.meta.internal.mtags.CommonMtagsEnrichments$XtensionPathMetals.filename(CommonMtagsEnrichments.scala:308)
at scala.meta.internal.mtags.CommonMtagsEnrichments$XtensionAbsolutePath.filename(CommonMtagsEnrichments.scala:469)
at scala.meta.internal.metals.JdkSources$.isJdkCandidate$1(JdkSources.scala:37)
at scala.meta.internal.metals.JdkSources$.$anonfun$candidates$2(JdkSources.scala:47)
at scala.collection.immutable.List.map(List.scala:246)
at scala.meta.internal.metals.JdkSources$.candidates(JdkSources.scala:44)
at scala.meta.internal.metals.JdkSources$.apply(JdkSources.scala:20)
at scala.meta.internal.metals.doctor.ProblemResolver.javaSourcesProblem$1(ProblemResolver.scala:223)
at scala.meta.internal.metals.doctor.ProblemResolver.$anonfun$findProblem$5(ProblemResolver.scala:291)
at scala.Option.orElse(Option.scala:477)
at scala.meta.internal.metals.doctor.ProblemResolver.findProblem(ProblemResolver.scala:291)
at scala.meta.internal.metals.doctor.ProblemResolver.$anonfun$problemMessage$1(ProblemResolver.scala:67)
at scala.collection.immutable.List.flatMap(List.scala:293)
at scala.meta.internal.metals.doctor.ProblemResolver.problemMessage(ProblemResolver.scala:66)
at scala.meta.internal.metals.doctor.Doctor.check(Doctor.scala:165)
at scala.meta.internal.metals.MetalsLanguageServer.$anonfun$connectToNewBuildServer$8(MetalsLanguageServer.scala:2345)
at scala.meta.internal.metals.Indexer.$anonfun$indexWorkspace$6(Indexer.scala:220)
at scala.meta.internal.metals.TimerProvider.timedThunk(TimerProvider.scala:25)
at scala.meta.internal.metals.Indexer.indexWorkspace(Indexer.scala:219)
at scala.meta.internal.metals.Indexer.$anonfun$profiledIndexWorkspace$2(Indexer.scala:140)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.meta.internal.metals.TimerProvider.timedThunk(TimerProvider.scala:25)
at scala.meta.internal.metals.Indexer.$anonfun$profiledIndexWorkspace$1(Indexer.scala:140)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:678)
at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Screenshot/Video
No response
Does this issue happen in VS Code?
- [X] I cannot reproduce this in VS Code.
Are you accessing code-server over HTTPS?
- [X] I am using HTTPS.
Notes
Actually i am not using https now. I just follow the instruction on installation page of documentation, and install code-server through apt on Ubuntu.
Hmm...is it only this extension?
Does this extension work with GitHub Codespaces?
I think this is the only full suite for scala on vscode. I did not tried GitHub Codespaces, but vscode.
Can you please try GitHub Codespaces?
Can you please try GitHub Codespaces?
Unfortunately, I don't have any access to codespaces.
Isn't it available to everyone?
no,it should be required by orgnization
---Original--- From: "Joe @.> Date: Thu, Jun 16, 2022 04:14 AM To: @.>; Cc: @.@.>; Subject: Re: [coder/code-server] [Bug]: Scala[Metals] would report "failed to connect with build server." (Issue #5259)
Isn't it available to everyone?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Isn't it available to everyone?
When I tried to click "Your codespaces"
It reports that "None of your organizations have access to Codespaces yet."
Weird 🤔
And this page doesn't work, I suppose? https://github.com/features/codespaces
I followed the quickstart tutorial,however, there is no 'Create codespace on main.' under my 'code' push button。
---Original--- From: "Joe @.> Date: Thu, Jun 16, 2022 23:13 PM To: @.>; Cc: @.@.>; Subject: Re: [coder/code-server] [Bug]: Scala[Metals] would report "failed to connect with build server." (Issue #5259)
Weird 🤔
And this page doesn't work, I suppose? https://github.com/features/codespaces
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
I found that if i start the service through "/usr/bin/code-server", the bloop could work. However, if it is started by "systemctl start code-server@xxxx", it would fail.
Interesting! That sounds like a permissions error then, right? cc @code-asher any ideas?
When you run /usr/bin/code-server
are you using the same user you use for systemctl start code-server@$user
?
Are there any more logs? For example in the browser console or the output panel or in ~/.local/share/code-server/logs
.
Does this help at all? https://github.com/scalameta/metals/issues/1627
When you run
/usr/bin/code-server
are you using the same user you use forsystemctl start code-server@$user
?
yes, the user are the same.
Are there any more logs? For example in the browser console or the output panel or in
~/.local/share/code-server/logs
.
I have looked over the logs, it seems that there is no useful info.
Does this help at all? scalameta/metals#1627
I have read the above thread before submitting this issue.
It might be difficult to debug without logs.
I tried this out in an Ubuntu 20.04.4 container but was not able to reproduce:
git clone https://github.com/Readon/SpinalHDL
curl -fsSL https://code-server.dev/install.sh | sh
sudo systemctl start code-server@$USER
- Open SpinalHDL in code-server
- Click "Import build" once it appears in a popup
- See
Connected to Build server: Bloop v1.5.0-18-003e6c7b
eventually in the output panel
Definitely strange that the systemd version does not work while running directly does. Could you share the systemd file?