vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Using extension in docker devcontainer got stuck downloading haskell language server

Open k3yzerS0ze opened this issue 4 years ago • 19 comments

I am connecting to a haskell docker image but get a message "Downloading haskell-language-server-wrapper". I initially thought it was downloadin but after 24 hours realized something not right.

any ideas? I am able to runhaskell in the terminal

WIndows 10 VSCode 1.62.2

with or without devcontainer.json in my project directory

{ "name" : "haskell", "images" : "haskell", "extensions" : "haskell.haskell" }

k3yzerS0ze avatar Nov 16 '21 12:11 k3yzerS0ze

have you check if you docker container is able to download the prebuilt binary outside the extension, f.e. using curl https://github.com/haskell/haskell-language-server/releases/download/1.4.0/haskell-language-server-wrapper-Linux.gz?

jneira avatar Nov 16 '21 12:11 jneira

actually no... hmm

I get a "you are being redirected"

k3yzerS0ze avatar Nov 16 '21 13:11 k3yzerS0ze

other extensions install fine ...

k3yzerS0ze avatar Nov 16 '21 13:11 k3yzerS0ze

actually no... hmm

I get a "you are being redirected"

hmm i see, use curl -L https://github.com/haskell/haskell-language-server/releases/download/1.4.0/haskell-language-server-wrapper-Linux.gz

jneira avatar Nov 16 '21 13:11 jneira

other extensions install fine ...

do you know if any of they are doing http calls as part of the setup process?

jneira avatar Nov 16 '21 13:11 jneira

other extensions install fine ...

do you know if any of they are doing http calls as part of the setup process?

not sure but have the following;

  1. Haskell Syntax Highlighting
  2. Code Runner v0.11.6

by the way tried on haskell:9.0.1 and haskell:8.10 with same issue

k3yzerS0ze avatar Nov 16 '21 13:11 k3yzerS0ze

actually no... hmm I get a "you are being redirected"

hmm i see, use curl -L https://github.com/haskell/haskell-language-server/releases/download/1.4.0/haskell-language-server-wrapper-Linux.gz

tried curl -L but for Windows, correct?

curl -L https://github.com/haskell/haskell-language-server/releases/download/1.4.0/haskell-language-server-wrapper-Windows.exe.zip

curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.

k3yzerS0ze avatar Nov 16 '21 15:11 k3yzerS0ze

not sure why but getting this now...

curl -L https://github.com/haskell/haskell-language-server/releases/download/1.4.0/haskell-language-server-wrapper-Windows.exe.zip

Warning: Binary output can mess up your terminal. Use "--output -" to tell Warning: curl to output it to your terminal anyway, or consider "--output Warning: <FILE>" to save to a file.

k3yzerS0ze avatar Nov 16 '21 15:11 k3yzerS0ze

tried curl -L but for Windows, correct?

Ii assumed you were running linux inside the docker image, does not images: haskell refers to https://github.com/microsoft/vscode-dev-containers/tree/main/containers/haskell? that one is running linux

not sure why but getting this now...

If you get that warning is it has reached the url. So the extension should be able to download it. Could collect the logs as described here: https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems and post them?

jneira avatar Nov 16 '21 18:11 jneira

results of logs...

[client][INFO] Searching for server executables haskell-language-server-wrapper,haskell-language-server in $PATH [client][INFO] Downloading haskell-language-server [client][INFO] Fetching the latest release from GitHub or from cache [client][INFO] The latest release is 1.4.0 [client][INFO] Figure out the ghc version to use or advertise an installation link for missing components [client][INFO] Working out the project GHC version. This might take a while...

k3yzerS0ze avatar Nov 16 '21 19:11 k3yzerS0ze

Hmm it should take a while but terminate 😄

I dont have a devcontainer setup at hand to try to reproduce, sorry. However i would try to have the project prebuilt through the shell (with cabal or stack) before opening it in vscode. Trying to build it may help to discover the cause of the hang (as the extension has to trigger a build to get the ghc version of the project)

jneira avatar Nov 16 '21 20:11 jneira

tried on linux with no issue. I am closing as I suspect something funny on my work laptop.

k3yzerS0ze avatar Nov 17 '21 06:11 k3yzerS0ze

tried on linux with no issue. I am closing as I suspect something funny on my work laptop.

Nice! Happy to see the devcontainer setup works, at least in some envs. Will try to setup a devcontainer env in my windows laptop to check it works.

jneira avatar Nov 17 '21 07:11 jneira

@jneira I am attaching to the haskell container but as root. How do I do so as non-root?

hoosainmadhi avatar Nov 17 '21 08:11 hoosainmadhi

@jneira I am attaching to the haskell container but as root. How do I do so as non-root?

sorry cant help much with devcontainers until i get an env to try it, maybe @k3yzerS0ze will know how?

jneira avatar Nov 17 '21 08:11 jneira

after installing ghc 8.10.7 using choco on my local Windows 10 I am getting the similar issue as the docker...

i get the following msg: Downloading haskell-language-server 1.5.0 for GHC 8.10.7 nothing downloads

k3yzerS0ze avatar Nov 18 '21 13:11 k3yzerS0ze

never mind ... rebooted and all working as expected.

k3yzerS0ze avatar Nov 18 '21 13:11 k3yzerS0ze

hmm just i tried in my windows machine and it worked :sweat_smile:

jneira avatar Nov 18 '21 13:11 jneira

so this still leaves us with the docker image issue... I initially suspected something funny on my work laptop that prevented me from downloading (firewalls etc) ... Hmm

going to leave open until someone proof otherwise.

k3yzerS0ze avatar Nov 18 '21 13:11 k3yzerS0ze