# Access denied for restore (url type)

**URL:** https://discuss.elastic.co/t/access-denied-for-restore-url-type/72166
**Category:** Elasticsearch
**Created:** [January 19, 2017, 12:04pm UTC](https://discuss.elastic.co/t/access-denied-for-restore-url-type/72166 "2017-01-19T12:04:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tom741](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@Tom741](https://discuss.elastic.co/u/Tom741)
#### Post date: [January 19, 2017, 12:04pm UTC](https://discuss.elastic.co/t/access-denied-for-restore-url-type/72166/1 "2017-01-19T12:04:53Z")

</div>

Hello,  
I'm trying to do the following:

- I have one ES node on a remote machine (Windows).  
I configured backup in a shared folder:  
PUT /\_snapshot/bak\_videos  
{  
"type": "fs",  
"settings": {  
"compress": true,  
"location": "\\myesnode\Snapshot"  
}  
}

in the config file I added:  
path.repo: ["\\myesnode\Snapshot"]

- I made a snapshot:  
PUT /\_snapshot/bak\_videos/snap\_1

- I added an FTP access to the Snapshot folder (anonymous at the moment, is there a way to configure a user to connect to the ftp ?).

- I want to restore the data on my local machine.  
I did the following:  
PUT /\_snapshot/bak\_videos  
{  
"type": "url",  
"settings": {  
"compress": true,  
"location": "ftp://mynodeaddress"  
}  
}

and in the config file:  
repositories.url.allowed\_urls: ["ftp://mynodeaddress"]

I can access the ftp folder correctly and see the files (index-0, the indices folder ...) and can read them correctly on a classic FTP client.

The root address (ftp://mynodeaddress) is pointing to the Snapshot folder on the ES node.

Now, when I try to restore the backup on my local machine:  
POST /\_snapshot/bak\_videos/snap\_1/\_restore

I doesn't work and I have a the following error:

{  
"error": {  
"root\_cause": [  
{  
"type": "access\_control\_exception",  
"reason": "access denied ("java.net.SocketPermission" "localhost:0" "listen,resolve")"  
}  
],  
"type": "access\_control\_exception",  
"reason": "access denied ("java.net.SocketPermission" "localhost:0" "listen,resolve")"  
},  
"status": 500  
}

Here are the logs I have on my local machine:  
[2017-01-19T13:00:54,466][WARN][o.e.s.RestoreService] [jpQ47EO] [bak\_videos:snap\_1] failed to restore snapshot  
java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:0" "listen,resolve")  
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0\_111]  
at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0\_111]  
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0\_111]  
at java.lang.SecurityManager.checkListen(SecurityManager.java:1131) ~[?:1.8.0\_111]  
at java.net.Socket.bind(Socket.java:642) ~[?:1.8.0\_111]  
at sun.net.ftp.impl.FtpClient.openPassiveDataConnection(FtpClient.java:662) ~[?:?]  
at sun.net.ftp.impl.FtpClient.openDataConnection(FtpClient.java:708) ~[?:?]  
at sun.net.ftp.impl.FtpClient.getFileStream(FtpClient.java:1283) ~[?:?]  
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:428) ~[?:?]  
at java.net.URL.openStream(URL.java:1045) ~[?:1.8.0\_111]  
at org.elasticsearch.common.blobstore.url.URLBlobContainer.readBlob(URLBlobContainer.java:102) ~[elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.readSnapshotIndexLatestBlob(BlobStoreRepository.java:841) ~[elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.latestIndexBlobId(BlobStoreRepository.java:823) ~[elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.repositories.blobstore.BlobStoreRepository.getRepositoryData(BlobStoreRepository.java:721) ~[elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.snapshots.RestoreService.restoreSnapshot(RestoreService.java:195) [elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:89) [elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.action.admin.cluster.snapshots.restore.TransportRestoreSnapshotAction.masterOperation(TransportRestoreSnapshotAction.java:49) [elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.action.support.master.TransportMasterNodeAction.masterOperation(TransportMasterNodeAction.java:86) [elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$3.doRun(TransportMasterNodeAction.java:170) [elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527) [elasticsearch-5.1.1.jar:5.1.1]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.1.1.jar:5.1.1]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0\_111]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0\_111]  
at java.lang.Thread.run(Thread.java:745) [?:1.8.0\_111]

I don't really know from where this error comes from, the error does not help a lot to know where is the issue :).  
Any suggestion ?

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: [February 16, 2017, 12:05pm UTC](https://discuss.elastic.co/t/access-denied-for-restore-url-type/72166/2 "2017-02-16T12:05:15Z")

</div>

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