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

Leading space breaks YML parsing #12382

Closed
pickypg opened this issue Jul 21, 2015 · 2 comments
Closed

Leading space breaks YML parsing #12382

pickypg opened this issue Jul 21, 2015 · 2 comments
Assignees

Comments

@pickypg
Copy link
Member

pickypg commented Jul 21, 2015

If you accidentally manage to place a leading space in front of a YML setting in elasticsearch.yml, then all follow-on settings will be silently ignored.

 cluster.name: my-cluster
 other.setting: xyz

# The rest is ignored
name.node: my-node

If you turn around and start the node, then it fails to recognize the node.name without any error:

$ bin/elasticsearch
[2015-07-21 11:43:08,883][INFO ][node                     ] [Screaming Mimi] version[1.6.0], pid[35094], build[cdd3ac4/2015-06-09T13:36:34Z]
[2015-07-21 11:43:08,883][INFO ][node                     ] [Screaming Mimi] initializing ...
@clintongormley
Copy link

This should throw an inconsistent indentation error. Not sure if this is our parsing or Jackson that has th issue

@jasontedor
Copy link
Member

@clintongormley It's our issue. We parse until we reach an end object token. The YAML spec requires that all sibling nodes be at the same indentation level. Once the indentation is reduced in the example that @pickypg gave, a YAML parser that parses according to the spec will return an end object token and we will stop parsing. Therefore, to solve this we should just ensure that when we encounter an end object token while parsing settings, we are in fact at the end of the settings stream. I've submitted PR #12451 to do this.

jasontedor added a commit that referenced this issue Jul 28, 2015
…m when parsing settings

This commit backports the fix for #12382 to 1.6 from master.
jasontedor added a commit that referenced this issue Jul 28, 2015
…m when parsing settings

This commit backports the fix for #12382 to 1.7 from master.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants