# Loading Sample Data Error unavailable\_shards\_exception

**URL:** <https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912>\
**Category:** Kibana\
**Created:** [May 15, 2018, 10:47am UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912 "2018-05-15T10:47:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 10:47am UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/1 "2018-05-15T10:47:23Z")

</div>

Hi,

ELK Stack version: 6.2.4

I am using [Loading Sample Data.](https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html#tutorial-load-dataset).and I have managed to create the mapping using curls calls provided but when I hit

```
`curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json`
`curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json`
`curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/_bulk?pretty' --data-binary @logs.jsonl`

```

I am getting lots of errors like

```
`{
  "index" : {
    "_index" : "shakespeare",
    "_type" : "doc",
    "_id" : "111393",
    "status" : 503,
    "error" : {
      "type" : "unavailable_shards_exception",
      "reason" : "[shakespeare][4] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[shakespeare][4]] containing [22430] requests]"
    }
  }
},
{
  "index" : {
    "_index" : "shakespeare",
    "_type" : "doc",
    "_id" : "111394",
    "status" : 503,
    "error" : {
      "type" : "unavailable_shards_exception",
      "reason" : "[shakespeare][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[shakespeare][0]] containing [22040] requests]"
    }
  }
},
{
  "index" : {
    "_index" : "shakespeare",
    "_type" : "doc",
    "_id" : "111395",
    "status" : 503,
    "error" : {
      "type" : "unavailable_shards_exception",
      "reason" : "[shakespeare][1] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[shakespeare][1]] containing [22454] requests]"
        }
      }
    }
  ]
}

```

`

Can anyone help?

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 11:41am UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/2 "2018-05-15T11:41:34Z")

</div>

Can you post the logs after starting elasticsearch? As it says shards started successfully.I see your command is correct taken from Lynda.🙂

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 11:52am UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/3 "2018-05-15T11:52:16Z")

</div>

Hi,  
Thanks for replying.  
I am very new to elasticsearch.  
How can I check logs?  
Where to look for them?

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 12:02pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/4 "2018-05-15T12:02:14Z")

</div>

there is a file in elasticsearch/logs . check that

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:05pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/5 "2018-05-15T12:05:13Z")

</div>

I have installed it on the ubuntu machine.  
I am not able to find the file. ☹

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:12pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/6 "2018-05-15T12:12:30Z")

</div>

Found it, it was in /var/log/ directory:

```
[2018-05-15T17:41:53,212][INFO][o.e.n.Node] [] initializing ...
[2018-05-15T17:41:53,617][INFO][o.e.e.NodeEnvironment] [D89gJz4] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [393.6gb], $
[2018-05-15T17:41:53,620][INFO][o.e.e.NodeEnvironment] [D89gJz4] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-05-15T17:41:53,965][INFO][o.e.n.Node] node name [D89gJz4] derived from node ID [D89gJz4VQ8uGWiIqv8ERqA]; set [node.name] $
[2018-05-15T17:41:53,966][INFO][o.e.n.Node] version[6.2.4], pid[16372], build[ccec39f/2018-04-12T20:37:28.497551Z], OS[Linux/3.$
[2018-05-15T17:41:53,966][INFO][o.e.n.Node] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyF$
[2018-05-15T17:42:01,254][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [aggs-matrix-stats]
[2018-05-15T17:42:01,255][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [analysis-common]
[2018-05-15T17:42:01,256][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [ingest-common]
[2018-05-15T17:42:01,256][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [lang-expression]
[2018-05-15T17:42:01,256][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [lang-mustache]
[2018-05-15T17:42:01,256][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [lang-painless]
[2018-05-15T17:42:01,257][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [mapper-extras]
[2018-05-15T17:42:01,257][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [parent-join]
[2018-05-15T17:42:01,257][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [percolator]
[2018-05-15T17:42:01,257][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [rank-eval]
[2018-05-15T17:42:01,257][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [reindex]
[2018-05-15T17:42:01,257][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [repository-url]
[2018-05-15T17:42:01,258][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [transport-netty4]
[2018-05-15T17:42:01,258][INFO][o.e.p.PluginsService] [D89gJz4] loaded module [tribe]
[2018-05-15T17:42:01,265][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-core]
[2018-05-15T17:42:01,265][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-deprecation]
[2018-05-15T17:42:01,265][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-graph]
[2018-05-15T17:42:01,266][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-logstash]
[2018-05-15T17:42:01,267][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-ml]
[2018-05-15T17:42:01,267][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-monitoring]
[2018-05-15T17:42:01,268][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-security]
[2018-05-15T17:42:01,269][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-upgrade]
[2018-05-15T17:42:01,269][INFO][o.e.p.PluginsService] [D89gJz4] loaded plugin [x-pack-watcher]
```

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 12:14pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/7 "2018-05-15T12:14:58Z")

</div>

is that all the log u have?,did it never say that elasticsearch node started?

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:18pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/8 "2018-05-15T12:18:04Z")

</div>

No, this was it.

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 12:18pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/9 "2018-05-15T12:18:34Z")

</div>

what command you run to start elasticsearch?

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:19pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/10 "2018-05-15T12:19:42Z")

</div>

```
sudo service elasticsearch start
```

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:20pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/11 "2018-05-15T12:20:28Z")

</div>

I am sorry but elastic search works fine, I can see the cluster info on localhost:9200.

It's just that, I cant load the data for the kibana.

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 12:27pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/12 "2018-05-15T12:27:45Z")

</div>

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/\_bulk?pretty' --data-binary @accounts.json  
are you running this command in kibana.Please give this PUT /swiss in kibana.it should create an index named swiss.

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:28pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/13 "2018-05-15T12:28:33Z")

</div>

I am running it on ubuntu terminal.  
Is that correct?

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 12:29pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/14 "2018-05-15T12:29:59Z")

</div>

> [@Dvikas](#):
>
> curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/\_bulk?pretty' --data-binary @accounts.json

running the above on ubunto terminal is correct.

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:30pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/15 "2018-05-15T12:30:16Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 12:33pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/16 "2018-05-15T12:33:43Z")

</div>

Check this indices info please.

In the link for loading the data this CURL CALL should return some docs count and details but I can see docs for only bank collection and for others its nothing there.

 ![xxx](https://us1.discourse-cdn.com/elastic/original/3X/a/7/a73547fa8a196ffd346bf1c559481ae63918db6f.png)

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 12:59pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/17 "2018-05-15T12:59:18Z")

</div>

yup you are right.But the thing is did you send any data to other index except bank?if yes than its problem otherwise I dnt think so it is prblm. As I can see u run the command for Shakespeare index.so Shakespeare.json file is present in ur machine rght.Actually for me it worked.I will check into this issue.

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Harshal\_Yeole](https://discuss.elastic.co/u/Harshal_Yeole)\
**Post date:** [May 15, 2018, 1:33pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/18 "2018-05-15T13:33:31Z")

</div>

Yes, I have this files in my machine.

---

<div class="post-metadata">

**Author:** ![Dvikas](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@Dvikas](https://discuss.elastic.co/u/Dvikas)\
**Post date:** [May 15, 2018, 1:45pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/19 "2018-05-15T13:45:05Z")

</div>

Can you delete the index Shakespeare and rerun the command.Before running the command run this: using curl  
PUT /shakespeare/\_settings  
{  
"index" : {  
"number\_of\_shards":3  
"number\_of\_replicas" : 2

```
}

```

}

---

<div class="post-metadata">

**Author:** ![Harshal\_Yeole1](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@Harshal\_Yeole1](https://discuss.elastic.co/u/Harshal_Yeole1)\
**Post date:** [May 15, 2018, 2:24pm UTC](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912/20 "2018-05-15T14:24:26Z")

</div>

Hi @Dvikas ,  
I tried your solution it didi not work.

[Next page](https://discuss.elastic.co/t/loading-sample-data-error-unavailable-shards-exception/131912.md?page=2)
