# Incomplete reindexing

**URL:** <https://discuss.elastic.co/t/incomplete-reindexing/214207>\
**Category:** Elasticsearch\
**Created:** [January 8, 2020, 10:05am UTC](https://discuss.elastic.co/t/incomplete-reindexing/214207 "2020-01-08T10:05:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reddihareesh](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@reddihareesh](https://discuss.elastic.co/u/reddihareesh)\
**Post date:** [January 8, 2020, 10:05am UTC](https://discuss.elastic.co/t/incomplete-reindexing/214207/1 "2020-01-08T10:05:55Z")

</div>

I wanted to reindex an index called `test_dupes_2year_double` to combine a `date` field and a `time` field to add new field `datetime` to a new index called `datetime_srldc`.

```
POST _reindex
{
  "source": {
    "index": "test_dupes_2year_double"
  },
  "dest": {
    "index": "datetime_srldc"
  },
  "script": {
    "lang": "painless",
    "source": """
    int valuee = 0;
    valuee=(int)((Long.parseUnsignedLong(ctx._source.time_stamp))/1000000000);
    int p1 = valuee % 60;
    int p2 = valuee / 60;
    int p3 = p2 % 60;
    p2 = p2 / 60;
    
    String s1;
    if (p2<=9 || p3<=9) {
      if (p2<=9 && p3<=9) {
        s1 = "0" + Integer.toString(p2) + ":" + "0" + Integer.toString(p3) + ":" + Integer.toString(p1) + "0";
      }
      else if (p2<=9) {
        s1 = "0" + Integer.toString(p2) + ":" + Integer.toString(p3) + ":" + Integer.toString(p1) + "0";
      }
      else if(p3<=9) {
        s1 = Integer.toString(p2) + ":" + "0" + Integer.toString(p3) + ":" + Integer.toString(p1) + "0";
      }
    }
    else {
      s1 = Integer.toString(p2) + ":" + Integer.toString(p3) + ":" + Integer.toString(p1) + "0";
    }
    
    ctx._source.time=s1;
    
    s1 = ctx._source.date + "T" + s1 + ".000Z";
    
    ctx._source.datetime=s1;
    """
  }
}

```

But the reindexing used to give timeout error, so I increased the timeout limit. then it took some time and finally gave following error. Though it ended up with an error, the new index was created with partial data.

Error:

```
{
  "took": 24858,
  "timed_out": false,
  "total": 845750,
  "updated": 0,
  "created": 8000,
  "deleted": 0,
  "batches": 9,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": [
    {
      "index": "datetime_srldc",
      "type": "_doc",
      "id": "fEZDy24BMbXag5rgCsZv",
      "cause": {
        "type": "cluster_block_exception",
        "reason": "index [datetime_srldc] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
      },
      "status": 403
    },
    {
      "index": "datetime_srldc",
      "type": "_doc",
      "id": "fUZDy24BMbXag5rgCsZv",
      "cause": {
        "type": "cluster_block_exception",
        "reason": "index [datetime_srldc] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
      },
      "status": 403
    },

```

The reindexed index has partial data as you can see bellow. So what is wrong with this?. What is the solution?.

```
    GET _cat/indices/
    yellow open test_dupes_2year_double gfIHThEiTIuHUk_Yf4PWfA 1 1 845750 0 1.4gb 1.4gb
    yellow open datetime_srldc Ybxm0BYIS4646hM7E8AYNQ 1 1 48000 0 87.5mb 87.5mb
```

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [January 8, 2020, 11:45am UTC](https://discuss.elastic.co/t/incomplete-reindexing/214207/2 "2020-01-08T11:45:29Z")

</div>

Hi @reddihareesh,

a common reason for seeing the `index read-only / allow delete (api)` block is that the disk on one of the nodes have run full. I suggest to find out if that is the case. If so, you need to either free up space (delete indices), add nodes or extend the underlying volumes.

You can find more information on the disk thresholds [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/disk-allocator.html).

---

<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:** [February 5, 2020, 11:45am UTC](https://discuss.elastic.co/t/incomplete-reindexing/214207/3 "2020-02-05T11:45:39Z")

</div>

Closed on February 5, 2020, 11:45am UTC

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