# Elasticsearch Java Security Manager: somaxconn read permissions

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511>\
**Category:** Elasticsearch\
**Created:** [December 6, 2017, 11:44am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511 "2017-12-06T11:44:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ize0j10](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@ize0j10](https://discuss.elastic.co/u/ize0j10)\
**Post date:** [December 6, 2017, 11:44am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/1 "2017-12-06T11:44:27Z")

</div>

Hi,

I am experiencing a Java Security Manager issue when running Elasticsearch with the official docker image in Version 5.6.4 setting log level to DEBUG.

Elasticsearch throws an exception during start:

```
  Dec 06 09:14:53 server docker[14579]: [2017-12-06T09:14:53,671][DEBUG][i.n.u.NetUtil] Failed to get SOMAXCONN from sysctl and file /proc/sys/net/core/somaxconn. Default: 128
  Dec 06 09:14:53 server docker[14579]: java.security.AccessControlException: access denied ("java.io.FilePermission" "/proc/sys/net/core/somaxconn" "read")

```

I also saw this closed issue related to exactly this problem:

> <https://github.com/elastic/elasticsearch/pull/21840>

It just says that the Security Manager has no permission to read that file. Is there a simple solution to "fix" this?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 6, 2017, 11:51pm UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/2 "2017-12-06T23:51:59Z")

</div>

That’s surprising. Let me try to reproduce this and get back to you.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 7, 2017, 2:46am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/3 "2017-12-07T02:46:30Z")

</div>

I can reproduce this. It requires X-Pack to be installed. I will open an internal PR to fix this and the fix will be in 5.6.6.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 7, 2017, 3:03am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/4 "2017-12-07T03:03:26Z")

</div>

The internal PR to fix this is opened. Thanks for the report.

---

<div class="post-metadata">

**Author:** ![ize0j10](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@ize0j10](https://discuss.elastic.co/u/ize0j10)\
**Post date:** [December 7, 2017, 7:45am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/5 "2017-12-07T07:45:17Z")

</div>

Thank you for fast reply. The error message says that if somaxconn cannot be read the fallback of 128 is used.

Just to keep this in mind a question comes up.

In my scenario there is a cluster with 1:1 relationships for kibana, logstash and elasticsearch:  
1 logstash with 16 output workers -\> 1 elasticsearch node  
1 kibana -\> 1 elasticsearch node

I assume this means that there are 128 default somaxconn minus 16 output workers = 112 availble connections for Kibana.

Will there be an issue with unavailable elasticsearch connections when more than 112 users are logged on into Kibana?

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 7, 2017, 11:42am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/6 "2017-12-07T11:42:45Z")

</div>

That is not what `somaxconn` means, it does not mean the maximum number of connections. Instead it (roughly) refers to the maximum queue length for the backlog on a socket in the listen state of completely established socket connections that are waiting to be accepted. This only needs to be increased if you have a listening socket for which you frequently expect huge bursts of new connections. This can be the case in a large cluster (e.g., in a 100-node at startup as the nodes all try to pairwise form 13 connections with each other).

---

<div class="post-metadata">

**Author:** ![ize0j10](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@ize0j10](https://discuss.elastic.co/u/ize0j10)\
**Post date:** [December 7, 2017, 11:56am UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/7 "2017-12-07T11:56:55Z")

</div>

Thanks for clearification. Glad to hear we are on the save side.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 7, 2017, 2:05pm UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/8 "2017-12-07T14:05:14Z")

</div>

You are welcome. Thanks again for the report.

---

<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:** [January 4, 2018, 2:05pm UTC](https://discuss.elastic.co/t/elasticsearch-java-security-manager-somaxconn-read-permissions/110511/9 "2018-01-04T14:05:27Z")

</div>

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