Skip to content
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] Using update, upsert, or delete actions without specifying document_id crashes the pipeline with NPE #3988

Closed
graytaylor0 opened this issue Jan 18, 2024 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@graytaylor0
Copy link
Member

Describe the bug
update, upsert, and delete bulk actions in the opensearch sink requires knowing the document_id of the document to update or delete. However, if document_id is not provided in the opensearch sink with one of these actions being used, the following NPE is hit when converting the failed document to a DLQ object

Caused by: java.lang.NullPointerException
	at org.opensearch.dataprepper.plugins.sink.opensearch.dlq.FailedBulkOperationConverter.convertDocumentToGenericMap(FailedBulkOperationConverter.java:64) ~[opensearch-2.6.1.jar:?]
	at org.opensearch.dataprepper.plugins.sink.opensearch.dlq.FailedBulkOperationConverter.convertToDlqObject(FailedBulkOperationConverter.java:38) ~[opensearch-2.6.1.jar:?]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?]

Expected behavior
Do not crash the pipeline and send the document to DLQ without any document_id

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. Ubuntu 20.04 LTS]
  • Version [e.g. 22]

Additional context
Related to #3933

@graytaylor0 graytaylor0 added bug Something isn't working untriaged labels Jan 18, 2024
@dlvenable dlvenable added this to the v2.7 milestone Jan 23, 2024
@dlvenable
Copy link
Member

We should add restrictions to the pipeline configuration to disallow these actions when the customer does not provide a document_id.

@dlvenable
Copy link
Member

Fixed by #4178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

3 participants