Description
Subject of the issue
I was having some issues with HLS so I enabled logging for the haskell 1.1 vscode extension as follows:
After restarting vscode I started getting "The Haskell (backend) server crashed 5 times in the last 3 minutes. The server will not be restarted." errors.
It was quite a ride before I found the vscode log file with details 😆
$ cat .config/Code/logs/20201002T141614/exthost1/output_logging_20201002T141619/5-Haskell\ \(backend\).log
...
Consulting the cradle to get project GHC version...
Project GHC version: 8.8.3
haskell-language-server exe candidates: ["haskell-language-server-8.8.3","haskell-language-server-8.8","haskell-language-server"]
Launching haskell-language-server exe at:/home/jhrcek/.local/bin/haskell-language-server-8.8.3
haskell-language-server version: 0.4.0.0 (GHC: 8.8.3) (PATH: /home/jhrcek/.local/bin/haskell-language-server-8.8.3) (GIT hash: 5729c2ea119e9d48c136cc75c377d41fec811dde)
haskell-language-server-8.8.3: ~/hls.log: openFile: does not exist (No such file or directory)
haskell-language-server-wrapper: callProcess: /home/jhrcek/.local/bin/haskell-language-server-8.8.3 "--lsp" "-d" "-l" "~/hls.log" (exit 1): failed
[Info - 2:16:20 PM] Connection to server got closed. Server will restart.
Your environment
-
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
haskell-language-server version: 0.4.0.0 (GHC: 8.8.3) (PATH: /home/jhrcek/.local/bin/haskell-language-server) (GIT hash: 5729c2e)
Tool versions found on the $PATH
cabal: 3.2.0.0
stack: 2.3.3
ghc: 8.8.3 -
Which lsp-client do you use
vscode
Steps to reproduce
In vscode, enter haskell extension settings and type "~/hls.log" as the file log file path
Restart vscode
Expected behaviour
Hls should start fine, maybe with logging disabled, but should definitely not crash.
Actual behaviour
The hls keeps crashing
Include debug information
Execute in the root of your project the command haskell-language-server --debug .
and paste the logs here:
Debug output:
<paste your logs here>
Paste the logs from the lsp-client, e.g. for VS Code
LSP logs:
<paste your logs here>