# Error loading sample data

**URL:** <https://discuss.elastic.co/t/error-loading-sample-data/79055>\
**Category:** Kibana\
**Created:** [March 17, 2017, 4:17pm UTC](https://discuss.elastic.co/t/error-loading-sample-data/79055 "2017-03-17T16:17:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RDumais](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@RDumais](https://discuss.elastic.co/u/RDumais)\
**Post date:** [March 17, 2017, 4:17pm UTC](https://discuss.elastic.co/t/error-loading-sample-data/79055/1 "2017-03-17T16:17:13Z")

</div>

I am trying to follow the tutorial available here: [https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html](https://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html)

Where I am trying to run this:

```
curl -XPUT http://localhost:9200/shakespeare -d '
{
 "mappings" : {
  "_default_" : {
   "properties" : {
    "speaker" : {"type": "string", "index" : "not_analyzed" },
    "play_name" : {"type": "string", "index" : "not_analyzed" },
    "line_id" : { "type" : "integer" },
    "speech_number" : { "type" : "integer" }
   }
  }
 }
}
';

```

I am getting an error regarding authentication:

{"error":{"root\_cause":[{"type":"security\_exception","reason":"missing authentication token for REST request [/shakespeare]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}}],"type":"security\_exception","reason":"missing authentication token for REST request [/shakespeare]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}},"status":401}

Any solutions?

Thank you!

---

<div class="post-metadata">

**Author:** ![RDumais](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@RDumais](https://discuss.elastic.co/u/RDumais)\
**Post date:** [March 17, 2017, 7:01pm UTC](https://discuss.elastic.co/t/error-loading-sample-data/79055/2 "2017-03-17T19:01:09Z")

</div>

Thankfully I found the solution myself after doing some testing. I will post the solution incase anyone has the same issue:

I have X-pack installed and I believe that might have conflicted with the authentication portion.

The fix is simple. Add '-u elastic' after the '-XPUT' command. Where 'elastic' is the default username for X-pack. After running the command you should be prompted for a password. Use the password to authenticate. Default password is 'changeme'.

Example:

```
curl -XPUT -u elastic http://localhost:9200/shakespeare -d '
{
 "mappings" : {
  "_default_" : {
   "properties" : {
    "speaker" : {"type": "string", "index" : "not_analyzed" },
    "play_name" : {"type": "string", "index" : "not_analyzed" },
    "line_id" : { "type" : "integer" },
    "speech_number" : { "type" : "integer" }
   }
  }
 }
}
';
```

---

<div class="post-metadata">

**Author:** ![cjcenizal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjcenizal/32/11216_2.png) [@cjcenizal](https://discuss.elastic.co/u/cjcenizal)\
**Post date:** [March 23, 2017, 7:21pm UTC](https://discuss.elastic.co/t/error-loading-sample-data/79055/3 "2017-03-23T19:21:19Z")

</div>

Thanks for sharing your solution, Ryan! To speed things up a bit, you can also pass the username and password as a single argument: `-u elastic:changeme`.

CJ

---

<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:** [April 20, 2017, 7:21pm UTC](https://discuss.elastic.co/t/error-loading-sample-data/79055/4 "2017-04-20T19:21:37Z")

</div>

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