Elasticsearch password set error in both auto and interactive

when i execute ./bin/Elasticsearch-setup-passwords auto or interactive then it's shows me an error

Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: MarkedYAMLException[while scanning a simple key
 in 'reader', line 137, column 1:
    exit
    ^
could not find expected ':'
 in 'reader', line 143, column 1:
    
    ^

 at [Source: (sun.nio.ch.ChannelInputStream); line: 98, column: 43]]; nested: ScannerException[while scanning a simple key
 in 'reader', line 137, column 1:
    exit
    ^
could not find expected ':'
 in 'reader', line 143, column 1:
    
    ^
];
	at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1168)
	at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1139)
	at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:75)
	at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:91)
	at org.elasticsearch.cli.EnvironmentAwareCommand.createEnv(EnvironmentAwareCommand.java:82)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
	at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:95)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
	at org.elasticsearch.cli.Command.main(Command.java:77)
	at org.elasticsearch.xpack.security.authc.esnative.tool.SetupPasswordTool.main(SetupPasswordTool.java:128)
Caused by: com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: while scanning a simple key
 in 'reader', line 137, column 1:
    exit
    ^
could not find expected ':'
 in 'reader', line 143, column 1:
    
    ^

 at [Source: (sun.nio.ch.ChannelInputStream); line: 98, column: 43]
	at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException.from(MarkedYAMLException.java:27)
	at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:359)
	at org.elasticsearch.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:73)
	at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:685)
	at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:654)
	at org.elasticsearch.common.settings.Settings.access$400(Settings.java:74)
	at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1164)
	... 10 more
Caused by: while scanning a simple key
 in 'reader', line 137, column 1:
    exit
    ^
could not find expected ':'
 in 'reader', line 143, column 1:
    
    ^

	at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:464)
	at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:278)
	at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
	at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:355)
	... 15 more

Welcome to our community! :smiley:

What version are you running?

The first place to look would be around line 137 of elasticsearch.yml.
It looks like you have some invalid configuration in there.

2 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.