# TypeError: Cannot read property 'message' of null

**URL:** <https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196>\
**Category:** Kibana\
**Created:** [December 4, 2017, 6:14pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196 "2017-12-04T18:14:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![g-vamp](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@g-vamp](https://discuss.elastic.co/u/g-vamp)\
**Post date:** [December 4, 2017, 6:14pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196/1 "2017-12-04T18:14:24Z")

</div>

I have recently upgraded the ELK stack from 5.4.2 to 6.0.0 and I have an issue in kibana where in the **Discover tab or Management \> Index Patterns tab I have an ajax error** saying:

"Cannot read property 'message' of null".

This comes from one of the bundles

`<kibana>/kibana/bundles/kibana.bundle.js?v=16070:231:27746`

The ajax request is the following (will break on any pattern given)

`HTTP 400 -- <kibana>/kibana/api/index_patterns/_fields_for_wildcard?pattern=...`

So far I have done;

- a fresh re-install of elasticsearch/kibana/logstash,
- enabled/disabled x-pack along with custom realm,
- uninstall x-pack,
- used tar.gz items to override the .deb package stuff (in /usr/share/kibana) for **kibana**

All the other features of kibana seems to work just fine. I can use the console and `_cat/indices` just fine and all my stuff seems to be there. I have tried and upgraded kibana index from 5.4.2 to 6.0.0 without issues, that didn't seem to help so I also re-created one from scratch. Didn't help either.

Basically whenever I hit the Discover tab or the Management \> Index Patterns tab I see the normal "first setup" page Configure an index pattern BUT when I try and add an index, it will fail (with the above error) and will also set kibana **defaultIndex** setting, and from there (unless I remove that default) the aforementioned tabs will simply display a blank page (not even the setup part).

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [December 5, 2017, 4:15pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196/2 "2017-12-05T16:15:32Z")

</div>

Hi @g-vamp,

would it be possible for you to provide the relevant console log output of the Kibana server for that request?

---

<div class="post-metadata">

**Author:** ![g-vamp](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@g-vamp](https://discuss.elastic.co/u/g-vamp)\
**Post date:** [December 5, 2017, 4:28pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196/3 "2017-12-05T16:28:16Z")

</div>

For sure! Here is the kibana client side error from the ajax request followed by the json console output.

```
TypeError: Cannot read property 'message' of null
    at https://<hostname>/kibana/bundles/kibana.bundle.js?v=16070:231:27746
    at processQueue (https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:39:9912)
    at https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:39:10805
    at Scope.$digest (https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:39:21741)
    at Scope.$apply (https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:39:24520)
    at done (https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:38:9495)
    at completeRequest (https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:38:13952)
    at XMLHttpRequest.requestError (https://<hostname>/kibana/bundles/commons.bundle.js?v=16070:38:14800)
	
	
{  
   "type":"response",
   "@timestamp":"2017-12-04T14:17:55Z",
   "tags":[  

   ],
   "pid":1733,
   "method":"get",
   "statusCode":400,
   "req":{  
      "url":"/api/index_patterns/_fields_for_wildcard?pattern=logstash-*&meta_fields=%5B%22_source%22",
      "method":"get",
      "headers":{  
         "accept":"application/json, text/plain, */*",
         "accept-encoding":"gzip, deflate, br",
         "accept-language":"en-GB;q=1,en-US;q=0.9,en;q=0.8,fr;q=0.7",
         "host":"<hostname>",
         "kbn-version":"6.0.0",
         "referer":"https://<hostname>/kibana/app/kibana",
         ... stripped some custom headers from our proxy ...
         "connection":"Keep-Alive"
      },
      "remoteAddress":"10.3.0.67",
      "userAgent":"10.3.0.67",
      "referer":"https://<hostname>/kibana/app/kibana"
   },
   "res":{  
      "statusCode":400,
      "responseTime":30,
      "contentLength":9
   },
   "message":"GET /api/index_patterns/_fields_for_wildcard?pattern=logstash-*&meta_fields=%5B%22_source%22 400 30ms - 9.0B"
}
```

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [December 5, 2017, 7:20pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196/4 "2017-12-05T19:20:35Z")

</div>

Interesting, it looks like there is a `%5D` missing at the end of the url. Does your proxy accidentally truncate that url?

---

<div class="post-metadata">

**Author:** ![g-vamp](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@g-vamp](https://discuss.elastic.co/u/g-vamp)\
**Post date:** [December 6, 2017, 2:10pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196/5 "2017-12-06T14:10:12Z")

</div>

Nice catch! This is exactly what was the problem! Many thanks for your help!

---

<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:** [January 3, 2018, 2:10pm UTC](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null/110196/6 "2018-01-03T14:10:28Z")

</div>

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