# SG 6.2.2 trying to read jvm.options.dpkg-dist on startup

**URL:** <https://forum.search-guard.com/t/sg-6-2-2-trying-to-read-jvm-options-dpkg-dist-on-startup/820>\
**Category:** Search Guard\
**Created:** [February 26, 2018, 10:46pm UTC](https://forum.search-guard.com/t/sg-6-2-2-trying-to-read-jvm-options-dpkg-dist-on-startup/820 "2018-02-26T22:46:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![posthamster](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@posthamster](https://forum.search-guard.com/u/posthamster)\
**Post date:** [February 26, 2018, 10:46pm UTC](https://forum.search-guard.com/t/sg-6-2-2-trying-to-read-jvm-options-dpkg-dist-on-startup/820/1 "2018-02-26T22:46:12Z")

</div>

After an upgrade of ES to 6.2.2, we find we have a file named jvm.options.dpkg-dist, as our jvm.options file is modified and pushed with puppet.  
On startup, SG is trying to read this file, and failing, causing elasticsearch to not start.  
The read failure is due to the permissions on jvm.options.dpkg-dist being set root:elasticsearch 600 by dpkg.  
The question is, _why is SG trying to read this file in the first place_? It’s irrelevant and does not contain any info for our environment.

We could fix this by having puppet set the permissions correctly on this file, but that seems unnecessary for a file we don’t want to read anyway.

Thanks,  
CK

- Search Guard and Elasticsearch version: 6.2.2

- Installed and used enterprise modules, if any: no modules

- JVM version: openjdk-8-jre-headless:amd64 8u151-b12-0ubuntu0.16.04.2

- Operating system version: Ubuntu 16.04.3 LTS

- Search Guard configuration files: n/a

- Other installed Elasticsearch or Kibana plugins, if any: none

- Elasticsearch log messages on debug level:

[2018-02-27T11:20:39,251][ERROR][c.f.s.SearchGuardPlugin] ElasticsearchSecurityException[Unable to digest file]; nested: AccessDeniedException[/etc/elasticsearch/jvm.options.dpkg-dist];  
[2018-02-27T11:20:39,262][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [hostname] uncaught exception in thread [main]  
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]  
[…stack trace…]

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [February 27, 2018, 10:35am UTC](https://forum.search-guard.com/t/sg-6-2-2-trying-to-read-jvm-options-dpkg-dist-on-startup/820/2 "2018-02-27T10:35:41Z")

</div>

Hi,

we do not read any file in the config directory, apart from what is configured in elasticsearch.yml (certificates, keys etc.). It seems this is happening in the Elastic code when it tries to instantiate plugins. My guess is that this would happen also with other plugins. We would need to see the full stack trace of this error to locate where it originally comes from.

> **···**
>
> On Monday, February 26, 2018 at 11:46:12 PM UTC+1, CK wrote:
> 
> > After an upgrade of ES to 6.2.2, we find we have a file named jvm.options.dpkg-dist, as our jvm.options file is modified and pushed with puppet.  
> > On startup, SG is trying to read this file, and failing, causing elasticsearch to not start.  
> > The read failure is due to the permissions on jvm.options.dpkg-dist being set root:elasticsearch 600 by dpkg.  
> > The question is, _why is SG trying to read this file in the first place_? It’s irrelevant and does not contain any info for our environment.
> > 
> > We could fix this by having puppet set the permissions correctly on this file, but that seems unnecessary for a file we don’t want to read anyway.
> > 
> > Thanks,  
> > CK
> 
> > - Search Guard and Elasticsearch version: 6.2.2
> 
> > - Installed and used enterprise modules, if any: no modules
> 
> > - JVM version: openjdk-8-jre-headless:amd64 8u151-b12-0ubuntu0.16.04.2
> > - Operating system version: Ubuntu 16.04.3 LTS
> 
> > - Search Guard configuration files: n/a
> 
> > - Other installed Elasticsearch or Kibana plugins, if any: none
> > - Elasticsearch log messages on debug level:
> > 
> > [2018-02-27T11:20:39,251][ERROR][c.f.s.SearchGuardPlugin] ElasticsearchSecurityException[Unable to digest file]; nested: AccessDeniedException[/etc/elasticsearch/jvm.options.dpkg-dist];  
> > [2018-02-27T11:20:39,262][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [hostname] uncaught exception in thread [main]  
> > org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]  
> > […stack trace…]
> 
> >

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [February 27, 2018, 12:11pm UTC](https://forum.search-guard.com/t/sg-6-2-2-trying-to-read-jvm-options-dpkg-dist-on-startup/820/3 "2018-02-27T12:11:45Z")

</div>

Sorry, I was actually wrong. What we do here is: we scan the directory for our demo certificates and refuse to start if they are found and not allowed explicitly. This is a safety net to avoid that customers use the unsafe demo certificates in production.

We can address this issue in the next release, can you please open an issue here?

> **[Issues · floragunncom/search-guard](https://github.com/floragunncom/search-guard/issues)**
>
> Search Guard Plugin - Security for Elasticsearch. Contribute to floragunncom/search-guard development by creating an account on GitHub.

Thanks.

> **···**
>
> On Tuesday, February 27, 2018 at 11:35:42 AM UTC+1, Jochen Kressin wrote:
> 
> > Hi,
> 
> > > After an upgrade of ES to 6.2.2, we find we have a file named jvm.options.dpkg-dist, as our jvm.options file is modified and pushed with puppet.  
> > > On startup, SG is trying to read this file, and failing, causing elasticsearch to not start.  
> > > The read failure is due to the permissions on jvm.options.dpkg-dist being set root:elasticsearch 600 by dpkg.  
> > > The question is, _why is SG trying to read this file in the first place_? It’s irrelevant and does not contain any info for our environment.
> > > 
> > > We could fix this by having puppet set the permissions correctly on this file, but that seems unnecessary for a file we don’t want to read anyway.
> > > 
> > > Thanks,  
> > > CK
> 
> > > - Search Guard and Elasticsearch version: 6.2.2
> 
> > > - Installed and used enterprise modules, if any: no modules
> 
> > > - JVM version: openjdk-8-jre-headless:amd64 8u151-b12-0ubuntu0.16.04.2
> > > - Operating system version: Ubuntu 16.04.3 LTS
> 
> > > - Search Guard configuration files: n/a
> 
> > > - Other installed Elasticsearch or Kibana plugins, if any: none
> > > - Elasticsearch log messages on debug level:
> > > 
> > > [2018-02-27T11:20:39,251][ERROR][c.f.s.SearchGuardPlugin] ElasticsearchSecurityException[Unable to digest file]; nested: AccessDeniedException[/etc/elasticsearch/jvm.options.dpkg-dist];  
> > > [2018-02-27T11:20:39,262][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [hostname] uncaught exception in thread [main]  
> > > org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to load plugin class [com.floragunn.searchguard.SearchGuardPlugin]  
> > > […stack trace…]
> 
> > >
> 
> > we do not read any file in the config directory, apart from what is configured in elasticsearch.yml (certificates, keys etc.). It seems this is happening in the Elastic code when it tries to instantiate plugins. My guess is that this would happen also with other plugins. We would need to see the full stack trace of this error to locate where it originally comes from.
> > 
> > On Monday, February 26, 2018 at 11:46:12 PM UTC+1, CK wrote:
