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

Most upvoted comments

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!