# Illegal\_argument\_exception: index \[cwl-data-2022.10.14-0001\] is not the write index for alias \[cwl-data\]

**URL:** <https://discuss.elastic.co/t/illegal-argument-exception-index-cwl-data-2022-10-14-0001-is-not-the-write-index-for-alias-cwl-data/316910>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 18, 2022, 3:10pm UTC](https://discuss.elastic.co/t/illegal-argument-exception-index-cwl-data-2022-10-14-0001-is-not-the-write-index-for-alias-cwl-data/316910 "2022-10-18T15:10:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![waleedkh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/waleedkh/32/112125_2.png) [@waleedkh](https://discuss.elastic.co/u/waleedkh)\
**Post date:** [October 18, 2022, 3:10pm UTC](https://discuss.elastic.co/t/illegal-argument-exception-index-cwl-data-2022-10-14-0001-is-not-the-write-index-for-alias-cwl-data/316910/1 "2022-10-18T15:10:30Z")

</div>

Hi there, I have an issue where this error is coming up. I see there are two other posts in the forums with similar issues but there have been no replies.  
Here is my policy

```auto
{
  "policy": "cwl-data",
  "phase_definition": {
    "min_age": "0ms",
    "actions": {
      "set_priority": {
        "priority": 100
      },
      "rollover": {
        "max_primary_shard_size": "50gb",
        "max_age": "1d"
      }
    }
  },

  "version": 3,
  "modified_date_in_millis": 1657711552303
}

```

Here is my ILM

```auto
PUT _ilm/policy/cwl-data
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_primary_shard_size": "50gb",
            "max_age": "1d"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "delete": {
        "min_age": "14d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }
        }
      }
    }
  }
}

```

Here are details of the index giving an issue

```auto
{
  "cwl-data-2022.10.04-0001" : {
    "aliases" : {
      "cwl-data" : {
        "is_write_index" : false
      }
    },
    "mappings" : {
      "properties" : {
        "@id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "@log_group" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "@log_stream" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "@message" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "@owner" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "@severity" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "@timestamp" : {
          "type" : "date"
        }
      }
    },
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "cwl-data",
          "rollover_alias" : "cwl-data"
        },
        "routing" : {
          "allocation" : {
            "include" : {
              "_tier_preference" : "data_content"
            }
          }
        },
        "number_of_shards" : "3",
        "provided_name" : "cwl-data-2022.10.04-0001",
        "creation_date" : "1664841609454",
        "priority" : "100",
        "number_of_replicas" : "1",
        "uuid" : "xxxxxx",
        "version" : {
          "created" : "7170299"
        }
      }
    }
  }
}

```

---

<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:** [November 15, 2022, 3:10pm UTC](https://discuss.elastic.co/t/illegal-argument-exception-index-cwl-data-2022-10-14-0001-is-not-the-write-index-for-alias-cwl-data/316910/2 "2022-11-15T15:10:52Z")

</div>

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