Skip to content

Request textDocument/codeAction failed: "Connection to server got closed." #376

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
cebaa opened this issue Sep 3, 2020 · 15 comments
Closed
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@cebaa
Copy link

cebaa commented Sep 3, 2020

Getting this when starting a language server (this is the last one after which it gives up retrying):

2020-09-03 17:13:28.231839743 [ThreadId 355] - Making new HscEnv[main,main]
[Error - 5:13:28 PM] Connection to server got closed. Server will not be restarted.
[Error - 5:13:28 PM] Request textDocument/codeLens failed.
Error: Connection got disposed.
        at Object.dispose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:90914)
        at Object.dispose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:74187)
        at D.handleConnectionClosed (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:74361)
        at D.handleConnectionClosed (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:247:9181)
        at t (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:72512)
        at n.invoke (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233173)
        at i.fire (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233903)
        at G (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:82823)
        at n.invoke (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233173)
        at i.fire (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233903)
        at u.fireClose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:252636)
        at Socket.<anonymous> (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:253393)
        at Socket.emit (events.js:205:15)
        at Pipe.<anonymous> (net.js:586:12)
[Error - 5:13:28 PM] Request textDocument/codeAction failed.
Error: Connection got disposed.
        at Object.dispose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:90914)
        at Object.dispose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:74187)
        at D.handleConnectionClosed (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:74361)
        at D.handleConnectionClosed (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:247:9181)
        at t (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:72512)
        at n.invoke (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233173)
        at i.fire (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233903)
        at G (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:82823)
        at n.invoke (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233173)
        at i.fire (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:233903)
        at u.fireClose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:252636)
        at Socket.<anonymous> (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:253393)
        at Socket.emit (events.js:205:15)
        at Pipe.<anonymous> (net.js:586:12)

HLS

haskell-language-server version: 0.3.0.0 (GHC: 8.8.4) (PATH: /home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.3.0-linux-8.8.4) (GIT hash: d36bb9929fdd0df76f86d3635067400272f68497)

GHC

/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc

Stack

Version 2.3.3, Git revision cb44d51bed48b723a5deb08c3348c0b3ccfc437e x86_64 hpack-0.33.0

I'm not sure what other information I can collect to help troubleshooting this, let me know.

@jneira jneira transferred this issue from haskell/vscode-haskell Sep 4, 2020
@jneira
Copy link
Member

jneira commented Sep 4, 2020

Hi! could you attach the full log of the vscode session? It seems the error is thrown just after creating a ghc session, stack build/repl works for the files you are opening in the editor?

@jneira jneira added the type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. label Sep 4, 2020
@jneira jneira changed the title Request textDocument/codeAction failed. Request textDocument/codeAction failed: "Connection to server got closed." Sep 4, 2020
@jneira
Copy link
Member

jneira commented Sep 4, 2020

That said, the server should not crash without. at least, sending a message to the client

@fendor
Copy link
Collaborator

fendor commented Sep 4, 2020

At a first glance, it reminds me of #366, because of the line

2020-09-03 17:13:28.231839743 [ThreadId 355] - Making new HscEnv[main,main]

Can you tell us something about the project? Is it a stack project, and could explain what you did to trigger this error? (e.g. open src/Lib.hs and waited)

@pepeiborra
Copy link
Collaborator

Agreed, this looks like a cradle issue

@cebaa
Copy link
Author

cebaa commented Sep 4, 2020

@jneira

Hi! could you attach the full log of the vscode session?

Sure:

[client] run command: "/home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-linux-8.8.4 --lsp"
[client] debug command: "/home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-linux-8.8.4 --lsp"
[client] server cwd: undefined
haskell-language-server version: 0.4.0.0 (GHC: 8.8.4) (PATH: /home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-linux-8.8.4) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
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 "brittany",PluginId "eval",PluginId "floskell",PluginId "fourmolu",PluginId "ghcide",PluginId "importLens",PluginId "ormolu",PluginId "pragmas",PluginId "retrie",PluginId "stylish-haskell"]
  in directory: /home/cebaa/haskell/test
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.00s
2020-09-04 10:04:45.434497568 [ThreadId 17] - Opened text document: file:///home/cebaa/haskell/test/src/Run.hs
2020-09-04 10:04:45.435828518 [ThreadId 50] - Data.HashMap.Internal.(!): key not found
CallStack (from HasCallStack):
  error, called at ./Data/HashMap/Internal.hs:753:16 in unordered-containers-0.2.12.0-2e3fe165d2481c3a755449eca3083a286519fe98ac20523b8f479e0645004f51:Data.HashMap.Internal
  !, called at src/Development/IDE/Import/DependencyInformation.hs:107:40 in ghcide-0.2.0-inplace:Development.IDE.Import.DependencyInformation
2020-09-04 10:04:45.438292 [ThreadId 53] - Consulting the cradle for "/home/cebaa/haskell/test/src/Run.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/cebaa/haskell/test", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `test' component test:exe:test-exe with main-is file: /home/cebaa/haskell/test/app/Main.hs
> Building all executables for `test' once. After a successful build of all of them, only specified executables will be rebuilt.
> test> configure (lib + exe)
> Configuring test-0.1.0.0...
> /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
> /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
> /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
> test> initial-build-steps (lib + exe)
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: test
> /home/cebaa/haskell/test/.stack-work/install/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/pkgdb:/home/cebaa/.stack/snapshots/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/pkgdb:/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/package.conf.d
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
2020-09-04 10:04:49.815000124 [ThreadId 53] - Using interface files cache dir: /home/cebaa/.cache/ghcide/main-86a866fdb305f423815ae36bdecd2ca00eb660e1
2020-09-04 10:04:49.815559545 [ThreadId 53] - Making new HscEnv[main]
2020-09-04 10:04:49.89678013 [ThreadId 133] - Plugin.makeCodeLens (ideLogger)
2020-09-04 10:04:49.957892484 [ThreadId 341] - Consulting the cradle for "/home/cebaa/haskell/test/.stack-work/dist/x86_64-linux/Cabal-3.0.1.0/build/autogen/Paths_test.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/cebaa/haskell/test", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `test' component test:exe:test-exe with main-is file: /home/cebaa/haskell/test/app/Main.hs
> Building all executables for `test' once. After a successful build of all of them, only specified executables will be rebuilt.
> test> configure (lib + exe)
> Configuring test-0.1.0.0...
> /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
> /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
> /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
> test> initial-build-steps (lib + exe)
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: test
> /home/cebaa/haskell/test/.stack-work/install/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/pkgdb:/home/cebaa/.stack/snapshots/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/pkgdb:/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/package.conf.d
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
2020-09-04 10:04:54.932229239 [ThreadId 341] - Using interface files cache dir: /home/cebaa/.cache/ghcide/main-86a866fdb305f423815ae36bdecd2ca00eb660e1
2020-09-04 10:04:54.93260945 [ThreadId 341] - Using interface files cache dir: /home/cebaa/.cache/ghcide/main-86a866fdb305f423815ae36bdecd2ca00eb660e1
2020-09-04 10:04:54.932765125 [ThreadId 341] - Making new HscEnv[main,main]
[Error - 10:04:55 AM] Request textDocument/codeLens failed.
Error: Connection got disposed.
	at Object.dispose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:90914)
	at Object.dispose (/home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:74187)
	at /home/cebaa/.vscode-server/extensions/haskell.haskell-1.1.0/dist/extension.js:1:70802
... up to 5 blocks with the same output ....

stack build/repl works for the files you are opening in the editor?

Yeah, stack build on the project works fine from the command line:

$ stack build
Building all executables for `test' once. After a successful build of all of them, only specified executables will be rebuilt.
test> configure (lib + exe)
Configuring test-0.1.0.0...
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
test> build (lib + exe)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
Preprocessing library for test-0.1.0.0..
Building library for test-0.1.0.0..
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
[1 of 5] Compiling Paths_test
[2 of 5] Compiling Types
[3 of 5] Compiling Import
[4 of 5] Compiling Run
[5 of 5] Compiling Util
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc-pkg: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
Preprocessing executable 'test-exe' for test-0.1.0.0..
Building executable 'test-exe' for test-0.1.0.0..
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
[1 of 2] Compiling Paths_test
[2 of 2] Compiling Main
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
Linking .stack-work/dist/x86_64-linux/Cabal-3.0.1.0/build/test-exe/test-exe ...
test> copy/register
Installing library in /home/cebaa/haskell/test/.stack-work/install/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/lib/x86_64-linux-ghc-8.8.4/test-0.1.0.0-BqR1a4pW5zLGRh1eWc0hcU
Installing executable test-exe in /home/cebaa/haskell/test/.stack-work/install/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/bin
Registering library for test-0.1.0.0..

@fendor

Is it a stack project,

Yeah, created using stack new test rio.

could explain what you did to trigger this error? (e.g. open src/Lib.hs and waited)

I opened src/Run.hs and triggered Haskell: Restart Haskell LSP server via Ctrl+Shift+P.

Let me know if you need more information.

@runeksvendsen
Copy link
Contributor

runeksvendsen commented Sep 5, 2020

Please post the output of running the following command from the project root directory.

/home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-linux-8.8.4 --debug src/

I'm seeing the same error in my VSCode log. Running the above command ends with a segfault for me.

@runeksvendsen
Copy link
Contributor

runeksvendsen commented Sep 5, 2020

I'm able to reproduce this behaviour as follows.

stack new test-yesod yesodweb/postgres
cd test-yesod
stack test --no-run-tests
code .

Navigate to e.g. src/Foundation.hs.

Executing HLS with --debug on src/ results in a segfault:

$ /Users/runesvendsen/Library/Application\ Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-darwin-8.8.4 --debug src/
haskell-language-server version: 0.4.0.0 (GHC: 8.8.4) (PATH: /Users/runesvendsen/Library/Application Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-darwin-8.8.4) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
(haskell-language-server)Ghcide setup tester in /Users/runesvendsen/code/test-yesod.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Tool versions found on the $PATH
cabal:		2.4.1.0
stack:		2.3.3
ghc:		8.6.5


Step 1/4: Finding files to test in /Users/runesvendsen/code/test-yesod
Found 11 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "/Users/runesvendsen/code/test-yesod/src/Handler/Comment.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/Users/runesvendsen/code/test-yesod", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `test-yesod' component test-yesod:exe:test-yesod with main-is file: /Users/runesvendsen/code/test-yesod/app/main.hs
> The following GHC options are incompatible with GHCi and have not been passed to it: -O2 -threaded
> Configuring GHCi with the following packages: test-yesod
> /Users/runesvendsen/code/test-yesod/.stack-work/install/x86_64-osx/50146911e425358752f0d840a75b0736163e705e884f28d26d365a09dff921d0/8.8.4/pkgdb:/Users/runesvendsen/.stack/snapshots/x86_64-osx/50146911e425358752f0d840a75b0736163e705e884f28d26d365a09dff921d0/8.8.4/pkgdb:/Users/runesvendsen/.stack/programs/x86_64-osx/ghc-8.8.4/lib/ghc-8.8.4/package.conf.d
[INFO] Using interface files cache dir: /Users/runesvendsen/.cache/ghcide/main-6cf87290a0282aa3f9e1e47fafcf04b73fd00d07
[INFO] Making new HscEnv[main]
zsh: segmentation fault   --debug src/

@runeksvendsen
Copy link
Contributor

Please post the output of running the following command from the project root directory.

/home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-linux-8.8.4 --debug src/

I'm seeing the same error in my VSCode log. Running the above command ends with a segfault for me.

@cebaa could I get you to try the above, in order to determine whether we're experiencing the same issue?

@cebaa
Copy link
Author

cebaa commented Sep 21, 2020

@runeksvendsen

Sorry for a delay, here's the output:

haskell-language-server version: 0.4.0.0 (GHC: 8.8.4) (PATH: /home/cebaa/.vscode-server/data/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-linux-8.8.4) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
(haskell-language-server)Ghcide setup tester in /home/cebaa/haskell/test.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Tool versions found on the $PATH
cabal:    Not found
stack:    2.3.3
ghc:    Not found


Step 1/4: Finding files to test in /home/cebaa/haskell/test
Found 4 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "/home/cebaa/haskell/test/src/Import.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/cebaa/haskell/test", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `test' component test:exe:test-exe with main-is file: /home/cebaa/haskell/test/app/Main.hs
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: test
> /home/cebaa/haskell/test/.stack-work/install/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/pkgdb:/home/cebaa/.stack/snapshots/x86_64-linux/429025e14fb7e3a2b063705a30e09a859301fdd771abc91d4b95d47a7ee2972a/8.8.4/pkgdb:/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/package.conf.d
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../haskeline-0.7.5.0/libHShaskeline-0.7.5.0-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../ghc-8.8.4/libHSghc-8.8.4-ghc8.8.4.so)
/home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/ghc: /lib64/libtinfo.so.5: no version information available (required by /home/cebaa/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.8.4.so)
[INFO] Using interface files cache dir: /home/cebaa/.cache/ghcide/main-86a866fdb305f423815ae36bdecd2ca00eb660e1
[INFO] Making new HscEnv[main]

Completed (4 files worked, 0 files failed)
[INFO] finish: User TypeCheck (took 0.29s)

@vaclavsvejcar
Copy link

I'm having the same issue, can be easily reproduced by just creating new Yesod project using stack new my-project yesodweb/postgres and opening VSCode + HLS for this project. @fendor Is there any workaround for this issue at this moment?

@vst
Copy link

vst commented Nov 2, 2020

In case that it might help as a hint...

I am now experiencing this issue, after I started using Database.PostgreSQL.Simple.SqlQQ#sql QuasiQuoter (from postgresql-simple-0.6.2).

It is back to normal when I avoid using it.

@Rizary
Copy link

Rizary commented Nov 4, 2020

I got the following error also (not "got closed", but "got disposed") here is the log:

[Error - 6:36:50 PM] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
	at Object.dispose (/home/rizary/.vscode-server-insiders/extensions/haskell.haskell-1.2.0/dist/extension.js:1:90902)
	at Object.dispose (/home/rizary/.vscode-server-insiders/extensions/haskell.haskell-1.2.0/dist/extension.js:1:74181)
	at /home/rizary/.vscode-server-insiders/extensions/haskell.haskell-1.2.0/dist/extension.js:1:70796
[Error - 6:36:50 PM] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/home/rizary/.vscode-server-insiders/extensions/haskell.haskell-1.2.0/dist/extension.js:1:90902)
	at Object.dispose (/home/rizary/.vscode-server-insiders/extensions/haskell.haskell-1.2.0/dist/extension.js:1:74181)
	at /home/rizary/.vscode-server-insiders/extensions/haskell.haskell-1.2.0/dist/extension.js:1:70796
Found "/home/rizary/todomvc-nix/backend/haskell/hie.yaml" for "/home/rizary/todomvc-nix/backend/haskell/a"
Module "/home/rizary/todomvc-nix/backend/haskell/a" is loaded by Cradle: Cradle {cradleRootDir = "/home/rizary/todomvc-nix/backend/haskell", cradleOptsProg = CradleAction: Cabal}
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 0.5.0.0 x86_64 ghc-8.8.4
Current directory: /home/rizary/todomvc-nix/backend/haskell
Operating system: linux
Arguments: ["--lsp"]
Cradle directory: /home/rizary/todomvc-nix/backend/haskell
Cradle type: Cabal

Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.8.4


Consulting the cradle to get project GHC version...
Project GHC version: 8.8.4
haskell-language-server exe candidates: ["haskell-language-server-8.8.4","haskell-language-server-8.8","haskell-language-server"]
Launching haskell-language-server exe at:/nix/store/zkkp1v15hmq42zjbahxs3sadrjyvfn3m-todomvc-nix-env/bin/haskell-language-server-8.8.4
haskell-language-server version: 0.5.0.0 (GHC: 8.8.4) (PATH: /nix/store/s41baajzrg4jcpi1g0cvr0gi6qyy3yc0-haskell-language-server-0.5.0.0/bin/haskell-language-server)
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 "brittany",PluginId "eval",PluginId "floskell",PluginId "fourmolu",PluginId "ghcide",PluginId "importLens",PluginId "ormolu",PluginId "pragmas",PluginId "retrie",PluginId "stylish-haskell",PluginId "tactic"]
  in directory: /home/rizary/todomvc-nix/backend/haskell
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
 Started LSP server in 0.00s
2020-11-04 18:36:50.470625 [ThreadId 12] - Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-2581523076146326005) "file:///home/rizary/todomvc-nix",NormalizedUri 1163765457462015083 "file:///home/rizary/todomvc-nix/backend/haskell"], clientSettings = hashed Nothing}
2020-11-04 18:36:50.4743775 [ThreadId 12] - Configuration changed: Object (fromList [("haskell",Object (fromList [("logFile",String ""),("updateBehavior",String "prompt"),("hlintOn",Bool True),("formatOnImportOn",Bool True),("indentationRules",Object (fromList [("enabled",Bool True)])),("liquidOn",Bool False),("languageServerVariant",String "haskell-language-server"),("serverExecutablePath",String ""),("diagnosticsOnChange",Bool True),("completionSnippetsOn",Bool True),("maxNumberOfProblems",Number 100.0),("formattingProvider",String "ormolu"),("trace",Object (fromList [("server",String "messages")]))]))])
2020-11-04 18:36:50.4751281 [ThreadId 12] - Opened text document: file:///home/rizary/todomvc-nix/backend/haskell/src/Api.hs
2020-11-04 18:36:50.4753169 [ThreadId 12] - Opened text document: file:///home/rizary/todomvc-nix/backend/haskell/src/Db.hs
2020-11-04 18:36:50.4755811 [ThreadId 12] - Opened text document: file:///home/rizary/todomvc-nix/backend/haskell/src/Model.hs

@vst I try to remove sqlQQ and QuasiQuoter but still got the error.

@DylanSp
Copy link

DylanSp commented Nov 7, 2020

EDIT: I later narrowed this down to a TH splice. Looks like issue https://github.com/haskell/ghcide/issues/444.

Getting the same issue. When I run the downloaded haskell-language-server-0.5.1-linux-8.8.4 executable with --debug src/, I got a segfault:

haskell-language-server version: 0.5.1.0 (GHC: 8.8.4) (PATH: /home/dylan/.config/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.5.1-linux-8.8.4) (GIT hash: e3fe0e7546aa91e44cc56cfe8ec078a026cf533a)
(haskell-language-server)Ghcide setup tester in /hdd/programming/elm-haskell/fullstack-todomvc/todomvc-backend.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Tool versions found on the $PATH
cabal:          Not found
stack:          2.5.1
ghc:            Not found


Step 1/4: Finding files to test in /hdd/programming/elm-haskell/fullstack-todomvc/todomvc-backend
Found 1 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "src/Lib.hs"
NotShowMessage (NotificationMessage {_jsonrpc = "2.0", _method = WindowShowMessage, _params = ShowMessageParams {_xtype = MtWarning, _message = "No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for src/Lib.hs.\n Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie)"}})
Output from setting up the cradle Cradle {cradleRootDir = "/hdd/programming/elm-haskell/fullstack-todomvc/todomvc-backend", cradleOptsProg = CradleAction: Stack}
> Configuring GHCi with the following packages: todomvc-backend
> /hdd/programming/elm-haskell/fullstack-todomvc/todomvc-backend/.stack-work/install/x86_64-linux/588515d7b1943310c1d35125fc4d7fb6145bc04322c550f7b027065c88c6b87b/8.8.4/pkgdb:/home/dylan/.stack/snapshots/x86_64-linux/588515d7b1943310c1d35125fc4d7fb6145bc04322c550f7b027065c88c6b87b/8.8.4/pkgdb:/home/dylan/.stack/programs/x86_64-linux/ghc-8.8.4/lib/ghc-8.8.4/package.conf.d
[INFO] Using interface files cache dir: /home/dylan/.cache/ghcide/main-cec32ee8ea0b62e77cf6aaf753cd74aeb1884cd2
[INFO] Making new HscEnv[main]
Segmentation  #fault

My project was initialized with stack new todomvc-backend servant.

@DylanSp
Copy link

DylanSp commented Nov 7, 2020

Update: I narrowed down my problem to a Template Haskell splice, so it looks like https://github.com/haskell/ghcide/issues/444 instead of this.

pepeiborra pushed a commit that referenced this issue Dec 27, 2020
* Trailing whitespace makes for unnecessary diffs

* Add trailing newline
@jneira
Copy link
Member

jneira commented Jan 18, 2021

The ghcide issue was moved here as #800.
As it seems the root cause is the same i will close this one, @DylanSp, @vaclavsvejcar, @cebaa feel free to reopen if you think that is not the case

@jneira jneira closed this as completed Jan 18, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

9 participants