You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using opa against a non existent rego files returns with an error message on STDOUT and errcode 2.
I would think such an error really should be sent to STDERR. We struggled with this in a pipeline because STDOUT was consumed.
OPA Version: 0.64.1
Steps To Reproduce
$ ./opa eval --format pretty --data file.rego tfplan.json
1 error occurred: stat file.rego: no such file or directory
$ ./opa eval --format pretty --data file.rego tfplan.json > /dev/null
$
$ ./opa eval --format pretty --data file.rego tfplan.json 2> /dev/null
1 error occurred: stat file.rego: no such file or directory
Expected behavior
$ ./opa eval --format pretty --data file.rego tfplan.json > /dev/null
1 error occurred: stat file.rego: no such file or directory
Additional context
The text was updated successfully, but these errors were encountered:
This is an error coming from the rego package and it's handled differently. This is why it goes to stdout. This is printed by the presentation package. We can probably change this behavior based on whether the result contains an error.
Agreed, this is unexpected, and stderr would be the right channel for output here.
If we "always" did this, I suppose there's a real risk that there are scripts out there relying on finding the error message on stdout? But since the eval command could print errors to either stdout or stderr, I'm not sure that sending one particular error to a different output than before should be considered a breaking change? 🤔
Short description
Using opa against a non existent rego files returns with an error message on STDOUT and errcode 2.
I would think such an error really should be sent to STDERR. We struggled with this in a pipeline because STDOUT was consumed.
Steps To Reproduce
Expected behavior
$ ./opa eval --format pretty --data file.rego tfplan.json > /dev/null
1 error occurred: stat file.rego: no such file or directory
Additional context
The text was updated successfully, but these errors were encountered: