# Importing data with cURL error. Newb here

**URL:** https://discuss.elastic.co/t/importing-data-with-curl-error-newb-here/131381
**Category:** Elasticsearch
**Created:** [May 11, 2018, 3:04am UTC](https://discuss.elastic.co/t/importing-data-with-curl-error-newb-here/131381 "2018-05-11T03:04:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mehdi-gital](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mehdi-gital](https://discuss.elastic.co/u/mehdi-gital)
#### Post date: [May 11, 2018, 3:04am UTC](https://discuss.elastic.co/t/importing-data-with-curl-error-newb-here/131381/1 "2018-05-11T03:04:55Z")

</div>

Hey guys,

I've been learning Elasticsearch and Kibana for 2-3 days now. I'm super newbie and I know it but I was wondering if anyone can lend a hand.

Issue: I'm trying to pass a json file to my kibana session using the following command:

`curl -H "Content-Type: application/json" -XPOST "http://localhost:9200/product/default/_bulk?pretty" --data-binary "@file_name.json"`

However, I get the following error:

```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "missing authentication token for REST request [/product/default/_bulk?pretty]",
        "header" : {
          "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "missing authentication token for REST request [/product/default/_bulk?pretty]",
    "header" : {
      "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status" : 401

```

I already saw some posts that discussed the following:

- xpack.security.encryptionKey: "something\_at\_least\_32\_characters"
- xpack.security.enabled: false

But unfortunately messing with these settings in the .yml file hasn't helped.

Not sure if this helps but when I start my Kibana, I get some red errors and warnings:

```
  log [02:18:44.265] [info][status][plugin:kibana@6.2.4] Status changed from uninitialized to green - Ready
  log [02:18:44.332] [info][status][plugin:elasticsearch@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.338] [info][status][plugin:xpack_main@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.353] [info][status][plugin:searchprofiler@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.360] [info][status][plugin:ml@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.433] [info][status][plugin:tilemap@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.438] [info][status][plugin:watcher@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.493] [info][status][plugin:license_management@6.2.4] Status changed from uninitialized to green - Ready
  log [02:18:44.945] [info][status][plugin:timelion@6.2.4] Status changed from uninitialized to green - Ready
  log [02:18:44.954] [info][status][plugin:graph@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:44.970] [info][status][plugin:monitoring@6.2.4] Status changed from uninitialized to green - Ready
  log [02:18:50.840] [warning][reporting] Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml
  log [02:18:50.856] [info][status][plugin:reporting@6.2.4] Status changed from uninitialized to yellow - Waiting for Elasticsearch
  log [02:18:50.918] [error][status][plugin:xpack_main@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.919] [error][status][plugin:searchprofiler@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.921] [error][status][plugin:ml@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.924] [error][status][plugin:tilemap@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.929] [error][status][plugin:watcher@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.930] [error][status][plugin:graph@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.932] [error][status][plugin:reporting@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:50.940] [error][status][plugin:elasticsearch@6.2.4] Status changed from yellow to red - Request Timeout after 3000ms
  log [02:18:51.249] [info][license][xpack] Imported license information from Elasticsearch for the [data] cluster: mode: trial | status: active | expiry date: 2018-06-09T21:52:48-04:00
  log [02:18:51.263] [info][status][plugin:xpack_main@6.2.4] Status changed from red to green - Ready
  log [02:18:51.264] [info][status][plugin:searchprofiler@6.2.4] Status changed from red to green - Ready
  log [02:18:51.265] [info][status][plugin:ml@6.2.4] Status changed from red to green - Ready
  log [02:18:51.267] [info][status][plugin:tilemap@6.2.4] Status changed from red to green - Ready
  log [02:18:51.268] [info][status][plugin:watcher@6.2.4] Status changed from red to green - Ready
  log [02:18:51.269] [info][status][plugin:graph@6.2.4] Status changed from red to green - Ready
  log [02:18:51.270] [info][status][plugin:reporting@6.2.4] Status changed from red to green - Ready
  log [02:18:51.294] [info][kibana-monitoring][monitoring-ui] Stopping all Kibana monitoring collectors
  log [02:18:51.328] [info][license][xpack] Imported license information from Elasticsearch for the [monitoring] cluster: mode: trial | status: active | expiry date: 2018-06-09T21:52:48-04:00
  log [02:18:57.073] [info][kibana-monitoring][monitoring-ui] Starting all Kibana monitoring collectors
  log [02:18:57.078] [info][status][plugin:elasticsearch@6.2.4] Status changed from red to green - Ready
  log [02:19:13.284] [info][status][plugin:security@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.292] [warning][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
  log [02:19:13.301] [warning][security] Session cookies will be transmitted over insecure connections. This is not recommended.
  log [02:19:13.379] [info][status][plugin:grokdebugger@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.391] [info][status][plugin:dashboard_mode@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.396] [info][status][plugin:logstash@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.439] [info][status][plugin:apm@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.479] [info][status][plugin:console@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.488] [info][status][plugin:metrics@6.2.4] Status changed from uninitialized to green - Ready
  log [02:19:13.525] [info][listening] Server running at http://localhost:5601

```

Thank you!

---

<div class="post-metadata">

### Author: ![mjunaidmuzammil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mjunaidmuzammil/32/56910_2.png) [@mjunaidmuzammil](https://discuss.elastic.co/u/mjunaidmuzammil)
#### Post date: [May 11, 2018, 5:50am UTC](https://discuss.elastic.co/t/importing-data-with-curl-error-newb-here/131381/2 "2018-05-11T05:50:15Z")

</div>

Hi,

I believe you are using X-pack. You haven't provided authentication credentials to curl query. Please add those in the following format `-u <username>:<password>` to your curl request.

A similar thread to your can be found here.

> [@Elaticsearch failed to start after installing x-pack](https://discuss.elastic.co/t/elaticsearch-failed-to-start-after-installing-x-pack/74807/10):
>
> elasticpassword is not the right password. I told you already. Please read [https://www.elastic.co/guide/en/x-pack/current/security-getting-started.html](https://www.elastic.co/guide/en/x-pack/current/security-getting-started.html)

Hope this helps you out.

---

<div class="post-metadata">

### Author: ![mehdi-gital](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mehdi-gital](https://discuss.elastic.co/u/mehdi-gital)
#### Post date: [May 11, 2018, 3:14pm UTC](https://discuss.elastic.co/t/importing-data-with-curl-error-newb-here/131381/3 "2018-05-11T15:14:35Z")

</div>

Thanks a million!

---

<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: [June 8, 2018, 3:14pm UTC](https://discuss.elastic.co/t/importing-data-with-curl-error-newb-here/131381/4 "2018-06-08T15:14:45Z")

</div>

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