-
Notifications
You must be signed in to change notification settings - Fork 215
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
[BUG] Unhelpful error message initializing OpenSearch Ingestion, OpenSearch sink #4195
Comments
Actually, this may not have anything to do with the Python client, it's either the Java client or Data Prepper. Can you re-route? |
Hello @Jon-AtAWS ,
|
Thanks for the fast response! My pipeline role has (pardon the CDK code)
And I have verified that the statement is correct in the generated policy. It's not deployed right now, so I can't screenshot the IAM console. The pipeline works if I map the role to FGAC's all_access role, or add "" and "" for index and cluster level permissions to the OpenSearch role I create. There's some permission that I need in OpenSearch FGAC that's causing this error. Looking at the code for checkIfIndexExists (the failing call), it looks like it's calling HEAD /index_name. I have tried cluster_composite_ops, and a variety of other cluster level permissions for FGAC. At the index level, I have indices_all, and I've also tried crud, read, and write. My next attempt will be to add indices_all to cluster level permissions. That doesn't make any sense, really, but maybe it will work? My goal is to find the minimum permissions needed for the FGAC role to work with DataPrepper/OpenSearch Ingestion. If you already know that, then please let me know! |
Well, shoot. As I was re-reading that, I realized that my resource is missing a wildcard for the es:ESHttp action. So, I changed to
And it worked. I still don't understand why it also worked when I changed to all_access for FGAC, I will try that again. And, I still think that we need a better error message, including the entity that was presenting credentials, and the API that was called. Even better if the error message specifies the permissions that I need (whether IAM or FGAC) |
Nope, something else made it work. Here's the error
Here is the role's trust relationship
Here is the role's permissions
Here is the FGAC permissions
|
This:
Allowed the sink to initialize Summarizing
What is the additional permission I need, and can we fix the error message? |
DataPrepper can only show the message provided by OpenSearch. |
It would be good for DP to add context like: "called client's IndexExists method, attempting to validate the non-existence of index 'foo', in order to set the template." Or something like that. |
@Jon-AtAWS , Yes, I agree with this. @kkondaka , I think we could accomplish this by adding a try-catch when making the call. Maybe we can even have a special exception for failed requests?
And
|
Thanks @dlvenable ! Nitpicking a bit - let's pack as much information in these messages as possible. For instance, in this message, we can add the index name we're checking. If we know the authenticated entity, and its roles, we should add that as well. More information is better! |
@Jon-AtAWS , This is great feedback. We could quite easily include the index name. The role name is a bit more challenging, but it may be provided back in the OpenSearch response. |
@Jon-AtAWS Based on stacktrace, the failure happened while checking if the index exists which requires |
I now have this policy
And receiving this error:
|
This policy is successful (changing to "indices_all" at index level)
The docs (https://opensearch.org/docs/latest/security/access-control/default-action-groups/) are not very helpful here. indices_all action group is documented as "Grants all permissions on the index. Equates to indices:*". So, I can't really tell which permission I added that enabled the sink to initialize. And, the error doesn't tell me which permission I need. |
If you have |
Yes, I am trying to figure out minimum permissions. I understand that I don't need crud, I just threw indices_all in there (as an edit to indices:admin/exists) to verify that the exists perm is not sufficient. |
See also: opensearch-project/opensearch-java#473
Looks like we maybe fixed this in the java client, but not in the Python client? Or maybe this is a different code path?
I haven't been able to diagnose exactly what's going on and where the failure is. Here's what's in CloudWatch Logs for the OpenSearch sink initialization
FWIW, my pipeline role has:
The text was updated successfully, but these errors were encountered: