haskell-language-server crashed in wsl: "clock_getres: invalid argument"

Created on 31 Jul 2020  路  8Comments  路  Source: haskell/haskell-language-server

I am getting

The Haskell (haskell) server crashed 5 times in the last 3 minutes. The server will not be restarted.

on a Windows Linux Subsystem (VERSION="18.04.2 LTS (Bionic Beaver)"). The log is as follows

[client] run command: "/home/shangyit/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.2.2-linux-8.8.4 --lsp"
[client] debug command: "/home/shangyit/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.2.2-linux-8.8.4 --lsp"
[client] server cwd: undefined
haskell-language-server version: 0.2.2.0 (GHC: 8.8.4) (PATH: /home/shangyit/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.2.2-linux-8.8.4) (GIT hash: e44f618c11b7978264a94beeee00d1f014867f6d)
Starting (haskell-language-server)LSP server...
  with arguments: LspArguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
  in directory: /home/shangyit/haskell
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 haskell-language-server-0.2.2-linux-8.8.4: clock_getres: invalid argument (Invalid argument)
[Info  - 4:18:43 PM] Connection to server got closed. Server will restart.
haskell-language-server version: 0.2.2.0 (GHC: 8.8.4) (PATH: /home/shangyit/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.2.2-linux-8.8.4) (GIT hash: e44f618c11b7978264a94beeee00d1f014867f6d)
Starting (haskell-language-server)LSP server...
  with arguments: LspArguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
  in directory: /home/shangyit/haskell
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 haskell-language-server-0.2.2-linux-8.8.4: clock_getres: invalid argument (Invalid argument)
[Info  - 4:18:43 PM] Connection to server got closed. Server will restart.
haskell-language-server version: 0.2.2.0 (GHC: 8.8.4) (PATH: /home/shangyit/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.2.2-linux-8.8.4) (GIT hash: e44f618c11b7978264a94beeee00d1f014867f6d)
Starting (haskell-language-server)LSP server...
  with arguments: LspArguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
  in directory: /home/shangyit/haskell
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 haskell-language-server-0.2.2-linux-8.8.4: clock_getres: invalid argument (Invalid argument)
......

Any help is appreciated, thanks!

windows bug

Most helpful comment

Seems to be a general issue with haskell + WSL, another example here: https://discourse.nixos.org/t/how-to-disable-running-tests-when-building-home-manager-module/6792

All 8 comments

maybe the generic linux binaries does not work well in wsl, could you tried a installation from source to check if the error is reproduced?

maybe the generic linux binaries does not work well in wsl, could you tried a installation from source to check if the error is reproduced?

I installed it manually using

./cabal-hls-install hls-8.8.4
./cabal-hls-install data

and encountered the same issue.

shangyit@Isaac-OMEN:~/.cabal/bin$ ./haskell-language-server-8.8.4 --lsp
haskell-language-server version: 0.2.2.0 (GHC: 8.8.4) (PATH: /home/shangyit/.cabal/bin/haskell-language-server-8.8.4)
Starting (haskell-language-server)LSP server...
  with arguments: LspArguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = False, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "eval",PluginId "floskell",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "stylish-haskell"]
  in directory: /home/shangyit/.cabal/bin
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 haskell-language-server-8.8.4: clock_getres: invalid argument (Invalid argument)

Seems to be a general issue with haskell + WSL, another example here: https://discourse.nixos.org/t/how-to-disable-running-tests-when-building-home-manager-module/6792

I think it is likely this issue https://github.com/microsoft/WSL/issues/4898.

So it seems we can not do much here.

@1Computer1 https://github.com/microsoft/WSL/issues/4898 seems to be closed, is this reproduced with a newer version of wsl?

@Shangyint i am gonna close it optimistically as the issue that seems fix the issue is closed, feel free to reopen if that is not the case

Was this page helpful?
0 / 5 - 0 ratings