# Kbn-header error

**URL:** https://discuss.elastic.co/t/kbn-header-error/78849
**Category:** Elasticsearch
**Created:** [March 16, 2017, 12:01pm UTC](https://discuss.elastic.co/t/kbn-header-error/78849 "2017-03-16T12:01:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![LazPix](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@LazPix](https://discuss.elastic.co/u/LazPix)
#### Post date: [March 16, 2017, 12:01pm UTC](https://discuss.elastic.co/t/kbn-header-error/78849/1 "2017-03-16T12:01:38Z")

</div>

I have 2 environments - dev and qa, both hosted on two different virtual machines in Azure. The dev environment works fine, and the qa is not. Here are the details:

Elasticsearch version: 2.3.4 in dev, 2.4.4 in qa.  
Kibana version: 4.5.4, in both environments.  
Kibana yml configuration: server.host: "0.0.0.0", in both environments  
Elasticsearch yml configuration: network.host: 0.0.0.0, in both environments

This is my test code in node js that I ran from my office pc:

```
var elasticsearch = require('elasticsearch');
var elasticClient = new elasticsearch.Client({
   hosts: ['http://my-qa-ip:80/'], 
   log: 'trace',
   requestTimeout: 1200000,
});

elasticClient.search({
    index: 'my_apps',
    type: 'owner',
    size: 100,
       body: {
        'query': {
          'filtered': {
              'filter': {
                 'bool': {
                    'must': [
                        { 'term': {
                            'ownerUsername': 'myapp'
                           }
                        }
                    ]
                }
            }
        }
    }
}
}, function (err, resp) {
    console.log(JSON.stringify(err, null, 4));
    console.log(JSON.stringify(resp, null, 4));
   });

```

The error returned was this:

```
{
   "statusCode": 400,
   "error": "Bad Request",
   "message": "Missing kbn-version header"
}

```

So I tried to add the header but it didn't work:

```
var elasticClient = new elasticsearch.Client({
   hosts: ['http://my-qa-ip:80/'], 
   log: 'trace',
   requestTimeout: 1200000,
   headers: {
       'kbn-version': '4.5.4'
   }
});

```

I don't understand why I don't get the same error in the dev environment and what should I do to fix it. Another question that I have is why I can ping the `my-qa-ip` above only in port 80, and not in port 9200 as I do with the dev environment. Both virtual machines have a security rule that says they can accept connections on all port from my office where I ran this test.

Thanks.

---

<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 13, 2017, 12:01pm UTC](https://discuss.elastic.co/t/kbn-header-error/78849/2 "2017-04-13T12:01:39Z")

</div>

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