Skip to content
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

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

Open
john-aws opened this issue Mar 11, 2020 · 0 comments

Comments

@john-aws
Copy link

john-aws commented Mar 11, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant