Protocol error in kinesis putRecords in aws sdk > 3.81.0
See original GitHub issueDescribe the bug
node:internal/http2/util in new NghttpError at line 556:5
Your environment
SDK version number
"@aws-sdk/client-dynamodb": "3.87.0",
"@aws-sdk/client-kinesis": "3.88.0",
"@aws-sdk/client-s3": "^3.88.0",
"@aws-sdk/client-sqs": "^3.87.0",
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
Node.js v16.15.0
Steps to reproduce
Reproduces only in production 😦 Code:
const usRequests: StatRequest[] = [];
const euRequests: StatRequest[] = [];
async function sendToKinesis(requests: StatRequest[], kinesis: KinesisClient, streamName: string) {
if (requests.length >= flushAfter) {
const requestsToSend = requests.splice(0);
try {
await kinesis.send(
new PutRecordsCommand({
StreamName: streamName,
Records: requestsToSend.map((data, idx) => ({
Data: textEncoder.encode(JSON.stringify(data)),
PartitionKey: idx.toString(),
})),
}),
);
} catch (err) {
logger.error(err as Error);
Sentry.captureException(err);
}
}
}
await sendToKinesis(usRequests, usKinesis, "some-us-stream");
await sendToKinesis(euRequests, euKinesis, "some-eu-stream");
Observed behavior
Getting this error in 90% cases:
Error: Protocol error
File "node:internal/http2/util", line 556, col 5, in new NghttpError
File "node:internal/http2/core", line 785, col 26, in Http2Session.onSessionInternalError
File "node:internal/async_hooks", line 130, col 17, in Http2Session.callbackTrampoline
Expected behavior
No error
Additional context
3.81 worked fine
Issue Analytics
- State:
- Created a year ago
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Protocol error in kinesis putRecords in aws sdk > 3.81.0 #3780
Expected Behavior. putRecords() should work correctly. Current Behavior. Connection fails, error msg gives "Protocol error" . Reproduction Steps.
Read more >Common Errors - Amazon Kinesis Data Streams Service
This section lists the errors common to the API actions of all AWS services. For errors specific to an API action for this...
Read more >PutRecords - Amazon Kinesis Data Streams Service
Writes multiple data records into a Kinesis data stream in a single call (also referred to as a PutRecords request). Use this operation...
Read more >kinesis - Amazon Web Services - Go SDK
Amazon Kinesis Data Streams is a managed service that scales elastically for real-time processing of streaming big data. See https://docs.aws.amazon.com/goto/ ...
Read more >Troubleshooting Amazon Kinesis Data Streams Producers
If it's a mobile app, we recommend using the PutRecords operation or the Kinesis Recorder in the AWS Mobile SDKs. For more information,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
16.15.0-alpine3.15
image.More or less how we write to Kinesis to give you guys an idea:
@AllanZhengYP @up73k @L1fescape my issue appears to be stable and resolved. LGTM.
@gugu how about yours?