# Elasticsearch 6.3: elasticsearch-keystore add not accepting stdin

**URL:** <https://discuss.elastic.co/t/elasticsearch-6-3-elasticsearch-keystore-add-not-accepting-stdin/136577>\
**Category:** Elasticsearch\
**Created:** [June 19, 2018, 10:36pm UTC](https://discuss.elastic.co/t/elasticsearch-6-3-elasticsearch-keystore-add-not-accepting-stdin/136577 "2018-06-19T22:36:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Wells](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Justin\_Wells](https://discuss.elastic.co/u/Justin_Wells)\
**Post date:** [June 19, 2018, 10:36pm UTC](https://discuss.elastic.co/t/elasticsearch-6-3-elasticsearch-keystore-add-not-accepting-stdin/136577/1 "2018-06-19T22:36:33Z")

</div>

We had some Ansible automation break when going to Elasticsearch 6.3. The ./elasticsearch-keystore add command now prompts before overwriting a value. I've attempted to suppress this using the --stdin and --silent flags to no avail. Any suggestions?

```
printf value | ./elasticsearch-keystore add --stdin bootstrap.password --silent

```

results in the following:

```
"stderr_lines": [
    "Exception in thread \"main\" java.lang.IllegalStateException: unable to read from standard input; is standard input open and a tty attached?",
    "\tat org.elasticsearch.cli.Terminal$SystemTerminal.readText(Terminal.java:168)",
    "\tat org.elasticsearch.cli.Terminal.promptYesNo(Terminal.java:101)",
    "\tat org.elasticsearch.common.settings.AddStringKeyStoreCommand.execute(AddStringKeyStoreCommand.java:78)",
    "\tat org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)",
    "\tat org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)",
    "\tat org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:79)",
    "\tat org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)",
    "\tat org.elasticsearch.cli.Command.main(Command.java:90)",
    "\tat org.elasticsearch.common.settings.KeyStoreCli.main(KeyStoreCli.java:41)"
```

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [June 20, 2018, 1:19am UTC](https://discuss.elastic.co/t/elasticsearch-6-3-elasticsearch-keystore-add-not-accepting-stdin/136577/2 "2018-06-20T01:19:22Z")

</div>

The command line arguments for `add` in 6.3.0 can be retrieved with

```auto
./elasticsearch-keystore add -h

```

which shows

```auto
Add a string setting to the keystore

Non-option arguments:
setting name

Option Description
------ -----------
-E <KeyValuePair> Configure a setting
-f, --force Overwrite existing setting without prompting
-h, --help show help
-s, --silent show minimal output
-v, --verbose show verbose output
-x, --stdin Read setting value from stdin

```

So to overwrite an existing value using input from stdin would be something like

```auto
echo "secret value" | ./elasticsearch-keystore add -xf

```

---

<div class="post-metadata">

**Author:** ![Justin\_Wells](https://avatars.discourse-cdn.com/v4/letter/j/ccd318/32.png) [@Justin\_Wells](https://discuss.elastic.co/u/Justin_Wells)\
**Post date:** [June 20, 2018, 2:36pm UTC](https://discuss.elastic.co/t/elasticsearch-6-3-elasticsearch-keystore-add-not-accepting-stdin/136577/3 "2018-06-20T14:36:49Z")

</div>

Thanks Russ, too easy 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 18, 2018, 2:36pm UTC](https://discuss.elastic.co/t/elasticsearch-6-3-elasticsearch-keystore-add-not-accepting-stdin/136577/4 "2018-07-18T14:36:53Z")

</div>

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