# searchguard\_node\_key.key generated, but then cannot be found

**URL:** <https://forum.search-guard.com/t/searchguard-node-key-key-generated-but-then-cannot-be-found/95>\
**Category:** Search Guard\
**Created:** [October 29, 2015, 7:17pm UTC](https://forum.search-guard.com/t/searchguard-node-key-key-generated-but-then-cannot-be-found/95 "2015-10-29T19:17:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Jones](https://avatars.discourse-cdn.com/v4/letter/k/838e76/32.png) [@Kevin\_Jones](https://forum.search-guard.com/u/Kevin_Jones)\
**Post date:** [October 29, 2015, 7:17pm UTC](https://forum.search-guard.com/t/searchguard-node-key-key-generated-but-then-cannot-be-found/95/1 "2015-10-29T19:17:41Z")

</div>

Search Guard built from branch es1.6 running with ES 1.6.0-1 rpm.

The key file ‘searchguard\_node\_key.key’ is generated at the location specified in elasticsearch.yml, but a few lines later it says it can’t find it in the location ‘./searchguard\_node\_key.key’ which is not the location specified in the yml file. it is obviously picking up the setting when generating the file, but not later when trying to read it.

[ec2-user@ip-10-100-51-231 ~]$ sudo service elasticsearch start

Starting elasticsearch: [OK]

[ec2-user@ip-10-100-51-231 ~]$ more /esvolume/elasticsearch/logs/Terraform-Dev-vpc-def543ba-cluster-1.log

[2015-10-29 19:03:19,383][INFO][node] [Terraform-Dev-vpc-def543ba-cluster-1-tribe-10.100.51.231] version[1.6.0], pid[23311], build[cdd3ac4/2015-06-09T13:36:34Z]

[2015-10-29 19:03:19,384][INFO][node] [Terraform-Dev-vpc-def543ba-cluster-1-tribe-10.100.51.231] initializing …

[2015-10-29 19:03:19,511][INFO][com.floragunn.searchguard.SearchGuardPlugin] Class enhancements for DLS/FLS successful

[2015-10-29 19:03:19,512][INFO][plugins] [Terraform-Dev-vpc-def543ba-cluster-1-tribe-10.100.51.231] loaded [searchguard], sites

[2015-10-29 19:03:21,619][INFO][com.floragunn.searchguard.service.SearchGuardService] New key written to /esvolume/elasticsearch/sg/searchguard\_node\_key.key, make sure all nodes have this

key

[2015-10-29 19:03:21,843][INFO][node] [Terraform-Dev-vpc-def543ba-cluster-1-tribe-10.100.51.231/t1] version[1.6.0], pid[23311], build[cdd3ac4/2015-06-09T13:36:34Z]

[2015-10-29 19:03:21,843][INFO][node] [Terraform-Dev-vpc-def543ba-cluster-1-tribe-10.100.51.231/t1] initializing …

[2015-10-29 19:03:21,844][INFO][plugins] [Terraform-Dev-vpc-def543ba-cluster-1-tribe-10.100.51.231/t1] loaded [searchguard], sites

[2015-10-29 19:03:22,451][ERROR][com.floragunn.searchguard.service.SearchGuardService] Cannot generate or read secrety key

java.io.FileNotFoundException: ./searchguard\_node\_key.key (Permission denied)

My workaround was to start the service in the directory where the key is to be created so ‘./’ is correct.

/etc/init.d/elasticsearch start

Am I missing something?
