Skip to content

AxiosError: read ECONNRESET #13694

@Sanoodia

Description

@Sanoodia

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

18.12.0

Amplify CLI Version

12.8.2

What operating system are you using?

Window

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

Created a lambda function and im using axios call of curl operation on dynamodb using appsync graphql api.

Describe the bug

On peak time on lambda, axios call gives ECONNRESET on calling appsync graphql api

Expected behavior

It should perform action like update, delete or create

Reproduction steps

  1. created lambda by amplify cli
  2. add axios package
  3. use axios post call for updating or getting record by using appsync graphql api
  4. some time axios gives ECONNRESET error

Project Identifier

report-1712217332691.zip

Log output

Details
# Put your logs below this line


Additional information

Using Node 18x Commonjs in lambda and axios 1.6.8v
here is my sample code

const axiosInstance = axios.create({
  baseURL:process.env.API_CATHERD_GRAPHQLAPIENDPOINTOUTPUT,
  headers: {
    Authorization: "MY_TOKENXXX",
  },
  method: "post"
});

const updateDrDeck = async (actionInfo, _input, _num_attempt = 0 ) => {
  console.log('_input',_input)
  try {
    if(_input?.cat?.includes("CT#") && _input?.id?.includes("CT#")){
      logEvent({...actionInfo, ActionType: 1001, ActionInfo: JSON.stringify(actionInfo)}, 
      process.env.STORAGE_PDEVENTS_NAME)
    }
    let response = await axiosInstance({
      data: {
        query: print(
          gql`
            ${updateCatHerd}
          `
        ),
        variables: {
          input: _input,
        },
      },
    });
    console.log('DD Updation response', response?.data, response?.errors);
    if (response?.data?.data) console.log("Solution: ", response.data.data);
    else console.log("Unable to update object", _input);
  } catch (err) {
    console.log("Error Updating DrDeck", err);
    return err;
  }
};

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    functionsIssues tied to the functions categorypending-responseIssue is pending response from the issue authorpending-triageIssue is pending triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions