Skip to content

DynamoDB EPROTO Error #3476

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

Closed
cmoyer2 opened this issue Mar 24, 2022 · 8 comments
Closed

DynamoDB EPROTO Error #3476

cmoyer2 opened this issue Mar 24, 2022 · 8 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Comments

@cmoyer2
Copy link

cmoyer2 commented Mar 24, 2022

Describe the bug

Sporadically receiving the following error when trying to connect to DynamoDB from various different Lambda functions. This error does not consistently occur in any one particular Lambda function. We see this error occur in different Lambdas in our environment, but when it does occur it always in a Lambda attempting to connect to DynamoDB.

{
      "errorType": "Error",
      "errorMessage": "write EPROTO",
      "code": "EPROTO",
      "errno": -71,
      "syscall": "write",
      "$metadata": {
          "attempts": 1,
          "totalRetryDelay": 0
}

Your environment

SDK version number

"@aws-sdk/client-dynamodb": "^3.49.0",
"@aws-sdk/lib-dynamodb": "^3.49.0",

Is the issue in the browser/Node.js/ReactNative?

Node.js

Details of the browser/Node.js/ReactNative version

Lambda Node.js 14.x Runtime

Steps to reproduce

Cannot consistently reproduce, error occurs roughly once a week in our serverless environment. We have multiple Lambdas that access DynamoDB, and not all of them fail at the same time, but we have seen this error occur in all Lambdas that do access DynamoDB.

We use the following code to create the DynamoDB client. We then import the documentClient into the handler for each Lambda that needs access to DynamoDB.

import {DynamoDBDocumentClient} from "@aws-sdk/lib-dynamodb";
import {DynamoDBClient} from "@aws-sdk/client-dynamodb";

const dynamoDBClient = new DynamoDBClient({

});

const marshallOptions = {
  // Whether to automatically convert empty strings, blobs, and sets to `null`.
  convertEmptyValues: false, // false, by default.
  // Whether to remove undefined values while marshalling.
  removeUndefinedValues: true, // false, by default.
  // Whether to convert typeof object to map attribute.
  convertClassInstanceToMap: false, // false, by default.
};

const unmarshallOptions = {
  // Whether to return numbers as a string instead of converting them to native JavaScript numbers.
  wrapNumbers: false, // false, by default.
};

const translateConfig = { marshallOptions, unmarshallOptions };

export const documentClient = DynamoDBDocumentClient.from(dynamoDBClient, translateConfig);

Observed behavior

Receive the following error when trying to access DynamoDB with documentClient.send() with a GetItemCommand, QueryCommand, UpdateItemCommand, or PutItemCommand.

{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "Error: write EPROTO",
    "reason": {
        "errorType": "Error",
        "errorMessage": "write EPROTO",
        "code": "EPROTO",
        "errno": -71,
        "syscall": "write",
        "$metadata": {
            "attempts": 1,
            "totalRetryDelay": 0
        },
        "stack": [
            "Error: write EPROTO",
            "    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: Error: write EPROTO",
        "    at process.<anonymous> (/var/runtime/index.js:35:15)",
        "    at process.emit (events.js:400:28)",
        "    at processPromiseRejections (internal/process/promises.js:245:33)",
        "    at processTicksAndRejections (internal/process/task_queues.js:96:32)"
    ]
}

Expected behavior

DocumentClient consistently able to access DynamoDB without throwing networking errors.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

I've viewed the following issues that have been previously opened that seem to be related to this issue, although most seem to be around 2016 in much earlier versions of the SDK and Node.js. Most recommendations are to force the secure protocol to TLSv1, but I don't imagine that would be the solution any longer as TLSv1.2 would be the recommended version.

aws/aws-sdk-js#862
nodejs/node#3692

@cmoyer2 cmoyer2 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 24, 2022
@sutts101
Copy link

sutts101 commented Apr 5, 2022

We have also been seeing the same issue very sporadically. Tentatively it looks like upgrading to ^3.58.0 might have fixed it...

@kuhe kuhe self-assigned this May 6, 2022
@kuhe kuhe removed the needs-triage This issue or PR still needs to be triaged. label May 6, 2022
@kuhe kuhe removed their assignment May 12, 2022
@spidermonk
Copy link

spidermonk commented May 26, 2022

I started seeing this issue this past week and just updated to 3.99.0 (Node v14.19.3) but still see the error.

EDITED to add: Over the past 24 hours this happened 17 times from just under 4,000 lambda invocations.

Error:

{
    "errorType": "Error",
    "errorMessage": "write EPROTO",
    "code": "EPROTO",
    "errno": -71,
    "syscall": "write",
    "$metadata": {
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "level": "warn",
    "stack": [
        "Error: write EPROTO",
        "    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)"
    ]
}

Client creation code:

dynamoDocClient = DynamoDBDocument.from(new DynamoDB({region: region}), 
    {
        marshallOptions: {
            removeUndefinedValues: true,
            convertEmptyValues: false
        }
    });

Note: This is from a Lambda to DDB via a VPC endpoint

@vvo
Copy link
Contributor

vvo commented Jun 30, 2022

Hey there, also receiving this error, although I am using the @aws-sdk/client-cloudwatch in my lambda.
Version: "@aws-sdk/client-cloudwatch": "3.118.0",

Error is:

{
  "errorType":"Runtime.UnhandledPromiseRejection",
  "errorMessage":"Error: write EPROTO",
  "reason":{
    "errorType":"Error",
    "errorMessage":"write EPROTO",
    "code":"EPROTO",
    "errno":-71,
    "syscall":"write",
    "$metadata":{
      "attempts":1,
      "totalRetryDelay":0
    },
    "stack":[
      "Error: write EPROTO",
      "    at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)"
    ]
  },
  "promise":{
    
  },
  "stack":[
    "Runtime.UnhandledPromiseRejection: Error: write EPROTO",
    "    at process.<anonymous> (/var/runtime/index.js:35:15)",
    "    at process.emit (events.js:412:35)",
    "    at process.emit (/var/task/node_modules/source-map-support/source-map-support.js:516:21)",
    "    at processPromiseRejections (internal/process/promises.js:245:33)",
    "    at processTicksAndRejections (internal/process/task_queues.js:96:32)"
  ]
}

@sirimykland
Copy link

sirimykland commented Jul 6, 2022

I also experience this exact error sporadically in our lambdas running node 14. It somewhat seems to relate to dynamodb, as it only occur in the lambdas that use a dynamodb connection. I tried to upgrade @aws-sdk/* to the latest version 3.121.0 without any luck. Any help would be greatly appreciated!

@RanVaknin RanVaknin removed their assignment Sep 1, 2022
@jcardus
Copy link

jcardus commented Nov 14, 2022

This happens just with require('aws-sdk/clients/dynamodb'), even if you don't do anything...

@RanVaknin RanVaknin added the p3 This is a minor priority issue label Mar 15, 2023
@RanVaknin
Copy link
Contributor

Hi there,

Im sorry for the long wait on the thread. This is something I have not seen come up in a while, and my guess is that it got resolved in newer versions.
Can someone on this thread install the latest version and see if this persists?

Thanks,
Ran~

@RanVaknin RanVaknin assigned RanVaknin and unassigned ajredniwja Feb 22, 2024
@RanVaknin RanVaknin added the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Feb 22, 2024
Copy link

github-actions bot commented Mar 4, 2024

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Mar 4, 2024
@github-actions github-actions bot closed this as completed Mar 9, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. closed-for-staleness p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Projects
None yet
Development

No branches or pull requests

9 participants