# Email action fails with property message null

**URL:** https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045
**Category:** Elasticsearch
**Created:** [January 4, 2018, 9:12am UTC](https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045 "2018-01-04T09:12:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Souciance\_Eqdam\_Rash](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Souciance\_Eqdam\_Rash](https://discuss.elastic.co/u/Souciance_Eqdam_Rash)
#### Post date: [January 4, 2018, 9:12am UTC](https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045/1 "2018-01-04T09:12:43Z")

</div>

Hello,

I configured an e-mail action in Watcher in Kibana/Elasticsearch 6.1.1 and tried to send an e-mail. The error I get is:

```
TypeError: Cannot read property 'message' of null
    at http://localhost:5601/bundles/kibana.bundle.js?v=16350:153:75625
    at processQueue (http://localhost:5601/bundles/commons.bundle.js?v=16350:29:132456)
    at http://localhost:5601/bundles/commons.bundle.js?v=16350:29:133349
    at Scope.$digest (http://localhost:5601/bundles/commons.bundle.js?v=16350:29:144239)
    at Scope.$apply (http://localhost:5601/bundles/commons.bundle.js?v=16350:29:147018)
    at done (http://localhost:5601/bundles/commons.bundle.js?v=16350:29:100026)
    at completeRequest (http://localhost:5601/bundles/commons.bundle.js?v=16350:29:104697)
    at XMLHttpRequest.requestError (http://localhost:5601/bundles/commons.bundle.js?v=16350:29:105545)

```

I have tried with gmail and exchange and get the same error. Here is my elasticsearch.yml config for e-mail:

```
xpack.notification.email.account:
    gmail_account:
        profile: gmail
        smtp:
            auth: true
            starttls.enable: true
            host: smtp.gmail.com
            port: 587
            user: xxxi@gmail.com
            password: xxx

```

Any idea what could be wrong? Thanks

Here is the complete error:

```
  optionalFields.body.text = this.body;
                           ^

TypeError: Cannot set property 'text' of undefined
    at EmailAction.get upstreamJson [as upstreamJson] (C:/tools/kibana-6.1.1-windows-x86_64/plugins/x-pack/plugins/watcher/server/models/action/email_action.js:48:7)

    at action (C:/tools/kibana-6.1.1-windows-x86_64/plugins/x-pack/plugins/watcher/server/models/watch/threshold_watch/build_actions.js:10:27)
    at arrayEach (C:\tools\kibana-6.1.1-windows-x86_64\plugins\x-pack\node_modules\lodash\index.js:1289:13)
    at C:\tools\kibana-6.1.1-windows-x86_64\plugins\x-pack\node_modules\lodash\index.js:3345:13
    at buildActions (C:/tools/kibana-6.1.1-windows-x86_64/plugins/x-pack/plugins/watcher/server/models/watch/threshold_watch/build_actions.js:9:3)
    at ThresholdWatch.get watchJson [as watchJson] (C:/tools/kibana-6.1.1-windows-x86_64/plugins/x-pack/plugins/watcher/server/models/watch/threshold_watch/threshold
_watch.js:51:18)
    at handler (C:/tools/kibana-6.1.1-windows-x86_64/plugins/x-pack/plugins/watcher/server/routes/api/watch/register_execute_route.js:31:73)
    at Object.internals.handler (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\handler.js:96:36)
    at Items.serial (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\handler.js:63:26)
    at done (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\node_modules\items\lib\index.js:31:25)
    at done (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\node_modules\items\lib\index.js:63:25)
    at pre (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\handler.js:52:24)
    at finalize (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\handler.js:281:20)
    at wrapped (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hoek\lib\index.js:875:20)
    at internals.Response._processPrepare (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\response.js:521:16)
    at internals.Response._prepare (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\response.js:460:21)
    at process.nextTick (C:\tools\kibana-6.1.1-windows-x86_64\node_modules\hapi\lib\reply.js:152:22)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
```

---

<div class="post-metadata">

### Author: ![Souciance\_Eqdam\_Rash](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Souciance\_Eqdam\_Rash](https://discuss.elastic.co/u/Souciance_Eqdam_Rash)
#### Post date: [January 4, 2018, 4:19pm UTC](https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045/2 "2018-01-04T16:19:25Z")

</div>

By the way, is this a bug? Because what happens after that error is that the Kibana process crashes and requires a reboot. This is on windows 7 with everything in 6.1.1.

---

<div class="post-metadata">

### Author: ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)
#### Post date: [January 8, 2018, 2:12pm UTC](https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045/3 "2018-01-08T14:12:50Z")

</div>

Hi @Souciance_Eqdam_Rash,

This is the same as [Typeerror: cannot read property 'message' of null watcher](https://discuss.elastic.co/t/typeerror-cannot-read-property-message-of-null-watcher/114002) and will be fixed in the next release.

Thanks,  
Chris

---

<div class="post-metadata">

### Author: ![Souciance\_Eqdam\_Rash](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@Souciance\_Eqdam\_Rash](https://discuss.elastic.co/u/Souciance_Eqdam_Rash)
#### Post date: [January 8, 2018, 8:52pm UTC](https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045/4 "2018-01-08T20:52:01Z")

</div>

Thanks, yeah I kind of guessed that. Looking forward to the next release then.

---

<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: [February 5, 2018, 8:52pm UTC](https://discuss.elastic.co/t/email-action-fails-with-property-message-null/114045/5 "2018-02-05T20:52:12Z")

</div>

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