-
Notifications
You must be signed in to change notification settings - Fork 34
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
Installing OPA - extension server exited #682
Comments
Hi there @scoop96! And thanks for filing an issue, although I obviously wish you didn't have to 🙂 The trace you provided (thanks for that too!) suggests the issue is encountered when Regal traverses your directory tree looking for a config file: // Move up one level in the directory tree
parts := strings.Split(dir, rio.PathSeparator)
parts = parts[:len(parts)-1] // <-- referencing index 0 in an empty slice here which causes the panic I'm not sure why this would happen, but at least it's obvious where it happens. The docs for
The second argument here comes from In the meantime, do you have a Regal config file in your project workspace? I suppose that if Regal finds one, it won't keep searching, which could be a workaround in the meantime. Just create a Let me know if that helps work around the issue for the time being. |
Btw, @scoop96, what does the path to your workspace look like? Just curious if there's anything in that (like special characters, whitespace, etc) that could cause issues here. |
First i started without config file, after so i added a config file (default one as indicated here in de official doc) Im adding it again by default, allow me to clean something and I'll show you the workspace directory |
Did adding a config file help stop the server from crashing? Just to clarify, I don't need to know what your workspace looks like, only what the path to the workspace looks like. I.e. something like |
In my OS, we need to ask for a superior team to give us admin permissions. Does the OPA extension need them? in order to do that configuration manually myself. Cybersecurity things :) |
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! |
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 likely that the config file won't be found when this happens. But as a temporary measure I prefer to have Regal run with default configuration compared to crashing. Signed-off-by: Anders Eknert <anders@styra.com>
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 likely that the config file won't be found when this happens. But as a temporary measure I prefer to have Regal run with default configuration compared to crashing. Signed-off-by: Anders Eknert <anders@styra.com>
After the commit, i updated the .exe and the issue still on, same thing. |
Did you build Regal yourself? If not, you'll have to get the v0.21.2 release from here: https://github.com/StyraInc/regal/releases/tag/v0.21.2 |
The first download was wrong, after using the v0.21.2 the error still on, that is odd am i right? In the new error the comment
|
Hmm yeah. I'll need a Windows machine to test this on. I'll get back to you when I have that! |
The added check wasn't enough. We'd need to error out if the length is not greater than 1. It's len=1 here, then we drop a segment, it's empty, and accessing the first element panicks... |
@srenatus yep, that's what we get for patching without being able to test properly, I suppose 🤦 Do you have time to submit a fix? I'm in meetings for the next 2 hours. I'll get another patch release out later tonight. |
No way, I'm on the playground 😅 |
Lol, alright! I'll need a reviewer anyway, so let's push it out tomorrow. |
@scoop96 can you try v0.21.3? It'll likely won't find your config (but if it does, let me know!) but at least it shouldn't panic. |
@anderseknert This is the new error output:
|
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? |
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 :) |
This was causing an issue in the loading of config files on windows #682 Signed-off-by: Charlie Egan <charlie@styra.com>
This was causing an issue in the loading of config files on windows #682 Signed-off-by: Charlie Egan <charlie@styra.com>
This was causing an issue in the loading of config files on windows #682 Signed-off-by: Charlie Egan <charlie@styra.com>
As reported in StyraInc#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 likely that the config file won't be found when this happens. But as a temporary measure I prefer to have Regal run with default configuration compared to crashing. Signed-off-by: Anders Eknert <anders@styra.com>
This was causing an issue in the loading of config files on windows StyraInc#682 Signed-off-by: Charlie Egan <charlie@styra.com>
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
Here is the VSCODE settings.json from the extensions
The text was updated successfully, but these errors were encountered: