# AccessControlException: Ingest-attachment via NEST

**URL:** <https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988>\
**Category:** Elasticsearch\
**Created:** [June 12, 2017, 8:18am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988 "2017-06-12T08:18:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PierreFre](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PierreFre](https://discuss.elastic.co/u/PierreFre)\
**Post date:** [June 12, 2017, 8:18am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/1 "2017-06-12T08:18:00Z")

</div>

Hello,

i tried to insert a pdf-file in the elasticsearch database with the NEST-Interface. I got an AccessControlException.  
How i have to configure the security-policy?

Best regards,  
Pierre

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 12, 2017, 8:29am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/2 "2017-06-12T08:29:39Z")

</div>

Sorry Pierre but we need more context and logs.

---

<div class="post-metadata">

**Author:** ![PierreFre](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PierreFre](https://discuss.elastic.co/u/PierreFre)\
**Post date:** [June 12, 2017, 8:39am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/3 "2017-06-12T08:39:49Z")

</div>

Iam using the current Version 5.4.1 of elasticsearch. With the Version 5.3.1 i have no access problems.

```
[2017-06-12T10:05:33,945][INFO][o.e.n.Node] [] initializing ...
[2017-06-12T10:05:34,164][INFO][o.e.e.NodeEnvironment] [GP19L4_] using [1] data paths, mounts [[Data (D:)]], net usable_space [54.2gb], net total_space [113.4gb], spins? [unknown], types [NTFS]
[2017-06-12T10:05:34,164][INFO][o.e.e.NodeEnvironment] [GP19L4_] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-06-12T10:05:34,180][INFO][o.e.n.Node] node name [GP19L4_] derived from node ID [GP19L4_SQDC6Vk3ibiqYug]; set [node.name] to override
[2017-06-12T10:05:34,180][INFO][o.e.n.Node] version[5.4.1], pid[1364], build[2cfe0df/2017-05-29T16:05:51.443Z], OS[Windows 7/6.1/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_131/25.131-b11]
[2017-06-12T10:05:34,180][INFO][o.e.n.Node] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+DisableExplicitGC, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Delasticsearch, -Des.path.home=D:\dev\prototypes\elasticsearch-5.4.1]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [aggs-matrix-stats]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [ingest-common]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [lang-expression]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [lang-groovy]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [lang-mustache]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [lang-painless]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [percolator]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [reindex]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [transport-netty3]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded module [transport-netty4]
[2017-06-12T10:05:35,272][INFO][o.e.p.PluginsService] [GP19L4_] loaded plugin [ingest-attachment]
[2017-06-12T10:05:37,674][INFO][o.e.d.DiscoveryModule] [GP19L4_] using discovery type [zen]
[2017-06-12T10:05:38,392][INFO][o.e.n.Node] initialized
[2017-06-12T10:05:38,392][INFO][o.e.n.Node] [GP19L4_] starting ...
[2017-06-12T10:05:39,437][INFO][o.e.t.TransportService] [GP19L4_] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2017-06-12T10:05:42,542][INFO][o.e.c.s.ClusterService] [GP19L4_] new_master {GP19L4_}{GP19L4_SQDC6Vk3ibiqYug}{P6xz5t1iSG2xKsKSGWu-SA}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-06-12T10:05:42,589][INFO][o.e.g.GatewayService] [GP19L4_] recovered [0] indices into cluster_state
[2017-06-12T10:05:43,088][INFO][o.e.h.n.Netty4HttpServerTransport] [GP19L4_] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2017-06-12T10:05:43,088][INFO][o.e.n.Node] [GP19L4_] started
```

---

<div class="post-metadata">

**Author:** ![PierreFre](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PierreFre](https://discuss.elastic.co/u/PierreFre)\
**Post date:** [June 12, 2017, 8:40am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/4 "2017-06-12T08:40:14Z")

</div>

The Error:

```
[2017-06-12T10:08:39,825][INFO][o.e.c.m.MetaDataCreateIndexService] [GP19L4_] [documents] creating index, cause [api], templates [], shards [5]/[1], mappings [document]
[2017-06-12T10:08:41,372][ERROR][o.a.p.p.f.FileSystemFontProvider] Error accessing the file system
java.security.AccessControlException: access denied ("java.io.FilePermission" "<<ALL FILES>>" "execute")
	at java.security.AccessControlContext.checkPermission(Unknown Source) ~[?:1.8.0_131]
	at java.security.AccessController.checkPermission(Unknown Source) ~[?:1.8.0_131]
	at java.lang.SecurityManager.checkPermission(Unknown Source) ~[?:1.8.0_131]
	at java.lang.SecurityManager.checkExec(Unknown Source) ~[?:1.8.0_131]
	at java.lang.ProcessBuilder.start(Unknown Source) ~[?:1.8.0_131]
	at java.lang.Runtime.exec(Unknown Source) ~[?:1.8.0_131]
	at java.lang.Runtime.exec(Unknown Source) ~[?:1.8.0_131]
	at java.lang.Runtime.exec(Unknown Source) ~[?:1.8.0_131]
	at org.apache.fontbox.util.autodetect.WindowsFontDirFinder.getWinDir(WindowsFontDirFinder.java:47) ~[?:2.0.3]
	at org.apache.fontbox.util.autodetect.WindowsFontDirFinder.find(WindowsFontDirFinder.java:79) ~[?:2.0.3]
	at org.apache.fontbox.util.autodetect.FontFileFinder.find(FontFileFinder.java:74) ~[?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.FileSystemFontProvider.<init>(FileSystemFontProvider.java:205) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.FontMapperImpl$DefaultFontProvider.<clinit>(FontMapperImpl.java:130) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.FontMapperImpl.getProvider(FontMapperImpl.java:149) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.FontMapperImpl.findFont(FontMapperImpl.java:413) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.FontMapperImpl.getTrueTypeFont(FontMapperImpl.java:321) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.<init>(PDTrueTypeFont.java:198) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:75) [?:2.0.3]
	at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:143) [?:2.0.3]
	at org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:60) [?:2.0.3]
	at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:815) [?:2.0.3]
	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472) [?:2.0.3]
	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446) [?:2.0.3]
	at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149) [?:2.0.3]
	at org.apache.pdfbox.text.LegacyPDFStreamEngine.processPage(LegacyPDFStreamEngine.java:139) [?:2.0.3]
	at org.apache.pdfbox.text.PDFTextStripper.processPage(PDFTextStripper.java:391) [?:2.0.3]
	at org.apache.tika.parser.pdf.PDF2XHTML.processPage(PDF2XHTML.java:141) [?:1.14]
	at org.apache.pdfbox.text.PDFTextStripper.processPages(PDFTextStripper.java:319) [?:2.0.3]
	at org.apache.pdfbox.text.PDFTextStripper.writeText(PDFTextStripper.java:266) [?:2.0.3]
	at org.apache.tika.parser.pdf.PDF2XHTML.process(PDF2XHTML.java:111) [?:1.14]
	at org.apache.tika.parser.pdf.PDFParser.parse(PDFParser.java:150) [?:1.14]
	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) [?:1.14]
	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120) [?:1.14]
	at org.apache.tika.Tika.parseToString(Tika.java:568) [?:1.14]
	at org.elasticsearch.ingest.attachment.TikaImpl$1.run(TikaImpl.java:103) [?:5.4.1]
	at org.elasticsearch.ingest.attachment.TikaImpl$1.run(TikaImpl.java:100) [?:5.4.1]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_131]
	at org.elasticsearch.ingest.attachment.TikaImpl.parse(TikaImpl.java:100) [?:5.4.1]
	at org.elasticsearch.ingest.attachment.AttachmentProcessor.execute(AttachmentProcessor.java:86) [?:5.4.1]
	at org.elasticsearch.ingest.CompoundProcessor.execute(CompoundProcessor.java:100) [?:5.4.1]
	at org.elasticsearch.ingest.Pipeline.execute(Pipeline.java:58) [?:5.4.1]
	at org.elasticsearch.ingest.PipelineExecutionService.innerExecute(PipelineExecutionService.java:166) [?:5.4.1]
	at org.elasticsearch.ingest.PipelineExecutionService.access$000(PipelineExecutionService.java:41) [?:5.4.1]
	at org.elasticsearch.ingest.PipelineExecutionService$2.doRun(PipelineExecutionService.java:88) [?:5.4.1]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) [?:5.4.1]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [?:5.4.1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_131]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
[2017-06-12T10:08:41,388][WARN][o.a.p.p.f.PDTrueTypeFont] Using fallback font 'LiberationSans' for 'Arial'
[2017-06-12T10:08:41,435][ERROR][o.a.p.p.f.PDCIDFontType2] OpenType Layout tables used in font Arial,Bold are not implemented in PDFBox and will be ignored
[2017-06-12T10:08:41,435][WARN][o.a.p.p.f.PDTrueTypeFont] Using fallback font 'LiberationSans' for 'Arial,Bold'
[2017-06-12T10:08:41,528][ERROR][o.a.p.p.f.PDCIDFontType2] OpenType Layout tables used in font Arial are not implemented in PDFBox and will be ignored
[2017-06-12T10:33:27,171][INFO][o.e.b.Bootstrap] running graceful exit on windows
[2017-06-12T10:33:27,186][INFO][o.e.n.Node] [GP19L4_] stopping ...
[2017-06-12T10:33:27,264][INFO][o.e.n.Node] [GP19L4_] stopped
[2017-06-12T10:33:27,264][INFO][o.e.n.Node] [GP19L4_] closing ...
[2017-06-12T10:33:27,280][INFO][o.e.n.Node] [GP19L4_] closed
```

---

<div class="post-metadata">

**Author:** ![PierreFre](https://avatars.discourse-cdn.com/v4/letter/p/e47c2d/32.png) [@PierreFre](https://discuss.elastic.co/u/PierreFre)\
**Post date:** [June 12, 2017, 8:50am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/5 "2017-06-12T08:50:51Z")

</div>

I restarted the elasticsearch and went through the code with breakpoints. Now, it is working.

Best regards,  
Pierre

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 12, 2017, 9:52am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/6 "2017-06-12T09:52:54Z")

</div>

Is it working for the same exact file you were using at the beginning? Asking that because if you can reproduce it I'll be interested of your source binary file.

---

<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 10, 2017, 9:53am UTC](https://discuss.elastic.co/t/accesscontrolexception-ingest-attachment-via-nest/88988/7 "2017-07-10T09:53:24Z")

</div>

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