V3 JS SDK Kinesis Client getting ERR_HTTP2_INVALID_SESSION error

1

Hi There, I am trying out Kinesis Client in JS SDK V3. When I create a Kinesis Client in the global scope and reuse the same client for all further Kinesis ingestion, I am noticing that after a while I am getting the following error.

1|new-sig      | { Error [ERR_HTTP2_INVALID_SESSION]: The session has been destroyed
1|new-sig      |     at ClientHttp2Session.request (internal/http2/core.js:1559:13)
1|new-sig      |     at Promise (/home/ec2-user/signaling-v7.temasys.io/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js:57:33)
1|new-sig      |     at new Promise (<anonymous>)
1|new-sig      |     at NodeHttp2Handler.handle (/home/ec2-user/signaling-v7.temasys.io/node_modules/@aws-sdk/node-http-handler/dist-cjs/node-http2-handler.js:37:16)
1|new-sig      |     at stack.resolve (/home/ec2-user/signaling-v7.temasys.io/node_modules/@aws-sdk/client-kinesis/dist-cjs/commands/PutRecordCommand.js:27:58)
1|new-sig      |     at /home/ec2-user/signaling-v7.temasys.io/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js:5:32
1|new-sig      |     at /home/ec2-user/signaling-v7.temasys.io/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js:11:26
1|new-sig      |     at process._tickCallback (internal/process/next_tick.js:68:7) '$metadata': { attempts: 1, totalRetryDelay: 0 } }

I am not getting an idea as to why this is happening. However when I use a custom requestHandler and disable Keep-Alive the client stops throwing the error (like the below code)

const { NodeHttpHandler } = require("@aws-sdk/node-http-handler");
const { Agent } = require("http");
const kinesisClient = new KinesisClient({ region: kinesisDataStream.region,
  requestHandler: new NodeHttpHandler({
    httpAgent: new Agent({keepAlive: false})
  })});

Could you help me in understanding what's going on ? Thanks a lot.

asked 2 years ago439 views
1 Answer
0

Hi , hope this situation has been resolved by now.

for the next time , or otherwise if you still have the issue. This is a case in which AWS Support should be able to help you, because no general answer may apply and something contextual to your account might be causing the issue.

Your best next steps would be to open a Support case, in case you have not yet a Support subscription, consider to upgrade to Developer Support or Business support depending on the urgency of your case.

Without looking at the internal logs or having more detailed information on the situation it is not possible to provide guidance, sorry.

Hope this helps

AWS
Varun_S
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions