# Pushing auto-follow-pattern results in a Null pointer exception on elasticsearch side

**URL:** <https://discuss.elastic.co/t/pushing-auto-follow-pattern-results-in-a-null-pointer-exception-on-elasticsearch-side/189666>\
**Category:** Elasticsearch\
**Tags:** ccr-cross-cluster-replication\
**Created:** [July 10, 2019, 6:23am UTC](https://discuss.elastic.co/t/pushing-auto-follow-pattern-results-in-a-null-pointer-exception-on-elasticsearch-side/189666 "2019-07-10T06:23:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)\
**Post date:** [July 10, 2019, 6:23am UTC](https://discuss.elastic.co/t/pushing-auto-follow-pattern-results-in-a-null-pointer-exception-on-elasticsearch-side/189666/1 "2019-07-10T06:23:53Z")

</div>

Hi guys!  
So, we installed elasticsearch 6.8.1 on 6 nodes and are trying to setup CCR with two clusters - 3 nodes each. License is activated and valid, remote settings are set (seed, nodes and cluster name). But now, somehow when I try to push the autofollow pattern like this

```auto
curl -X PUT "localhost:9200/_ccr/auto_follow/AutoFollowerPatterns" -H 'Content-Type: application/json' -d'
{
  "remote_cluster" : "elastic-uswest",
  "leader_index_patterns" :
  [
    "visit*"
  ],
  "follow_index_pattern" : "ccr-{{leader_index}}"
}
'

```

it results into that response:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "remote_transport_exception",
        "reason" : "[10.176.70.184][10.176.70.184:9300][cluster:admin/xpack/ccr/auto_follow_pattern/put]"
      }
    ],
    "type" : "null_pointer_exception",
    "reason" : null
  },
  "status" : 500
}

```

Digging a bit deeper into the logs of elasticsearch, we can see this message:

```auto
[2019-07-09T10:10:49,510][WARN][r.suppressed] [10.176.68.180] path: /_ccr/auto_follow/AutoFollowerPatterns, params: {name=AutoFollowerPatterns}
org.elasticsearch.transport.RemoteTransportException: [10.176.69.160][10.176.69.160:9300][cluster:admin/xpack/ccr/auto_follow_pattern/put]
Caused by: java.lang.NullPointerException
        at org.elasticsearch.xpack.ccr.CcrLicenseChecker.hasPrivilegesToFollowIndices(CcrLicenseChecker.java:318) ~[?:?]
        at org.elasticsearch.xpack.ccr.action.TransportPutAutoFollowPatternAction.lambda$masterOperation$2(TransportPutAutoFollowPatternAction.java:88) ~[?:?]
        at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:61) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:43) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.action.ActionListenerResponseHandler.handleResponse(ActionListenerResponseHandler.java:54) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1104) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.transport.TcpTransport$1.doRun(TcpTransport.java:985) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.common.util.concurrent.EsExecutors$DirectExecutorService.execute(EsExecutors.java:193) ~[elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.transport.TcpTransport.handleResponse(TcpTransport.java:977) [elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.transport.TcpTransport.messageReceived(TcpTransport.java:952) [elasticsearch-6.8.1.jar:6.8.1]
        at org.elasticsearch.transport.TcpTransport.inboundMessage(TcpTransport.java:763) [elasticsearch-6.8.1.jar:6.8.1]
...

```

Our initial thought was, that the security module could cause the error - because of this word in the exception: `hasPrivilegesToFollowIndices`. So, we removed all unnecessary modules and the error still occurs.

The installed modules are those:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/f/af6eb0bf9747cddaf1b1d612136d43013ef82206.png)

Any ideas on what the root cause can be ?  
Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 10, 2019, 12:37pm UTC](https://discuss.elastic.co/t/pushing-auto-follow-pattern-results-in-a-null-pointer-exception-on-elasticsearch-side/189666/2 "2019-07-10T12:37:00Z")

</div>

> [@kley](#):
>
> `Caused by: java.lang.NullPointerException`

A `NullPointerException` here is a bug. Could you open a [Github issue](https://github.com/elastic/elasticsearch/issues) please?

---

<div class="post-metadata">

**Author:** ![kley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kley/32/43533_2.png) [@kley](https://discuss.elastic.co/u/kley)\
**Post date:** [July 10, 2019, 2:46pm UTC](https://discuss.elastic.co/t/pushing-auto-follow-pattern-results-in-a-null-pointer-exception-on-elasticsearch-side/189666/3 "2019-07-10T14:46:54Z")

</div>

Thank you for your response. Created a bug report [https://github.com/elastic/elasticsearch/issues/44172](https://github.com/elastic/elasticsearch/issues/44172).

One more thing, I cannot get another cluster in this state, its only this one though ☹

---

<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:** [August 7, 2019, 2:46pm UTC](https://discuss.elastic.co/t/pushing-auto-follow-pattern-results-in-a-null-pointer-exception-on-elasticsearch-side/189666/4 "2019-08-07T14:46:57Z")

</div>

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