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

SQS: EmptyBatchRequest error with slightly older @aws-sdk/client-sqs package (e.g. 3.445.0) #331

Open
mattcobley opened this issue Oct 24, 2024 · 6 comments
Assignees

Comments

@mattcobley
Copy link

Hi,

When using this service with a slightly older version of the AWS SDK (e.g. 3.445.0) we get an error like the following when receiving some SQS messages (note that here we're manually calling send on the SQS client with a DeleteMessageBatchCommand). This works with the real AWS SQS service.

const entries = [
  {
    Id: '309ef453-bf32-42c5-a45e-2e1c2083e5af',
    ReceiptHandle: '309ef453-bf32-42c5-a45e-2e1c2083e5af#fd721ed5-6317-437e-8f23-1b3bdb20bc53'
  }
]
client.send(new DeleteMessageBatchCommand({ Entries: entries, QueueUrl: queueUrl }))

EmptyBatchRequest: UnknownError
    at de_EmptyBatchRequestRes (/opt/nodeservice/node_modules/@aws-sdk/client-sqs/dist-cjs/protocols/Aws_query.js:1036:23)
    at de_DeleteMessageBatchCommandError (/opt/nodeservice/node_modules/@aws-sdk/client-sqs/dist-cjs/protocols/Aws_query.js:498:25)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /opt/nodeservice/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20
    at async /opt/nodeservice/node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthMiddleware.js:14:20
    at async /opt/nodeservice/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38
    at async /opt/nodeservice/node_modules/@aws-sdk/client-sqs/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:7:26
    at ... {
  '$fault': 'client',
  '$metadata': {
    httpStatusCode: 400,
    requestId: undefined,
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  },
  Error: {
    Type: 'EmptyBatchRequest',
    Code: 'AWS.SimpleQueueService.EmptyBatchRequest',
    Message: "The batch request doesn't contain any entries.",
    message: "The batch request doesn't contain any entries."
  },
  RequestId: '00000000-0000-0000-0000-000000000000'
}
@Admiral-Piett
Copy link
Owner

Hm, this looks like it should work I think. What version of GoAWS are you on?

@mattcobley
Copy link
Author

Hm, this looks like it should work I think. What version of GoAWS are you on?

Thanks for the response. v0.5.0, I believe.

@Admiral-Piett
Copy link
Owner

Hm, I'll see if I can recreate it. Thanks!

@Admiral-Piett
Copy link
Owner

@mattcobley thanks for bringing this to our attention! Definitely a problem here. 🤦 I just put up a PR for it - #336 That should take care of it I think. It'll be out in v0.5.2, I'll let you know when it's out.

@gareththegeek
Copy link

@Admiral-Piett is this addressed in v0.5.2 ?

@Admiral-Piett
Copy link
Owner

@gareththegeek @mattcobley Sorry, yes, I think we got this in 0.5.2. Could you give it a test on your side and let me know if you're still having problems? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants