Snaphsot repository Read Only URL via FTP

I have an Elasticsearch cluster of 3 nodes with version 7.15.0.
I want to add a read-only URL repository soi can fetch a snapshot for restore.

PUT /_snapshot/ftp_snaphoot
  "type": "url",
  "settings": {
    "url": "ftp://username:password@ftp_server_ip_adress"

I got this error

  "error" : {
    "root_cause" : [
        "type" : "repository_exception",
        "reason" : "[ftp_snaphoot] Could not determine repository generation from root blobs"
    "type" : "repository_exception",
    "reason" : "[ftp_snaphoot] Could not determine repository generation from root blobs",
    "caused_by" : {
      "type" : "security_exception",
      "reason" : "access denied (\"\" \"localhost:0\" \"listen,resolve\")"
  "status" : 500

When the username login to ftp_server_ip_adress using FTP, it's directly located into a respository with a snapshot. This respository is used as FS to take snapshot from the cluster.

This is the stack trace reported by in Elasticsearch logs

{"type": "server", "timestamp": "2021-10-23T16:33:46,248Z", "level": "WARN", "component": "r.suppressed", "": "docker-cluster", "": "elasticsearch_1", "message": "path: /_snapshot/ftp_snaphoot/_verify, params: {repository=ftp_snaphoot}", "cluster.uuid": "JLG6niOySXmX9mJkzv1I0w", "": "D0H2EJblRmaBrwohfQBFPw" ,
"stacktrace": ["org.elasticsearch.transport.RemoteTransportException: [elasticsearch_3][][cluster:admin/repository/verify]",
"Caused by: org.elasticsearch.repositories.RepositoryVerificationException: [ftp_snaphoot] path  is not accessible on master node",
"Caused by: java.lang.SecurityException: access denied (\"\" \"localhost:0\" \"listen,resolve\")",
"at ~[?:?]",
"at ~[?:?]",
"at java.lang.SecurityManager.checkPermission( ~[?:?]",
"at java.lang.SecurityManager.checkListen( ~[?:?]",
"at ~[?:?]",
"at ~[?:?]",
"at ~[?:?]",
"at ~[?:?]",
"at ~[?:?]",
"at ~[?:?]",
"at ~[?:?]",
"at org.elasticsearch.common.blobstore.url.URLBlobContainer.getInputStream( ~[?:?]",
"at org.elasticsearch.common.blobstore.url.URLBlobContainer.readBlob( ~[?:?]",
"at org.elasticsearch.repositories.blobstore.BlobStoreRepository.readSnapshotIndexLatestBlob( ~[elasticsearch-7.15.0.jar:7.15.0]",
"at org.elasticsearch.repositories.blobstore.BlobStoreRepository.latestIndexBlobId( ~[elasticsearch-7.15.0.jar:7.15.0]",
"at org.elasticsearch.repositories.blobstore.BlobStoreRepository.startVerification( ~[elasticsearch-7.15.0.jar:7.15.0]",
"at org.elasticsearch.repositories.RepositoriesService$4.doRun( ~[elasticsearch-7.15.0.jar:7.15.0]",
"at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun( ~[elasticsearch-7.15.0.jar:7.15.0]",
"at ~[elasticsearch-7.15.0.jar:7.15.0]",
"at java.util.concurrent.ThreadPoolExecutor.runWorker( ~[?:?]",
"at java.util.concurrent.ThreadPoolExecutor$ ~[?:?]",
"at [?:?]"] }

It looks like FTP-based URL repositories simply don't work: the FTP client is trying to do something that the security manager forbids. This code hasn't changed in well over a decade so I guess you're the first person to actually try doing this. Please report it on Github as a bug - at the very least we should remove ftp from the list of URL schemes that are documented as supported. In the meantime I'd suggest using HTTP instead.

Thanks @DavidTurner for your feedbakc
I reported an issue here Snaphsot repository Read Only URL via FTP not accepting FTP URL · Issue #79685 · elastic/elasticsearch · GitHub
Hope that will help.

My idea is to use FTP repo on a remote cluster when i need to restore the snaphot from the main cluster. and using an FTP repo (ReadOnly) is a good option for me to avoid mounting NFS ...

1 Like

Yes, makes sense, but FTP is a fairly obscure protocol these days as you have discovered. It doesn't do anything that HTTP(S) can't.

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