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

Metals server fails to start on an empty directory #1541

Open
CMajeri opened this issue Sep 24, 2024 · 3 comments
Open

Metals server fails to start on an empty directory #1541

CMajeri opened this issue Sep 24, 2024 · 3 comments

Comments

@CMajeri
Copy link

CMajeri commented Sep 24, 2024

Describe the bug

Metals server fails to start on an empty directory.

To Reproduce Steps to reproduce the behavior:

  1. Make an empty dir
  2. Open vscode
  3. Click on "New scala project"
  4. error "client is not running"

logs full of

[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.
[Error - 8:31:48 AM] Client Metals: connection to server is erroring. Shutting down server.

Would be great if we could get the server's error somewhere (no .metals dir)

Expected behavior
Stuff should work

Installation:

  • Operating system: Linux
  • VSCode version: 1.91.9
  • VSCode extension version: 1.39.1
  • Metals version: (found in VSCode settings, under metals.serverVersion) 1.3.5

Additional context

Tested with openjdk 17 and 21.
Set via JAVA_HOME env var.
I tried making it work on a real project first, gave up, opened vscode on empty dir, same error

Search terms

@tgodzik
Copy link
Contributor

tgodzik commented Sep 24, 2024

Thanks for reporting! Do you get any information in Metals Output? What did you set JAVA_HOME to?

@CMajeri
Copy link
Author

CMajeri commented Sep 29, 2024

Hi, sorry for the delay, I had issues with notifications...
I'm running:

$ export JAVA_HOME=/usr/lib/jvm/java-21-openjdk

I tried with openjdk 17 as well, logs seem to indicate that the jdk is picked up correclt. If I unset the var it reports trying to install it with coursier, but not when I do have the env var

@tgodzik
Copy link
Contributor

tgodzik commented Sep 30, 2024

So it's possible that we are picking up jvmopts from the local directory that interfere with metals. Do you have anything set in .jvmopts file inside the directory? Does it happen on every project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants