# Access to UNC paths from ElasticSearch service on Azure for snapshots

**URL:** <https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387>\
**Category:** Elasticsearch\
**Created:** [September 30, 2015, 9:06am UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387 "2015-09-30T09:06:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![saurabhsuppal](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@saurabhsuppal](https://discuss.elastic.co/u/saurabhsuppal)\
**Post date:** [September 30, 2015, 9:06am UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387/1 "2015-09-30T09:06:37Z")

</div>

I have mounted Azure File services as a UNC path on all the nodes in the ES cluster and trying to use this location as Elasticsearch repository path(location where ES stores its snapshots).  
But ES is unable to create any folders on this share and it fails with the below error when I give a create repository command : (This only happens when ES runs as a service )

Command:  
PUT \_snapshot/fs\_backup  
{  
"type": "fs",  
"settings": {  
"location": "backup1",  
"compress": true  
}  
}

Error:  
[2015-09-28 09:36:08,138][WARN][repositories] [SASUPP-NODE-M01] failed to create repository [fs\_backup]  
org.elasticsearch.repositories.RepositoryException: [fs\_backup] failed to create repository  
at org.elasticsearch.repositories.RepositoriesService.createRepositoryHolder(RepositoriesService.java:414)  
at org.elasticsearch.repositories.RepositoriesService.registerRepository(RepositoriesService.java:371)  
at org.elasticsearch.repositories.RepositoriesService.access$100(RepositoriesService.java:55)  
at org.elasticsearch.repositories.RepositoriesService$1.execute(RepositoriesService.java:110)  
at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:374)  
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:196)  
at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:162)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:724)  
Caused by: org.elasticsearch.common.inject.CreationException: Guice creation errors:

1. Error injecting constructor, org.elasticsearch.common.blobstore.BlobStoreException: Failed to create directory at [\[sasuppintst.file.core.windows.net](http://sasuppintst.file.core.windows.net)\es-backup-smb\elasticsearch-backups\backup1]  
at org.elasticsearch.repositories.fs.FsRepository.(Unknown Source)  
while locating org.elasticsearch.repositories.fs.FsRepository  
while locating org.elasticsearch.repositories.Repository

1 error  
at org.elasticsearch.common.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:344)  
at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:178)  
at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)  
at org.elasticsearch.common.inject.InjectorImpl.createChildInjector(InjectorImpl.java:131)  
at org.elasticsearch.common.inject.ModulesBuilder.createChildInjector(ModulesBuilder.java:69)  
at org.elasticsearch.repositories.RepositoriesService.createRepositoryHolder(RepositoriesService.java:407)  
... 9 more  
Caused by: org.elasticsearch.common.blobstore.BlobStoreException: Failed to create directory at [\[sasuppintst.file.core.windows.net](http://sasuppintst.file.core.windows.net)\es-backup-smb\elasticsearch-backups\backup1]  
at org.elasticsearch.common.blobstore.fs.FsBlobStore.(FsBlobStore.java:49)  
at org.elasticsearch.repositories.fs.FsRepository.(FsRepository.java:88)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)  
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)  
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)  
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)  
at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:54)  
at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)  
at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)  
at org.elasticsearch.common.inject.FactoryProxy.get(FactoryProxy.java:52)  
at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)  
at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)  
at ...

Does anyone know what could be the reason behind this behavior ?

I used below wiki to mount the UNC path (Azure file service on a node):

> **[Persisting connections to Microsoft Azure Files](https://blogs.msdn.microsoft.com/windowsazurestorage/2014/05/26/persisting-connections-to-microsoft-azure-files/)**
>
> We recently blogged about our preview release of Azure Storage Files here. The post contained information on Azure Files, how to get started by applying for preview and explained some tools that we have to help you create the share and transfer data....

Regards,  
Saurabh

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 30, 2015, 1:57pm UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387/2 "2015-09-30T13:57:22Z")

</div>

Does the user have permission to create directories under the mount?

---

<div class="post-metadata">

**Author:** ![saurabhsuppal](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@saurabhsuppal](https://discuss.elastic.co/u/saurabhsuppal)\
**Post date:** [October 1, 2015, 5:58am UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387/3 "2015-10-01T05:58:27Z")

</div>

The logon user has the permission to create folders. This is the reason I do not get this error when elastic search runs as a process (since it is running in the context of the logged in user.)  
But when Elastic Search is running as a service (under LOCAL SYSTEM account), I get this error.

---

<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:** [October 1, 2015, 6:15am UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387/4 "2015-10-01T06:15:21Z")

</div>

Does the `LOCAL SYSTEM` has permission to create/remove files in this folder?

---

<div class="post-metadata">

**Author:** ![saurabhsuppal](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@saurabhsuppal](https://discuss.elastic.co/u/saurabhsuppal)\
**Post date:** [October 1, 2015, 2:58pm UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387/5 "2015-10-01T14:58:10Z")

</div>

gave permissions to LOCAL SYSTEM by switching to system context using psexec and doing a net use of the share.  
Things are working now.  
Thanks.

---

<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 5, 2017, 11:47pm UTC](https://discuss.elastic.co/t/access-to-unc-paths-from-elasticsearch-service-on-azure-for-snapshots/31387/6 "2017-07-05T23:47:12Z")

</div>


