Skip to content
This repository was archived by the owner on Jan 8, 2022. It is now read-only.

Silently crashes but keeps the VM running on stable SDK #20

Closed
PangPangPangPangPang opened this issue Jan 2, 2018 · 11 comments
Closed

Comments

@PangPangPangPangPang
Copy link

Thx for your work.
It works fine with my mac,but I get a 'timeout' error in my Manjaro desktop.
The followings are the log throwed by LanguageClient-neovim.

2018-01-02T22:49:37.738955633+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 17, "jsonrpc": "2.0", "method": "languageClient/startServer", "params": {"cmdargs": [], "languageId": "dart", "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(ErrorMessage { msg: "Language client has already started for language dart." })
2018-01-02T22:50:18.000177297+08:00 WARN languageclient::languageclient - timed out waiting on channel
2018-01-02T22:50:18.931421363+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 1, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 6, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:19.082985606+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 2, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 6, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:19.225805287+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 3, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 6, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:19.906160190+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 4, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:20.050025580+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 5, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:20.194509349+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 6, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:20.330020405+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 7, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 2, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:21.899436921+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 8, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 8, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:22.051085845+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 9, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 8, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:22.210625306+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 10, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 25, "handle": true, "languageId": "dart", "line": 8, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:23.370028077+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 11, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 40, "handle": true, "languageId": "dart", "line": 8, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:23.521750794+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 12, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 40, "handle": true, "languageId": "dart", "line": 8, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:23.666274836+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 13, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 40, "handle": true, "languageId": "dart", "line": 8, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:24.834615024+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 14, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 40, "handle": true, "languageId": "dart", "line": 11, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:24.978162073+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 15, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 40, "handle": true, "languageId": "dart", "line": 11, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)
2018-01-02T22:50:25.139964124+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 16, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 40, "handle": true, "languageId": "dart", "line": 11, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/detail.dart"}}. Error: Err(Timeout)

@natebosch
Copy link
Owner

"method": "languageClient/startServer"

That's not a request that should be sent to the language server. Looks like something within neovim or the plugin? I'm guessing some kind of client/server architecture within the editor.

timed out waiting on channel

Not sure what kind of timeout would exist, is this timing out while trying to start the process maybe? You might want to ask for help from the plugin authors narrowing in on the error as it relates to the dart_language_server process. This looks like mostly stuff internal to the plugin to me.

Some stuff you can do to verify outside of the plugin:

  • Can you run dart_lang_server from the command line outside of your editor? You should see it sit and wait for input without printing anything if it's working correctly.
  • Assuming you can run it and it waits for input, can you try piping in this file and make sure that you get a JSON response about an error that it doesn't see that URI?

I know that I've had problems in the past where if I change my Dart SDK I need to pub global activate this package again...

@PangPangPangPangPang
Copy link
Author

PangPangPangPangPang commented Jan 3, 2018

Sorry for reply so late.

"method": "languageClient/startServer"

This is thrown by LanguageClient-neovim,because I start client service twice.

I try to run dart_lang_server from CLI but it seems that terminal hang up whatever I input.

@natebosch
Copy link
Owner

If it appears to hang it's probably working correctly. It waits until it sees input in the right format before sending any output.

If you download this file and run the server like dart_language_server < initialization_input you should see it respond with an error (it's a valid format for a method, but not a good value for initialization)

Taking another look at the errors I see that the timeout is regarding a call with a sensible method: 'textDocument/definition' - but the arguments don't match the language server protocol. I think this timeout is communicating with some neovim or plugin specific server. It does not look to me like a timeout communicating with dart_language_server.

Perhaps you can ask for help from the plugin authors with getting more information here on whether and how something with dart_language_server is impacting this scenario?

@PangPangPangPangPang
Copy link
Author

I tried to run dart_language_server < initialization_input but terminal hang up as before.
6461fab0171c64964ad82aa0d8fe1766

It is strange because other language protocal servers work fine in my pc.

@natebosch
Copy link
Owner

Interesting.

Next things to check:

  • Are you on the latest version? (What does pub global list say?)
  • Which Dart SDK version are you using? Is it the same version that you had when you did the pub global activate?
  • Can you try dart_language_server -- --port 9000 and then open localhost:9000 in your browser? What does the status page say?

@PangPangPangPangPang
Copy link
Author

  • Are you on the latest version? (What does pub global list say?)

dart_language_server 0.1.4

  • Which Dart SDK version are you using? Is it the same version that you had when you did the pub global activate?

Dart VM version: 1.24.3 (Wed Dec 13 23:26:59 2017) on "macos_x64"
I reinstall dart_language_server. Can it confirm that it is the same version?

  • Can you try dart_language_server -- --port 9000 and then open localhost:9000 in your browser? What does the status page say?

9baf335ce970e808b773211506085c56

@natebosch
Copy link
Owner

Ah, bitten by dart-lang/sdk#30761

I am able to repro this on the 1.24.3 SDK. I probably made a mistake claiming to support the 1.24 SDK since I'm using the new function syntax (which should work but doesn't).

I will need some changes in message_builder and then update all the places where I use the new syntax.

note to self - when diagnosing issues remember to check /tmp/lsp-error.log since it was obvious once I remembered to look there.

@natebosch natebosch changed the title Error: Err(Timeout) Silently crashes but keeps the VM running on stable SDK Jan 9, 2018
@natebosch
Copy link
Owner

@PangPangPangPangPang - I was able to get this running with the 1.24.3 SDK using version 0.1.5+1

Can you please pub global activate once more and let me know if this is also working for you?

@PangPangPangPangPang
Copy link
Author

Hello, I updated dart_language_server to 0.1.5+ and got this log.

2018-01-10T08:29:04.855682374+08:00 WARN languageclient::languageclient - The method 'containsKey' was called on null.
Receiver: null
Tried calling: containsKey("dynamicRegistration")
2018-01-10T08:29:14.515869107+08:00 ERROR languageclient::languageclient - Error handling message. Message: {"id": 1, "jsonrpc": "2.0", "method": "textDocument/definition", "params": {"character": 2, "handle": true, "languageId": "dart", "line": 10, "buftype": "", "filename": "/home/max/v2ex-flutter/lib/main.dart"}}. Error: Err(ErrorMessage { msg: "The server has not been initialized" })

@natebosch
Copy link
Owner

Hmm, it looks like maybe the client you are using is sending {'someKey': null} instead of omitting it which we don't handle correctly. I'm not sure if this should be considered a bug on the client since I think that keys which are optional are supposed to be omitted instead of set as null... but there isn't any reason I can think of not to be flexible on the server side.

I published 0.1.5+2 which I think should handle this.

@PangPangPangPangPang
Copy link
Author

Thx! All the features work fine!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants