# How to disable Filesystem/URL Snapshots in 2.x

**URL:** <https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776>\
**Category:** Elasticsearch\
**Created:** [March 17, 2016, 9:45pm UTC](https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776 "2016-03-17T21:45:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Malpani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_malpani/32/14566_2.png) [@Ankit\_Malpani](https://discuss.elastic.co/u/Ankit_Malpani)\
**Post date:** [March 17, 2016, 9:45pm UTC](https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776/1 "2016-03-17T21:45:39Z")

</div>

I want to disable FS and URL snapshots in Elasticsearch 2.x. Essentially do not want users of the cluster messing around with the filesystem. Users are allowed to configure S3 repositories only.

I achieved this in 1.x by having a plugin do the following  
`
repositoriesModule.registerRepository(FsRepository.TYPE, AbstractModule.class)
`

But 2.x seems to disallow registering same module twice and throws the following error

`
[2016-03-17 14:40:43,195][ERROR][bootstrap] Exception
ElasticsearchException[failed to invoke onModule]; nested: InvocationTargetException; nested: IllegalArgumentException[Can't register the same [repository] more than once for [url]];
        at org.elasticsearch.plugins.PluginsService.processModule(PluginsService.java:232)
        at org.elasticsearch.plugins.PluginsService.processModules(PluginsService.java:217)
        at org.elasticsearch.node.Node.(Node.java:198)
        at org.elasticsearch.node.Node.(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)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.elasticsearch.plugins.PluginsService.processModule(PluginsService.java:229)
        ... 7 more
Caused by: java.lang.IllegalArgumentException: Can't register the same [repository] more than once for [url]
        at org.elasticsearch.common.util.ExtensionPoint$ClassMap.registerExtension(ExtensionPoint.java:104)
        at org.elasticsearch.repositories.RepositoryTypesRegistry.registerRepository(RepositoryTypesRegistry.java:39)
        at org.elasticsearch.repositories.RepositoriesModule.registerRepository(RepositoriesModule.java:48)
        at org.elasticsearch.plugin.cloud.aws.CloudAwsPlugin.onModule(CloudAwsPlugin.java:113)
        ... 12 more
`

---

<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:** [March 18, 2016, 4:10am UTC](https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776/2 "2016-03-18T04:10:50Z")

</div>

I think that's an interesting use case and I'd probably open an issue about this: add a setting to disable fs repo on startup. Or add such a fine grained support in Shield. I don't think Shield supports that today.

@Igor_Motov WDYT?

---

<div class="post-metadata">

**Author:** ![Ankit\_Malpani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_malpani/32/14566_2.png) [@Ankit\_Malpani](https://discuss.elastic.co/u/Ankit_Malpani)\
**Post date:** [March 18, 2016, 6:31am UTC](https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776/3 "2016-03-18T06:31:18Z")

</div>

Thanks! I have filed [https://github.com/elastic/elasticsearch/issues/17181](https://github.com/elastic/elasticsearch/issues/17181)

In general, I liked the ability in 1.x to be able to override default implementations with custom plugins but I cant find a way to do something similar with 2.x

---

<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:07pm UTC](https://discuss.elastic.co/t/how-to-disable-filesystem-url-snapshots-in-2-x/44776/4 "2017-07-05T23:07:18Z")

</div>


