-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to initialize terraform-ls with error : session is not ready to be initalized. State: initialized (confirmed) #1041
Comments
@jk563 It appears that the Were you able to reproduce this reliably? If so, then unless it's a misconfiguration error (which seems unlikely in this case) I would recommend raising it with the maintainer(s) of that vim client integration. |
It'll reliably give that error on every enter->exit of insert mode. However, even if I don't drop in and out of insert mode, I still get:
on startup and I can't do things such as going to a definition of a resource. Not sure if that's likely the same issue or if the multiple initialization attempts are a red herring? |
Popped up in an error message I received in hashicorp#1041, thought it worth a quick PR to fix.
Ah, that is something I missed - thank you for pointing it out - there may still be a bug on the server side, then. 🤔 I think we'd need to add some debug log statements around here https://github.com/hashicorp/terraform-ls/blob/main/internal/langserver/handlers/initialize.go to get to the bottom of it. I will try to reproduce it myself with vim-lsp. Thanks for the report and patience. |
Let me know if I can help further / if you want more details on my setup. Thanks for looking in to this. |
I managed to reproduce this. It has to do with the
which the Go JSON decoder attempts to decode into https://github.com/golang/tools/blob/587a15310bddfc939d37cfaa8be8ea4c3808c3f1/internal/lsp/protocol/tsprotocol.go#L5214-L5224 i.e. boolean into struct. The LSP spec defines The corresponding server capability can be I'm assuming the easiest fix would be for For context, this was essentially triggered by #947 which added the corresponding capability representation. vim-lsp seemed to have supported this capability for some time now, according to git log pointing to prabirshrestha/vim-lsp#641 |
I have proposed the mentioned fix upstream in prabirshrestha/vim-lsp#1350 |
I would also say that |
Thanks for the effort of replicating, figuring this out, writing it up in great detail, and proposing the upstream fix. Really appreciate this. Thank you. |
I have filed prabirshrestha/vim-lsp#1351 upstream to capture the retry problem. Thanks for the report. |
After a moment of disappointment before realising I'd pinned the Thanks again for resolving this, and for the speed of resolution. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Apologies in advance, I'm guessing this is a user error (possibly related to the vim-lsp config or recent breaking changes?) but I'm not quite sure what else to try. This had been working for me but I've tried a few versions of the plugin and the issue persists. Other LSes set up still work, so I'm not sure why this one isn't.
Server Version
Terraform Version
Client Version
vim-lsp config for terraform-ls:
Terraform Configuration Files
Anything
Log Output
On startup we get the first error message:
This line ppears after entering and exiting Insert mode:
Full log:
Expected Behavior
I should be able to go to definitions, autocomplete attributes on resources, and generally use terraform-ls
Actual Behavior
It appears that the LS doesn't successfully start.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: