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
Describe the bug
When processing S3 delete events, data-prepper throws a NullPointerException because the object size is null.
To Reproduce
Configure an S3 bucket with SQS Event Notifcations and ObjectDelete enabled.
Delete a file from the monitored S3 bucket.
The following error will occur: [s3-source-sqs-1] ERROR org.opensearch.dataprepper.plugins.source.s3.SqsWorker - Unable to process SQS messages. Processing error due to: Cannot invoke "java.lang.Long.longValue()" because the return value of "org.opensearch.dataprepper.plugins.source.s3.S3EventNotification$S3ObjectEntity.getSizeAsLong()" is null
Expected behavior
The application should gracefully handle S3 delete events without throwing an exception. The object size should default to 0 when not present in the event notification.
Proposed Fix
Add a null check for getSizeAsLong() in the ParsedMessage class.
Default object size to 0L if the value is null.
Environment (please complete the following information):
OS: MacOS 14.7 Sonoma
Data Prepper 2.10.2
The text was updated successfully, but these errors were encountered:
Describe the bug
When processing S3 delete events, data-prepper throws a NullPointerException because the object size is null.
To Reproduce
[s3-source-sqs-1] ERROR org.opensearch.dataprepper.plugins.source.s3.SqsWorker - Unable to process SQS messages. Processing error due to: Cannot invoke "java.lang.Long.longValue()" because the return value of "org.opensearch.dataprepper.plugins.source.s3.S3EventNotification$S3ObjectEntity.getSizeAsLong()" is null
Pipeline config:
Expected behavior
The application should gracefully handle S3 delete events without throwing an exception. The object size should default to 0 when not present in the event notification.
Proposed Fix
getSizeAsLong()
in theParsedMessage
class.0L
if the value is null.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: