# ES 0.18.3 NPE when set logging level to TRACE

**URL:** <https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206>\
**Category:** Elasticsearch\
**Created:** [December 21, 2011, 4:29am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206 "2011-12-21T04:29:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liyu](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Liyu](https://discuss.elastic.co/u/Liyu)\
**Post date:** [December 21, 2011, 4:29am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/1 "2011-12-21T04:29:12Z")

</div>

Hi, I just ran into an exception, here are the steps to reproduce it.

1. I have 2 ES servers, vanilla setup
2. Change the logging level to TRACE in logging.yml  
rootLogger: TRACE, console, file
3. Shutdown the primary node
4. Run the command  
$ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
and get the following error.  
{"error":"NullPointerException[null]","status":500}

Nothing left in the log file.

Any suggestions?

Thanks.

-- Liyu

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 21, 2011, 5:09am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/2 "2011-12-21T05:09:49Z")

</div>

You will have to be more specific about the step to recreate it. I started  
two elasticsearch instances with TRACE logging, ran cluster state and did  
not see the failure. Start from fresh instances.

On Wed, Dec 21, 2011 at 6:29 AM, Liyu [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:

> Hi, I just ran into an exception, here are the steps to reproduce it.
> 
> 1. I have 2 ES servers, vanilla setup
> 2. Change the logging level to TRACE in logging.yml  
> rootLogger: TRACE, console, file
> 3. Shutdown the primary node
> 4. Run the command  
> $ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
> and get the following error.  
> {"error":"NullPointerException[null]","status":500}
> 
> Nothing left in the log file.
> 
> Any suggestions?
> 
> Thanks.
> 
> -- Liyu

---

<div class="post-metadata">

**Author:** ![Liyu](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Liyu](https://discuss.elastic.co/u/Liyu)\
**Post date:** [December 21, 2011, 5:54am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/3 "2011-12-21T05:54:12Z")

</div>

Shay,

Did you shutdown the primary node? and run the cluster state from the  
secondary node?

Thanks!

-- Liyu

On Tue, Dec 20, 2011 at 9:09 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> You will have to be more specific about the step to recreate it. I started  
> two elasticsearch instances with TRACE logging, ran cluster state and did  
> not see the failure. Start from fresh instances.
> 
> On Wed, Dec 21, 2011 at 6:29 AM, Liyu [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> 
> > Hi, I just ran into an exception, here are the steps to reproduce it.
> > 
> > 1. I have 2 ES servers, vanilla setup
> > 2. Change the logging level to TRACE in logging.yml  
> > rootLogger: TRACE, console, file
> > 3. Shutdown the primary node
> > 4. Run the command  
> > $ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
> > and get the following error.  
> > {"error":"NullPointerException[null]","status":500}
> > 
> > Nothing left in the log file.
> > 
> > Any suggestions?
> > 
> > Thanks.
> > 
> > -- Liyu

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 21, 2011, 6:29am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/4 "2011-12-21T06:29:39Z")

</div>

You mean shutdown the elected master node, and execute the cluster state  
against the second node (which got elected to be master)? Yes. (there is no  
primary or secondary node in elasticsearch). Explain the concrete steps  
that you do to recreate it.

On Wed, Dec 21, 2011 at 7:54 AM, Liyu Yi [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:

> Shay,
> 
> Did you shutdown the primary node? and run the cluster state from the  
> secondary node?
> 
> Thanks!
> 
> -- Liyu
> 
> On Tue, Dec 20, 2011 at 9:09 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > You will have to be more specific about the step to recreate it. I  
> > started two elasticsearch instances with TRACE logging, ran cluster state  
> > and did not see the failure. Start from fresh instances.
> > 
> > On Wed, Dec 21, 2011 at 6:29 AM, Liyu [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> > 
> > > Hi, I just ran into an exception, here are the steps to reproduce it.
> > > 
> > > 1. I have 2 ES servers, vanilla setup
> > > 2. Change the logging level to TRACE in logging.yml  
> > > rootLogger: TRACE, console, file
> > > 3. Shutdown the primary node
> > > 4. Run the command  
> > > $ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
> > > and get the following error.  
> > > {"error":"NullPointerException[null]","status":500}
> > > 
> > > Nothing left in the log file.
> > > 
> > > Any suggestions?
> > > 
> > > Thanks.
> > > 
> > > -- Liyu

---

<div class="post-metadata">

**Author:** ![Liyu](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Liyu](https://discuss.elastic.co/u/Liyu)\
**Post date:** [December 21, 2011, 6:46am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/5 "2011-12-21T06:46:46Z")

</div>

Hi, Shay, what you said is correct 🙂  
It is the master node I shut down. Also I forgot to mention one thing, I  
configured the cluster with unicast since multicast is disabled in my  
environment.  
If I change the logging level to DEBUG or WARN, everything works perfectly.  
And I can see all the details from the log that the master is left and the  
secondary is promoted to the new master.  
But when set to TRACE, I had this NPE.

On Tuesday, December 20, 2011, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> You mean shutdown the elected master node, and execute the cluster state  
> against the second node (which got elected to be master)? Yes. (there is no  
> primary or secondary node in elasticsearch). Explain the concrete steps  
> that you do to recreate it.
> 
> On Wed, Dec 21, 2011 at 7:54 AM, Liyu Yi [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> 
> > Shay,
> > 
> > Did you shutdown the primary node? and run the cluster state from the  
> > secondary node?
> > 
> > Thanks!
> > 
> > -- Liyu
> > 
> > On Tue, Dec 20, 2011 at 9:09 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > You will have to be more specific about the step to recreate it. I  
> > > started two elasticsearch instances with TRACE logging, ran cluster state  
> > > and did not see the failure. Start from fresh instances.
> > > 
> > > On Wed, Dec 21, 2011 at 6:29 AM, Liyu [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> > > 
> > > > Hi, I just ran into an exception, here are the steps to reproduce it.
> > > > 
> > > > 1. I have 2 ES servers, vanilla setup
> > > > 2. Change the logging level to TRACE in logging.yml  
> > > > rootLogger: TRACE, console, file
> > > > 3. Shutdown the primary node
> > > > 4. Run the command  
> > > > $ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
> > > > and get the following error.  
> > > > {"error":"NullPointerException[null]","status":500}
> > > > 
> > > > Nothing left in the log file.
> > > > 
> > > > Any suggestions?
> > > > 
> > > > Thanks.
> > > > 
> > > > -- Liyu

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 21, 2011, 7:50am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/6 "2011-12-21T07:50:02Z")

</div>

Used unicast as well, did not recreate it. Please, provide the steps you do  
to recreate it. It should look something like this:

1. Downloaded elasticsearch
2. Changed the configuration file to have this and that
3. Started first node
4. Started second node
5. ....

Also, which version are you using?

On Wed, Dec 21, 2011 at 8:46 AM, Liyu Yi [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:

> Hi, Shay, what you said is correct 🙂  
> It is the master node I shut down. Also I forgot to mention one thing, I  
> configured the cluster with unicast since multicast is disabled in my  
> environment.  
> If I change the logging level to DEBUG or WARN, everything works  
> perfectly. And I can see all the details from the log that the master is  
> left and the secondary is promoted to the new master.  
> But when set to TRACE, I had this NPE.
> 
> On Tuesday, December 20, 2011, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > You mean shutdown the elected master node, and execute the cluster state  
> > against the second node (which got elected to be master)? Yes. (there is no  
> > primary or secondary node in elasticsearch). Explain the concrete steps  
> > that you do to recreate it.
> > 
> > On Wed, Dec 21, 2011 at 7:54 AM, Liyu Yi [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> > 
> > > Shay,
> > > 
> > > Did you shutdown the primary node? and run the cluster state from the  
> > > secondary node?
> > > 
> > > Thanks!
> > > 
> > > -- Liyu
> > > 
> > > On Tue, Dec 20, 2011 at 9:09 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > 
> > > > You will have to be more specific about the step to recreate it. I  
> > > > started two elasticsearch instances with TRACE logging, ran cluster state  
> > > > and did not see the failure. Start from fresh instances.
> > > > 
> > > > On Wed, Dec 21, 2011 at 6:29 AM, Liyu [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> > > > 
> > > > > Hi, I just ran into an exception, here are the steps to reproduce it.
> > > > > 
> > > > > 1. I have 2 ES servers, vanilla setup
> > > > > 2. Change the logging level to TRACE in logging.yml  
> > > > > rootLogger: TRACE, console, file
> > > > > 3. Shutdown the primary node
> > > > > 4. Run the command  
> > > > > $ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
> > > > > and get the following error.  
> > > > > {"error":"NullPointerException[null]","status":500}
> > > > > 
> > > > > Nothing left in the log file.
> > > > > 
> > > > > Any suggestions?
> > > > > 
> > > > > Thanks.
> > > > > 
> > > > > -- Liyu

---

<div class="post-metadata">

**Author:** ![Liyu](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@Liyu](https://discuss.elastic.co/u/Liyu)\
**Post date:** [December 21, 2011, 6:04pm UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/7 "2011-12-21T18:04:39Z")

</div>

Hello, Shay,

I'll try out a new installation from scratch and let you know the exact  
steps to recreate this problem soon.

The version number is 0.18.3. Also the following exception is found from  
the log, but is NOT triggered by the cluster state command from the curl  
command.

[2011-12-20 23:13:05,958][DEBUG][rest.action.admin.cluster.state]  
[Ardroman] failed to handle cluster state  
java.lang.NullPointerException  
at  
org.elasticsearch.cluster.routing.RoutingNode.nodeId(RoutingNode.java:56)  
at  
org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction$1.onResponse(RestClusterStateAction.java:248)  
at  
org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction$1.onResponse(RestClusterStateAction.java:80)  
at  
org.elasticsearch.action.support.BaseAction$ThreadedActionListener$1.run(BaseAction.java:84)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)  
[2011-12-20 23:13:06,915][DEBUG][rest.action.admin.cluster.state]  
[Ardroman] failed to handle cluster state  
java.lang.NullPointerException  
at  
org.elasticsearch.cluster.routing.RoutingNode.nodeId(RoutingNode.java:56)  
at  
org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction$1.onResponse(RestClusterStateAction.java:248)  
at  
org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction$1.onResponse(RestClusterStateAction.java:80)  
at  
org.elasticsearch.action.support.BaseAction$ThreadedActionListener$1.run(BaseAction.java:84)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)  
[2011-12-20 23:13:08,558][DEBUG][rest.action.admin.cluster.state]  
[Ardroman] failed to handle cluster state  
java.lang.NullPointerException  
at  
org.elasticsearch.cluster.routing.RoutingNode.nodeId(RoutingNode.java:56)  
at  
org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction$1.onResponse(RestClusterStateAction.java:248)  
at  
org.elasticsearch.rest.action.admin.cluster.state.RestClusterStateAction$1.onResponse(RestClusterStateAction.java:80)  
at  
org.elasticsearch.action.support.BaseAction$ThreadedActionListener$1.run(BaseAction.java:84)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)

On Tue, Dec 20, 2011 at 11:50 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Used unicast as well, did not recreate it. Please, provide the steps you  
> do to recreate it. It should look something like this:
> 
> 1. Downloaded elasticsearch
> 2. Changed the configuration file to have this and that
> 3. Started first node
> 4. Started second node
> 5. ....
> 
> Also, which version are you using?
> 
> On Wed, Dec 21, 2011 at 8:46 AM, Liyu Yi [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> 
> > Hi, Shay, what you said is correct 🙂  
> > It is the master node I shut down. Also I forgot to mention one thing, I  
> > configured the cluster with unicast since multicast is disabled in my  
> > environment.  
> > If I change the logging level to DEBUG or WARN, everything works  
> > perfectly. And I can see all the details from the log that the master is  
> > left and the secondary is promoted to the new master.  
> > But when set to TRACE, I had this NPE.
> > 
> > On Tuesday, December 20, 2011, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > You mean shutdown the elected master node, and execute the cluster  
> > > state against the second node (which got elected to be master)? Yes. (there  
> > > is no primary or secondary node in elasticsearch). Explain the concrete  
> > > steps that you do to recreate it.
> > > 
> > > On Wed, Dec 21, 2011 at 7:54 AM, Liyu Yi [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> > > 
> > > > Shay,
> > > > 
> > > > Did you shutdown the primary node? and run the cluster state from the  
> > > > secondary node?
> > > > 
> > > > Thanks!
> > > > 
> > > > -- Liyu
> > > > 
> > > > On Tue, Dec 20, 2011 at 9:09 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > > 
> > > > > You will have to be more specific about the step to recreate it. I  
> > > > > started two elasticsearch instances with TRACE logging, ran cluster state  
> > > > > and did not see the failure. Start from fresh instances.
> > > > > 
> > > > > On Wed, Dec 21, 2011 at 6:29 AM, Liyu [liyuyi@gmail.com](mailto:liyuyi@gmail.com) wrote:
> > > > > 
> > > > > > Hi, I just ran into an exception, here are the steps to reproduce it.
> > > > > > 
> > > > > > 1. I have 2 ES servers, vanilla setup
> > > > > > 2. Change the logging level to TRACE in logging.yml  
> > > > > > rootLogger: TRACE, console, file
> > > > > > 3. Shutdown the primary node
> > > > > > 4. Run the command  
> > > > > > $ curl -XGET [http://secondaryhost:9200/\_cluster/state](http://secondaryhost:9200/_cluster/state)  
> > > > > > and get the following error.  
> > > > > > {"error":"NullPointerException[null]","status":500}
> > > > > > 
> > > > > > Nothing left in the log file.
> > > > > > 
> > > > > > Any suggestions?
> > > > > > 
> > > > > > Thanks.
> > > > > > 
> > > > > > -- Liyu

---

<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:** [July 6, 2017, 3:44am UTC](https://discuss.elastic.co/t/es-0-18-3-npe-when-set-logging-level-to-trace/6206/8 "2017-07-06T03:44:41Z")

</div>


