regal: Installing OPA - extension server exited
Hi, we are starting to test OPA-Rego at work, and i found in the repo a similar closed issue with regal two weeks ago. OS is a windows 10.
When I add the opa VSCODE extension it installs regal and opa, i added them to the path (both account and system environmental variables)
here is the VSCODE Output from regal
panic: runtime error: index out of range [0] with length 0
goroutine 19 [running]:
github.com/styrainc/regal/pkg/config.FindRegalDirectory({0xc0002b47c1, 0x1d})
/home/runner/work/regal/regal/pkg/config/config.go:138 +0x465
github.com/styrainc/regal/pkg/config.FindConfig({0xc0002b47c1?, 0xc0002d81e0?})
/home/runner/work/regal/regal/pkg/config/config.go:147 +0x1c
github.com/styrainc/regal/internal/lsp.(*LanguageServer).handleInitialize(0xc000096880, {0x140?, 0x15b2220?}, 0xc0002b21e0?, 0xc0002b0ba0)
/home/runner/work/regal/regal/internal/lsp/server.go:1024 +0x517
github.com/styrainc/regal/internal/lsp.(*LanguageServer).Handle(0xc000096880, {0x1b7f1e8, 0xc0000afc20}, 0xc00008ca20, 0xc0002b0ba0)
/home/runner/work/regal/regal/internal/lsp/server.go:102 +0x191
github.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0xc00008aeb0, {0x1b7f1e8, 0xc0000afc20}, 0xc00008ca20, 0xc0002b0ba0)
/home/runner/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.2.0/handler_with_error.go:21 +0x57
github.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0xc00008ca20, {0x1b7f1e8, 0xc0000afc20})
/home/runner/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.2.0/conn.go:205 +0x2dd
created by github.com/sourcegraph/jsonrpc2.NewConn in goroutine 1
/home/runner/go/pkg/mod/github.com/sourcegraph/jsonrpc2@v0.2.0/conn.go:62 +0x1e6
[Error - 10:05:40 AM] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 10:05:40 AM] Connection to server got closed. Server will not be restarted.
[Error - 10:05:40 AM] Regal LSP client client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 10:05:40 AM] Server process exited with code 2.
Here is the VSCODE settings.json from the extensions
"opa.dependency_paths.opa": "C:\\Users\\SE99236\\opa.exe",
"opa.dependency_paths.regal": "C:\\Users\\SE99236\\regal.exe",
"opa.languageServers": [
"regal"
]
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (12 by maintainers)
Commits related to this issue
- Avoid panic when searching for `.regal/config.yaml` As reported in #682, the server panics when the dir for whatever reason is "". I don't yet know how to trigger this, and the result of this fix is ... — committed to StyraInc/regal by anderseknert 3 years ago
- Avoid panic when searching for `.regal/config.yaml` (#684) As reported in #682, the server panics when the dir for whatever reason is "". I don't yet know how to trigger this, and the result of this... — committed to StyraInc/regal by anderseknert 3 years ago
- lsp: URI to path conversions respect os.Separator This was causing an issue in the loading of config files on windows https://github.com/StyraInc/regal/issues/682 Signed-off-by: Charlie Egan <charli... — committed to StyraInc/regal by charlieegan3 3 years ago
- lsp: URI to path conversions respect os.Separator This was causing an issue in the loading of config files on windows https://github.com/StyraInc/regal/issues/682 Signed-off-by: Charlie Egan <charli... — committed to StyraInc/regal by charlieegan3 3 years ago
- lsp: URI to path conversions respect os.Separator (#703) This was causing an issue in the loading of config files on windows https://github.com/StyraInc/regal/issues/682 Signed-off-by: Charlie Ega... — committed to StyraInc/regal by charlieegan3 3 years ago
- Avoid panic when searching for `.regal/config.yaml` (#684) As reported in #682, the server panics when the dir for whatever reason is "". I don't yet know how to trigger this, and the result of this... — committed to srenatus/regal by anderseknert 3 years ago
- lsp: URI to path conversions respect os.Separator (#703) This was causing an issue in the loading of config files on windows https://github.com/StyraInc/regal/issues/682 Signed-off-by: Charlie Ega... — committed to srenatus/regal by charlieegan3 3 years ago
I was setting it up but seems like the problems tab started working finally. (very new with OPA-Rego)
Thank you so much I do guess (if in a few days i dont drop by this bug is for real solved)
Thank you 😃
No way, I’m on the playground 😅
That’s fine. We don’t support that method yet, so we log that when we receive a request for that. It shouldn’t have any impact on server operations though. Are things working? But config file ignored?
Lol, alright! I’ll need a reviewer anyway, so let’s push it out tomorrow.
No, no admin permissions needed 🙂 Thank you for all the details provided! I’m still not sure what would cause this, and I don’t have a windows machine at hand, but I’ll try my best to see if I can reproduce this in some way. I’ll keep you posted!