# Alias name duplication

**URL:** <https://discuss.elastic.co/t/alias-name-duplication/241364>\
**Category:** Elasticsearch\
**Created:** [July 15, 2020, 9:13pm UTC](https://discuss.elastic.co/t/alias-name-duplication/241364 "2020-07-15T21:13:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ugon](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@Ugon](https://discuss.elastic.co/u/Ugon)\
**Post date:** [July 15, 2020, 9:13pm UTC](https://discuss.elastic.co/t/alias-name-duplication/241364/1 "2020-07-15T21:13:53Z")

</div>

Hello 🙂

After restart of one of my clusters, data nodes fail to start because of alias name duplication. On my other clusters I have similar situations (alias name pointing to multiple indices) and i can restart my nodes just fine.

What is the expected behavior here - shouldn't aliases be allowed to point to several indices?

Is there any way I can recover those data nodes without data loss?

I'm using elasticsearch 6.7.1

```auto
    Caused by: java.lang.IllegalStateException: index and alias names need to be unique, but the following duplicates were found [mosquitto (alias of [mosquitto-2019.06.20-000005/YprlN_CSRxW7cKQcvpemCw]),mosquitto (alias of [mosquitto-2019.07.04-000007/P0LyDwz-RfeyM7IV2cWmMA]),logback-staging (alias of [logback-staging-2019.05.02-000001/duIUpr5fQmW809hj1ipMIQ]),mongo (alias of [mongo-2019.07.02-000007/-yXUiUnzQjuR3vm3OV_ENw]),mongo (alias of [mongo-2019.06.11-000004/OSbuKOnDQWOObszcx5M7Yg]),mosquitto (alias of [mosquitto-2019.07.11-000008/Q4MLQyZrTmGnvB0Meqy0mw]),mongo (alias of [mongo-2019.06.25-000006/l1uFrlV4S22WeSogqyeh8g]),logback-staging (alias of [logback-staging-2019.06.01-000002/WJhf4V8ZS4-n-SFXwI7taA]),logback-staging (alias of [logback-staging-2019.07.01-000003/9m9qlNU1TI2oC4ImpIkiCA]),mongo (alias of [mongo-2019.07.09-000008/KLXeqcBGSMaQvGdZ08k-iQ]),mongo (alias of [mongo-2019.06.18-000005/nTpLv7EkTsSMd_haDq3MDw]),mosquitto (alias of [mosquitto-2019.06.13-000004/XQfsJ321QSm7c-VobVoEVg]),mosquitto (alias of [mosquitto-2019.06.27-000006/4skwEZTXQhuobJZM4kalwQ])]
    	at org.elasticsearch.cluster.metadata.MetaData$Builder.build(MetaData.java:1118) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.gateway.MetaStateService.loadFullState(MetaStateService.java:73) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:88) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.node.Node.<init>(Node.java:499) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.7.1.jar:6.7.1]
    	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.7.1.jar:6.7.1]
    	... 6 more
    [2020-07-09T17:05:19,337][INFO][o.e.x.m.p.NativeController] [es-data-1] Native controller process has stopped - no new native processes can be started

```

---

<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:** [July 16, 2020, 12:19am UTC](https://discuss.elastic.co/t/alias-name-duplication/241364/2 "2020-07-16T00:19:32Z")

</div>

That is the idea behind aliases though.

This seems to be indicating that either there's duplicate indices or aliases though. What does `_cat/aliases?v` show?

---

<div class="post-metadata">

**Author:** ![Ugon](https://avatars.discourse-cdn.com/v4/letter/u/df705f/32.png) [@Ugon](https://discuss.elastic.co/u/Ugon)\
**Post date:** [July 16, 2020, 9:17pm UTC](https://discuss.elastic.co/t/alias-name-duplication/241364/3 "2020-07-16T21:17:12Z")

</div>

The problem is that my cluster is not running properly because after restart my data nodes do not start - they encounter that exception from first post and terminate.

This is the result of that query for me:

```auto
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];"}],"type":"master_not_discovered_exception","reason":"ClusterBlockException[blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];]","caused_by":{"type":"cluster_block_exception","reason":"blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];"}},"status":503}

```

Elected master is spewing such logs:

```auto
[2020-07-16T21:15:30,798][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [es-master-74bf46467d-zv7jn] collector [cluster_stats] failed to collect data
org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized];

```

---

<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:** [August 13, 2020, 9:17pm UTC](https://discuss.elastic.co/t/alias-name-duplication/241364/4 "2020-08-13T21:17:13Z")

</div>

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