-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Using an "input" attribute for default decision queries results in "undefined_document" error #5344
Comments
We should give a more differentiated answer. Is there no default policy, or is there one and the result is undefined? |
I'm also seeing this, but I'm not sure if it is related. I have not yet been able to determine what is causing this error. What exactly does this error mean? I'm seeing this from the OPA pod logs:
And I'm seeing this in the kube-apiserver logs:
|
@forgedbrew this is impossible to answer without knowing your policy. I'd presume that it yields an undefined result for the input in question. |
@forgedbrew in most cases, it just means that OPA has not been provided any policy file that defines an authorization policy — i.e. one that protects the OPA endpoints themselves. |
Thank you, @srenatus and @anderseknert. Does that pertain to both messages, or just the "undefined_document" message? We have been running OPA for a few years, but suddenly this week the kube-apiserver started spewing these logs, but we've made no recent changes.
|
It only pertains to the "undefined_document" error, but the error shown in the Kubernetes API server logs are likely a consequence of that. Strange how that would just pop up — we've not done any changes in that are in quite some time. How are your policies loaded into OPA? Is it via a mounted volume? And could that have changed somehow? |
Thanks, @anderseknert. We found the issue. Someone created a DNS record for localhost, so it was resolving to an actual IP address instead of 127.0.0.1 |
Oh! Happy to hear it was resolved 👍 |
Since "document missing or undefined" caused confusion, we can be more helpful and report whether the default decision document is missing, or whether it's there but undefined. I would probably have preferred for undefined to just result in an empty/undefined result, but that'd be quite a breaking change at this point in time, so hopefully this can at least make things a little less convoluted. Fixes open-policy-agent#5344 Signed-off-by: Anders Eknert <anders@eknert.com>
…cision (#5420) Since "document missing or undefined" caused confusion, we can be more helpful and report whether the default decision document is missing, or whether it's there but undefined. I would probably have preferred for undefined to just result in an empty/undefined result, but that'd be quite a breaking change at this point in time, so hopefully this can at least make things a little less convoluted. Fixes #5344 Signed-off-by: Anders Eknert <anders@eknert.com>
When querying OPA for the default decision (i.e.
localhost:8181/
), wrapping the input with an "input" attribute is incorrect, but the error message does nothing to hint at that:Removing the input attribute from the request body and the same query works — the error message is thus misleading. We should fix the error message to let the user know why the query failed.
The text was updated successfully, but these errors were encountered: