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

Send scroll_id inside a json rather that text #1325

Merged
merged 1 commit into from
Jun 13, 2017

Conversation

nomoa
Copy link
Contributor

@nomoa nomoa commented Jun 9, 2017

It's likely to cause issues with elastic 5.3 as Content-Type handling becomes
more and more strict.

eg.:
curl -H"Content-Type: application/json" -XGET localhost:9200/_search/scroll?scroll=1m -d 'DXF...'
now fails with Failed to parse request body on 5.3.x.
Elastic 5.1 was lenient and accepted this body and content-type.
Since we default Content-Type to application/json this is likely cause issues
in Elastica as well.
Using an array instead of plain string should force the use of a JSON body which is coherent
with the content-type we set.

@nomoa nomoa force-pushed the scroll_id_as_json branch from 78039c7 to a4405c1 Compare June 9, 2017 11:30
@bgaleotti
Copy link

elastic/elasticsearch-php@59b3c08 looks the same

@ruflin
Copy link
Owner

ruflin commented Jun 13, 2017

@nomoa LGTM. Could you add a changelog entry?

It's likely to cause issues with elastic 5.3 as Content-Type handling becomes
more and more strict.

eg.:
curl -H"Content-Type: application/json"  -XGET localhost:9200/_search/scroll?scroll=1m -d 'DXF...'
now fails with Failed to parse request body on 5.3.x.
Elastic 5.1 was lenient and accepted this body.
Since we default Content-Type to application/json this is likely cause issues
in Elastica as well.
Using an array instead of plain string should force the use of a JSON body which is coherent
with the content-type we set.
@nomoa nomoa force-pushed the scroll_id_as_json branch from a4405c1 to 0c7ab18 Compare June 13, 2017 07:40
@nomoa
Copy link
Contributor Author

nomoa commented Jun 13, 2017

@ruflin done

@ruflin ruflin merged commit e40ca53 into ruflin:master Jun 13, 2017
@ruflin
Copy link
Owner

ruflin commented Jun 13, 2017

@nomoa Merged. Thanks.

@etudor
Copy link

etudor commented Jul 20, 2017

Had the same problem with: ruflin/elastica 5.2.1 and elasticsearch 5.4.0

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Failed to parse request body"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Failed to parse request body",
    "caused_by": {
      "type": "json_parse_exception",
      "reason": "Unrecognized token 'DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAHGKoWY3h2eGxBcHZUUGlINHRDa21USy0xUQ': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@6d20e23; line: 1, column: 64]"
    }
  },
  "status": 400
}

Updating ruflin/elastica to dev-master solved the problem.

@ruflin
Copy link
Owner

ruflin commented Jul 27, 2017

The 5.3 release went out yesterday which should include this bugfix.

qubot pushed a commit to artefactual/atom that referenced this pull request Sep 29, 2017
Updates Elastica and elasticsearch-php to v5.3.0 to fix issue with scroll API.

Issue detailed here: ruflin/Elastica#1325
qubot pushed a commit to artefactual/atom that referenced this pull request Sep 29, 2017
Updates Elastica and elasticsearch-php to v5.3.0 to fix issue with scroll API.

Issue detailed here: ruflin/Elastica#1325
qubot pushed a commit to artefactual/atom that referenced this pull request Oct 13, 2017
Updates Elastica and elasticsearch-php to v5.3.0 to fix issue with scroll API.

Issue detailed here: ruflin/Elastica#1325
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

Successfully merging this pull request may close these issues.

4 participants