question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

putScript: request [/_scripts/candidate-score] contains unrecognized parameter: [lang]

See original GitHub issue
  • OS: Mac 10.14.3
  • npm: 6.4.1
  • node: 10.15.0
  • elasticsearch client: 15.4.1
  • typescript: 3.3.3333
  • @types/elasticsearch: 5.0.32

When calling putScript, I’m getting this error: request [/_scripts/candidate-score] contains unrecognized parameter: [lang]. Looks like the lang parameter is being set as a querystring parameter. I get the same response when replicating the call in Kibana. When calling the same request in Kibana without the querystring, getting successful response:

{
  "acknowledged": true
}

Call/Logs/Responses

	// Calling elasticsearch client
	this.client.putScript({
		id,
		lang,
		body: {
			script: {
				lang,
 				source
			}
		}
	})

    /* 
		DEBUG LOG
			starting request {"method":"PUT","path":"/_scripts/candidate-score",
			"body":{"script":{"lang":"painless","source":"REDACTED"}},
			"query":{"lang":"painless"}}
    */

esPutScriptsError

What may be causing this issue?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
danhlee329commented, Apr 5, 2019

Here is the submitted bug: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34513. I will close issue, thanks for your help @spalger!

0reactions
danhlee329commented, Apr 5, 2019

Ignoring the typescript rule does the trick in getting the putScript method to run without lang. I will submit a bug in the @types/elasticsearch package definition and will post the issue in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ElasticsearchStatusException contains unrecognized ...
The question is to keep your client's version compatible with the elastic search version, in my case I was using version 7.xx on...
Read more >
weixin_39806679的博客_CSDN博客-领域博主
2021-01-11. putScript: request [/_scripts/candidate-score] contains unrecognized parameter: [lang]. 2021-01-11. Show vst parameter string.
Read more >
Parameter Errors When Getting Snapshots - Elasticsearch
Hi, I'm trying to get a list of snapshots using the size and sort parameters: GET /_snapshot/<repo_name>/snapshots-*?size=2&sort=name.
Read more >
Magento Category page not showing product list
Catalog Search index process unknown error: ... contains unrecognized parameter: [include_type_name]"}],"type":"illegal_argument_exception" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found