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 - Scala Language and Build Server Extension For VS Code #1574

Closed
kevalkaneria1 opened this issue Apr 1, 2020 · 18 comments
Closed

Metals - Scala Language and Build Server Extension For VS Code #1574

kevalkaneria1 opened this issue Apr 1, 2020 · 18 comments
Labels
needs more information Use if we need more information for a specific ticket

Comments

@kevalkaneria1
Copy link

kevalkaneria1 commented Apr 1, 2020

Question

I am having an issue on Metals - Scala Language and Build Server Extension For VS Code. I have reached out Microsoft team regarding Metal extension, but since it is third party extension, so they do not provide any support for it. I have attached error note with this issue.

Screenshots
This is the error i am getting

Failed to download metals, make sure you have an internet connection and the java home 'C:\Progra1\JAVA\jdk181.0' is valid. you can configure the java home in the settings. see https://scalameta.org/metals/docs/editors/vscode.html#http-proxy for instructions if you are using an http proxy.

Installation:

  • Operating system: Windows
  • Editor: Visual Studio Code
  • Metals version: v1.7.7

Additional context

Search terms

@tgodzik
Copy link
Contributor

tgodzik commented Apr 2, 2020

Hi, thanks for reporting!

1.34.0 doesn't seem to be a valid Metals version.
Metals does have two different versions. One for the server, which can be seen in the Metals settings and the other is the VS Code extension version, which can be seen in the extensions.

Additionally C:\Progra1\JAVA\jdk181.0 doesn't look like a valid Java Home, could you maybe try to set the path to a JDK by hand in the Metals javaHome setting?

@kevalkaneria1
Copy link
Author

kevalkaneria1 commented Apr 2, 2020

Thank you for quick reply

server version is 0.8.0
extension version is 1.7.7

it's unclear to me what JAVA_HOME is supposed to be if not C:\PROGRA1\Java\JDK181.0 which is my standard value. do you have any more detail about the formatting? would you mind linking the issue?

apparently when I use a JAVA_HOME value other than my system default, it does not even attempt to install any of the dependencies, so I'm unsure if it is actually invalid

@tgodzik
Copy link
Contributor

tgodzik commented Apr 2, 2020

C:\Progra1\JAVA\jdk181.0 just looked misspelled and I thought it might be an encoding issue or something of the kind.

Could you try updating to the newest extension 1.8.5? We made fix there that should log more into the VS Code Output, which might be helpful to diagnose the issue.

@kevalkaneria1
Copy link
Author

we uninstalled and tried to reinstall, it prompted me to upgrade, so I started the process, but it seems to fail silently and just re-prompts me to upgrade.

@kevalkaneria1
Copy link
Author

kevalkaneria1 commented Apr 2, 2020

JDK path seems correct to me. we have placed path in environment variable as well. we are using this application on our work place.

@kevalkaneria1 kevalkaneria1 reopened this Apr 2, 2020
@tgodzik
Copy link
Contributor

tgodzik commented Apr 3, 2020

so I started the process, but it seems to fail silently and just re-prompts me to upgrade.

So you are unable to update the extension? Maybe you also need to update the visual studio code version? I might not be able to help you out much without the update, because the errors are swallowed up currently. You also try to run Metals install maunally to see what's going on via:

# Make sure to use coursier v1.1.0-M9 or newer.
curl -L -o coursier https://git.io/coursier-cli
chmod +x coursier
./coursier bootstrap \
  --java-opt -Xss4m \
  --java-opt -Xms100m \
  --java-opt -Dmetals.client=vscode \
  org.scalameta:metals_2.12:0.8.3 \
  -r bintray:scalacenter/releases \
  -r sonatype:snapshots \
  -o /usr/local/bin/metals -f

Then try to run the generated executable. The way you do it will need to be different than on linux, but please take a look at the coursier website, might be helpful: https://get-coursier.io/

Alternatively, you could try removing the java home altogether, if we don't find it we might offer downloading it automatically. Lastly, it might be good to try and reinstall the JDK.

Not sure what else can help.

@kevalkaneria1
Copy link
Author

we have upgraded VS code 1.43.2 with latest version. I will update you soon

@tgodzik
Copy link
Contributor

tgodzik commented Apr 15, 2020

@kevalkaneria1 Did you manage to find any more logs?

@tgodzik tgodzik added the needs more information Use if we need more information for a specific ticket label Apr 15, 2020
@kevalkaneria1
Copy link
Author

Issue still didn't get resolved. we have upgraded Vs code with latest version. also, we are using latest version of Coursier. coursier recognizes my JDK/JRE as being valid paths/installations, otherwise it would fail to execute anything.

I can download the artifacts using curl or something, and use coursier to install them directly (though coursier might just be for downloading the artifacts) since it seems like I can download them outside of coursier. Do you know how install artifact using CURL.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 15, 2020

How is it failing now in VS Code? There should be some log in the Metals Output, which might be helpful to solve the issue.

@kevalkaneria1
Copy link
Author

Java home: C:\PROGRA1\Java\JDK181.0
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app-annotations_2.12/2.0.0-M9/case-app-annotations_2.12-2.0.0-M9.jar: repo1.maven.org, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/argonaut-shapeless_6.2_2.12/1.2.0-M11/argonaut-shapeless_6.2_2.12-1.2.0-M11.jar: repo1.maven.org, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/github/alexarchambault/case-app_2.12/2.0.0-M9/case-app_2.12-2.0.0-M9.jar: repo1.maven.org, ignoring it
Error while downloading https://repo1.maven.org/maven2/com/chuusai/shapeless_2.12/2.3.3/shapeless_2.12-2.3.3.jar: repo1.maven.org, ignoring it

Tooltip text:

Failed to download Metals, make sure you have an internet connection and the Java Home 'C:\PROGRA1\Java\JDK181.0' is valid. You can configure the Java Home in the settings.See https://scalameta.org/metals/docs/editors/vscode.html#http-proxy for instructions if you are using an HTTP proxy.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 15, 2020

Those errors seem to be exactly the issue. Due to those failures, Metals is unable to start the server. Any idea why it's not being downloaded? Those are all valid links, are you able to curl them?

Maybe you are using some kind of a proxy to connect to maven central?

@kevalkaneria1
Copy link
Author

yes we are using proxy because we are using in our work environment.

@kevalkaneria1
Copy link
Author

HTTP proxy
Metals uses Coursier to download artifacts from Maven Central. To use Metals behind an HTTP proxy, configure the system properties -Dhttps.proxyHost=… -Dhttps.proxyPort=… in one of the following locations:

.jvmopts file in the workspace directory.
JAVA_OPTS environment variable, make sure to start code from your terminal when using this option since environment variables don't always propagate correctly when opening VS Code as a GUI application outside a terminal.
"Server Properties" setting for the Metals VS Code extension, which can be configured per-workspace or per-user.

On this 3 option do we have to configure all 3

@tgodzik
Copy link
Contributor

tgodzik commented Apr 16, 2020

You should only configure one option. If you use the last option, it should one property per line.

That is needed for the coursier to be able to use proxies. There is some more information on the topic here: https://scalameta.org/metals/docs/build-tools/proxy.html

@tgodzik
Copy link
Contributor

tgodzik commented Apr 16, 2020

If that doesn't work, we also talk about some additional things to set here: scalameta/metals-feature-requests#9

In particular javax.net.ssl.trustStore might be needed in some corporate environments.

@tgodzik
Copy link
Contributor

tgodzik commented Apr 24, 2020

Any luck with the proxies?

@tgodzik
Copy link
Contributor

tgodzik commented Apr 28, 2020

Closing this, if there are any issues we can reopen.

@tgodzik tgodzik closed this as completed Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more information Use if we need more information for a specific ticket
Projects
None yet
Development

No branches or pull requests

2 participants