Skip to content

Error: The "data" argument must be one of type string, TypedArray, or DataView. Received type undefined #74

Description

@john-aws

When using http-aws-es, if you fail to explicitly update your AWS configuration object with a region (e.g. aws.config.update({ region: "us-east-1" })) then searches using elasticsearch/http-aws-es fail with the misleading error message:

The "data" argument must be one of type string, TypedArray, or DataView. Received type undefined

This is accompanied by a stack trace such as:

Elasticsearch ERROR: 2020-03-11T13:02:48Z
  Error: Request error, retrying
  POST https://search-endpoint-01/kibana_sample_data_flights/_search?size=10 => The "data" argument must be one of type string, TypedArray, or DataView. Received type undefined
      at Log.error (myproject/node_modules/elasticsearch/src/lib/log.js:226:56)
      at checkRespForFailure (myproject/node_modules/elasticsearch/src/lib/transport.js:259:18)
      at done (myproject/node_modules/http-aws-es/connector.js:48:7)
      at process._tickCallback (internal/process/next_tick.js:68:7)
      at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
      at startup (internal/bootstrap/node.js:283:19)
      at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Because this error message is so unrelated to the root cause, I wonder if http-aws-es could test for this condition and provide better diagnostics. If not, hopefully the existence of this github issue will at least help the next person who hits this problem.

I suspect the actual validation that triggers this error may be in an underlying crypto module.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions