<p dir="auto">Elasticsearch generates an InvalidShapeException from polygons generated by PostGIS:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="MapperParsingException[failed to parse [catchment_mpoly]]; nested: InvalidShapeException[Provided shape has duplicate consecutive coordinates at: (145.105506775, -37.791859504, NaN)]"><pre class="notranslate"><code class="notranslate">MapperParsingException[failed to parse [catchment_mpoly]]; nested: InvalidShapeException[Provided shape has duplicate consecutive coordinates at: (145.105506775, -37.791859504, NaN)]
</code></pre></div>
<p dir="auto">This particular check seems overzealous.</p>
<p dir="auto">It's also surprising, given that the polygons are being fed through <code class="notranslate">ST_SimplifyPreserveTopology</code>. It is generating errors after its own precision is applied?</p>
<p dir="auto">This is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="125913435" data-permission-text="Title is private" data-url="https://github.com/elastic/elasticsearch/issues/15880" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/15880/hovercard" href="https://github.com/elastic/elasticsearch/issues/15880">#15880</a></p>
<p dir="auto">To replicate, copy the config directory to a new location and add a simple tribe config, eg:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cp -a elasticsearch-2.2.0/config tribe
echo &quot;tribe.t1.cluster.name: foo&quot; &gt;&gt; tribe/elasticsearch.yml"><pre class="notranslate"><code class="notranslate">cp -a elasticsearch-2.2.0/config tribe
echo "tribe.t1.cluster.name: foo" &gt;&gt; tribe/elasticsearch.yml
</code></pre></div>
<p dir="auto">Start the tribe node as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./elasticsearch-2.2.0/bin/elasticsearch --path.conf tribe"><pre class="notranslate"><code class="notranslate">./elasticsearch-2.2.0/bin/elasticsearch --path.conf tribe
</code></pre></div>
<p dir="auto">The process dies with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread &quot;main&quot; java.security.AccessControlException: access denied (&quot;java.io.FilePermission&quot; &quot;/Users/clinton/workspace/servers/elasticsearch-2.2.0/config/hunspell&quot; &quot;read&quot;)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at sun.nio.fs.UnixPath.checkRead(UnixPath.java:795)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:49)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.Files.isDirectory(Files.java:2192)
at org.elasticsearch.indices.analysis.HunspellService.scanAndLoadDictionaries(HunspellService.java:127)
at org.elasticsearch.indices.analysis.HunspellService.&lt;init&gt;(HunspellService.java:102)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at &lt;&lt;&lt;guice&gt;&gt;&gt;
at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:200)
at org.elasticsearch.tribe.TribeClientNode.&lt;init&gt;(TribeClientNode.java:35)
at org.elasticsearch.tribe.TribeService.&lt;init&gt;(TribeService.java:141)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at &lt;&lt;&lt;guice&gt;&gt;&gt;
at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:200)
at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)"><pre class="notranslate"><code class="notranslate">Exception in thread "main" java.security.AccessControlException: access denied ("java.io.FilePermission" "/Users/clinton/workspace/servers/elasticsearch-2.2.0/config/hunspell" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at sun.nio.fs.UnixPath.checkRead(UnixPath.java:795)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:49)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.Files.isDirectory(Files.java:2192)
at org.elasticsearch.indices.analysis.HunspellService.scanAndLoadDictionaries(HunspellService.java:127)
at org.elasticsearch.indices.analysis.HunspellService.&lt;init&gt;(HunspellService.java:102)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at &lt;&lt;&lt;guice&gt;&gt;&gt;
at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:200)
at org.elasticsearch.tribe.TribeClientNode.&lt;init&gt;(TribeClientNode.java:35)
at org.elasticsearch.tribe.TribeService.&lt;init&gt;(TribeService.java:141)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at &lt;&lt;&lt;guice&gt;&gt;&gt;
at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:200)
at org.elasticsearch.node.Node.&lt;init&gt;(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
</code></pre></div>
<p dir="auto">The reason for this is that, when the tribe node tries to create a client to connect to the cluster, it doesn't pass on the <code class="notranslate">path.conf</code> setting to the client, so that when HunspellService tries to <a href="https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/indices/analysis/HunspellService.java#L114">resolve the hunspell directory</a> it uses <code class="notranslate">path.home</code> instead of the custom <code class="notranslate">path.conf</code>.</p>
<p dir="auto">Adding the absolute config path to the tribe node configuration works around this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="echo &quot;tribe.t1.path.conf: /Users/clinton/workspace/servers/tribe/&quot; &gt;&gt; tribe/elasticsearch.yml"><pre class="notranslate"><code class="notranslate">echo "tribe.t1.path.conf: /Users/clinton/workspace/servers/tribe/" &gt;&gt; tribe/elasticsearch.yml
</code></pre></div>