Open egh opened 4 months ago
Hi,
Thanks for your report. Based on the error message, it seems that it received unexpected data from dbt-language-server (cannot parse as json-rpc header).
It would help a lot if you can post the output of the language server here. You may do it in this way:
dbt-language-server-wrapper.sh
script in your $PATH (and remember to make it executable), with the following content:#!/bin/bash
exec dbt-language-server "$@" < <(tee -a /tmp/dbt.stdin.txt) > >(tee -a /tmp/dbt.stdout.txt)
dbt-language-server-wrapper.sh
instead of dbt-language-server
emacs-lsp-booster
. Then you should find the input and output data to/from the language server in /tmp/dbt.stdin.txt and /tmp/dbt.stdout.txt respectively.(I tried to reproduce this locally but unfortunately cannot get dbt-language-server working (constantly getting an "invalid_type" type error...).. )
Thanks @blahgeek ! Here is my emacs setup for dbt:
https://github.com/fivetran/dbt-language-server/issues/1426#issuecomment-2130470832
I can send you those files, but they contain some semi-private information. Can I email you? My email is on my profile.
I can now successfully run dbt-language-server based on your configuration, without any issues you mentioned :)
So I think I need your input/output contents to debug. I sent you an email.
Hi @egh ,
At the end of your dbt.output.txt
there are the following lines:
{"jsonrpc":"2.0","id":3,"result":[]}Running server on localhost:40109...
Server listening on localhost:40109
These "Running server on ..." lines are the ones that causes the issue. The dbt language server should not output these contents to stdout according to lsp spec (it should only contains "Content-Length: xxx" followed by json objects).
So I think maybe you should report to dbt-language-server project about this bug. (Though as I said, I personally cannot reproduce this, so I'm not sure why or when it happens)
On the other hand, emacs-lsp-booster could try to tolerate this kind of error and try to recover. I think that's how lsp-mode itself does, which explains why you don't have this issue without emacs-lsp-booster enabled. I will do this later.
Hi @blahgeek ,
Thank you so much for looking into this! I will file an upstream bug.
Hi,
I'm trying this out with https://github.com/fivetran/dbt-language-server but I'm getting the following error. If I disable
emacs-lsp-booster
things work fine. Let me know what info I can provide. Thanks!