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

Dev Tools appears not to be specifying content-type header #13423

Closed
sophiec20 opened this issue Aug 9, 2017 · 4 comments
Closed

Dev Tools appears not to be specifying content-type header #13423

sophiec20 opened this issue Aug 9, 2017 · 4 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Feature:Dev Tools

Comments

@sophiec20
Copy link
Contributor

Kibana version:
Version: 6.0.0-beta1-SNAPSHOT

Elasticsearch version:
Version: 6.0.0-beta1-SNAPSHOT, Build: 4558fc1/2017-08-07T13:03:07.945Z, JVM: 1.8.0_141

Server OS version:
Linux xxxxx 4.4.35-33.55.amzn1.x86_64 #1 SMP Tue Dec 6 20:30:04 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Browser version: n/a

Browser OS version: n/a

Original install method (e.g. download page, yum, from source, etc.):

downloaded zips

Description of the problem including expected versus actual behavior:

Using Dev Tools, the command below has a syntax error, in that it is missing a comma between the source and dest block.

POST _reindex
{ 
  "source": {
    "index": "filebeat-2017.02.01-old"
  }
  "dest": {
    "index": "filebeat-2017.02.01-new"
  }
}

In elasticsearch and kibana 5.4, this returns a useful json_parse_exception error message

{
  "error": {
    "root_cause": [
      {
        "type": "json_parse_exception",
        "reason": "Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1d8b1785; line: 5, column: 4]"
      }
    ],
    "type": "json_parse_exception",
    "reason": "Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1d8b1785; line: 5, column: 4]"
  },
  "status": 500
}

In elasticsearch and kibana 6.0.0-beta1, this returns a less useful message

{
  "error": "Content-Type header [text/plain] is not supported",
  "status": 406
}

This message occurs if the Content-Type Header has not been specified for the POST. If specified, then the message from elasticsearch is a json_parse_exception

Steps to reproduce: See description

Errors in browser console (if relevant): n/a

Provide logs and/or server output (if relevant): n/a

@epixa epixa added Feature:Dev Tools bug Fixes for quality problems that affect the customer experience labels Aug 9, 2017
@epixa
Copy link
Contributor

epixa commented Aug 9, 2017

@jbudz We just can't win with this console content-type stuff

@jbudz
Copy link
Member

jbudz commented Aug 9, 2017

No doubt. #12294 should fix this, and we'll have to keep an eye on elastic/elasticsearch#25718. I'm almost thinking we should always set application/json instead of checking for ndjson and be done with it.

@epixa
Copy link
Contributor

epixa commented Aug 9, 2017

I'm almost thinking we should always set application/json instead of checking for ndjson and be done with it.

I am 100% OK with that if it works

@tylersmalley tylersmalley added the Feature:Console Dev Tools Console Feature label Aug 10, 2017
@jbudz
Copy link
Member

jbudz commented Oct 5, 2017

Fixed by #12294

@jbudz jbudz closed this as completed Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Feature:Dev Tools
Projects
None yet
Development

No branches or pull requests

4 participants