# Unable to start Elasticsearch - java.lang.IllegalStateException: Duplicate key org.elasticsearch.plugins.PluginsService$Bundle@e3623fe

**URL:** <https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847>\
**Category:** Elasticsearch\
**Created:** [March 5, 2019, 8:57am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847 "2019-03-05T08:57:01Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![subhas](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@subhas](https://discuss.elastic.co/u/subhas)\
**Post date:** [March 8, 2019, 4:20pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/21 "2019-03-08T16:20:35Z")

</div>

I have given adequate information. Please provide the solution.

---

<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 8, 2019, 4:43pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/22 "2019-03-08T16:43:55Z")

</div>

Where? I just want to be sure that I do have the right information. So please do it again and share the complete output.

I looked at the source code and I don't understand how this can happen TBH.

My next suggestion is to download in another dir the tar.gz 6.6.1 distribution (not the rpm one), unzip it and launch it locally. And see what is happening.

May be you do have some ENV variables that are somewhat conflicting? That's what we can hopefully figure out if you test it.

---

<div class="post-metadata">

**Author:** ![Nathan\_Sowatskey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_sowatskey/32/42778_2.png) [@Nathan\_Sowatskey](https://discuss.elastic.co/u/Nathan_Sowatskey)\
**Post date:** [April 1, 2019, 9:06am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/23 "2019-04-01T09:06:44Z")

</div>

I have the same issue after reinstalling on macOS with Homebrew:

```auto
elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file logs/gc.log due to No such file or directory

[2019-04-01T11:03:23,837][INFO][o.e.e.NodeEnvironment] [KQayVM1] using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [951.2gb], net total_space [1.8tb], types [apfs]
[2019-04-01T11:03:23,852][INFO][o.e.e.NodeEnvironment] [KQayVM1] heap size [989.8mb], compressed ordinary object pointers [true]
[2019-04-01T11:03:23,864][INFO][o.e.n.Node] [KQayVM1] node name derived from node ID [KQayVM1ZTRWVQfJbgrnbTQ]; set [node.name] to override
[2019-04-01T11:03:23,864][INFO][o.e.n.Node] [KQayVM1] version[6.7.0], pid[11489], build[oss/tar/8453f77/2019-03-21T15:32:29.844721Z], OS[Mac OS X/10.14.4/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_192/25.192-b12]
[2019-04-01T11:03:23,864][INFO][o.e.n.Node] [KQayVM1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/var/folders/t_/8nf2m8hd56v9v6h2gxzyhbhh0000gn/T/elasticsearch-7413103318878119681, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/local/Cellar/elasticsearch/6.7.0/libexec, -Des.path.conf=/usr/local/etc/elasticsearch, -Des.distribution.flavor=oss, -Des.distribution.type=tar]
[2019-04-01T11:03:23,905][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [KQayVM1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Duplicate key org.elasticsearch.plugins.PluginsService$Bundle@dfcd13ae
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.7.0.jar:6.7.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.7.0.jar:6.7.0]
Caused by: java.lang.IllegalStateException: Duplicate key org.elasticsearch.plugins.PluginsService$Bundle@dfcd13ae
	at java.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133) ~[?:1.8.0_192]
	at java.util.HashMap.merge(HashMap.java:1254) ~[?:1.8.0_192]
	at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320) ~[?:1.8.0_192]
	at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169) ~[?:1.8.0_192]
	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_192]
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:1.8.0_192]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_192]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_192]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_192]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_192]
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_192]
	at org.elasticsearch.plugins.PluginsService.sortBundles(PluginsService.java:420) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:466) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:163) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.node.Node.<init>(Node.java:339) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.7.0.jar:6.7.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.7.0.jar:6.7.0]
	... 6 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:** [April 1, 2019, 9:35am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/24 "2019-04-01T09:35:28Z")

</div>

@Nathan_Sowatskey did you upgrade from a previous version?

---

<div class="post-metadata">

**Author:** ![Nathan\_Sowatskey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_sowatskey/32/42778_2.png) [@Nathan\_Sowatskey](https://discuss.elastic.co/u/Nathan_Sowatskey)\
**Post date:** [April 1, 2019, 10:03am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/25 "2019-04-01T10:03:43Z")

</div>

I removed the previous version, and then installed a new version. So, yes, this is an upgrade.

Thanks

Nathan

---

<div class="post-metadata">

**Author:** ![Nathan\_Sowatskey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_sowatskey/32/42778_2.png) [@Nathan\_Sowatskey](https://discuss.elastic.co/u/Nathan_Sowatskey)\
**Post date:** [April 1, 2019, 10:22am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/26 "2019-04-01T10:22:50Z")

</div>

The solution here is to manually remove the `/usr/local/var/elasticsearch/plugins/` after an uninstall, and then you can install a new version. The same also applies to `/usr/local/var/lib/elasticsearch/<elasticsearch_your name>`.

Regards

Nathan

---

<div class="post-metadata">

**Author:** ![subhas](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@subhas](https://discuss.elastic.co/u/subhas)\
**Post date:** [April 1, 2019, 10:36am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/27 "2019-04-01T10:36:51Z")

</div>

Yeah, I uninstalled ES completely and install it again to get the service back.

But do we have to uninstall and reinstall everytime we face this issue? If so how do we back up the data and restore in the new installation?

Thanks,  
Subhas

---

<div class="post-metadata">

**Author:** ![aviator](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@aviator](https://discuss.elastic.co/u/aviator)\
**Post date:** [April 2, 2019, 9:31am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/28 "2019-04-02T09:31:46Z")

</div>

Have just yum'd CentOS 7 and Elasticsearch fails to start with:

> [2019-04-02T10:17:51,444][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [es-node01] uncaught exception in thread [main]  
> org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Duplicate key org.elasticsearch.plugins.PluginsService$Bundle@30acf5ab

Have always had to remove and install the geo-ip plugins but believe those plugins are now modules?

Not convinced uninstalling the installation is the correct route - is there a simpler route to getting ES running again?

Regards

Ed

---

<div class="post-metadata">

**Author:** ![Detlef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/detlef/32/38723_2.png) [@Detlef](https://discuss.elastic.co/u/Detlef)\
**Post date:** [April 23, 2019, 1:32pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/29 "2019-04-23T13:32:26Z")

</div>

I have the same problem after upgrading from 6.6.1 to 6.7.1.

---

<div class="post-metadata">

**Author:** ![aviator](https://avatars.discourse-cdn.com/v4/letter/a/9de053/32.png) [@aviator](https://discuss.elastic.co/u/aviator)\
**Post date:** [April 25, 2019, 9:13am UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/30 "2019-04-25T09:13:10Z")

</div>

If the geo-ip plugin is removed and the folder deleted (as per Nathan post) then the upgrade (in my case yum) is performed correctly to 6.7.1.  
Note I had an issue with KIbana and templates which turned out to be a permissions issue (topic launched in Kibana forum) and since fixed.

Regards

Ed

---

<div class="post-metadata">

**Author:** ![Detlef](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/detlef/32/38723_2.png) [@Detlef](https://discuss.elastic.co/u/Detlef)\
**Post date:** [April 25, 2019, 12:11pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/31 "2019-04-25T12:11:24Z")

</div>

Thanks for the update. I've deleted the plugin directory. Additionally I submitted the following command:  
./bin/elasticsearch-plugin remove --purge ingest-geoip

After that, the elasticsearch engine started up again.  
I performed the installation under Ubuntu 16.04.06 LTS.

Cheers  
Detlef

---

<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:** [May 23, 2019, 12:11pm UTC](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847/32 "2019-05-23T12:11:26Z")

</div>

Closed on May 23, 2019, 12:11pm UTC

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

[Previous page](https://discuss.elastic.co/t/unable-to-start-elasticsearch-java-lang-illegalstateexception-duplicate-key-org-elasticsearch-plugins-pluginsservice-bundle-e3623fe/170847.md?page=1)
