# NullPointerException on empty filter with 0.90.3

**URL:** https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371
**Category:** Elasticsearch
**Created:** [August 28, 2013, 3:35pm UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371 "2013-08-28T15:35:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Benoit](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Benoit](https://discuss.elastic.co/u/Benoit)
#### Post date: [August 28, 2013, 3:35pm UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/1 "2013-08-28T15:35:56Z")

</div>

Hello,

I'm not sure this have already been reported, but i can't found it on  
github issues

This query  
$ curl [http://localhost:9200/\_search](http://localhost:9200/_search) -d '{"filter": {}, "query":  
{"match\_all": {}}}'

give the follwing errors :

{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[Uc0lFFnfRPWiN6twjVxqFg][m108][0]: QueryPhaseExecutionException[[m108][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m109][0]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[m109][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m0ar][3]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[m0ar][3]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m0ar][2]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[m0ar][2]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m110][0]: QueryPhaseExecutionException[[m110][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m0ar][1]: QueryPhaseExecutionException[[m0ar][1]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m111][0]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[m111][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m0ar][0]: QueryPhaseExecutionException[[m0ar][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m112][0]: QueryPhaseExecutionException[[m112][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m104][0]: QueryPhaseExecutionException[[m104][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m103][0]: QueryPhaseExecutionException[[m103][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m102][0]: QueryPhaseExecutionException[[m102][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m105][0]: QueryPhaseExecutionException[[m105][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[Uc0lFFnfRPWiN6twjVxqFg][m\_alert][0]: QueryPhaseExecutionException[[m\_alert][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m106][0]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[m106][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m107][0]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[m107][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }{[2hXe71VwRO6qAkz09mHlEw][m101][0]: RemoteTransportException[[sissor2][inet[/192.168.110.90:9300]][search/phase/query]]; nested: QueryPhaseExecutionException[[  
m101][0]: query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute main query]]; nested: NullPointerException; }]","status":500}

Removing the empty filter solve the problem.

I will try to reproduce it with a minimal setup.

Regards.

Benoît

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Benoit](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Benoit](https://discuss.elastic.co/u/Benoit)
#### Post date: [August 28, 2013, 3:51pm UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/2 "2013-08-28T15:51:35Z")

</div>

Hello again,

On Wednesday, August 28, 2013 5:35:56 PM UTC+2, Benoît wrote:

> I will try to reproduce it with a minimal setup.
> 
> Confirmed with a fresh extraction of 0.90.3 tar.gz

Steps :

$ tar zxf elasticsearch-0.90.3.tar.gz  
$ cd elasticsearch-0.90.3/  
$ bin/elasticsearch -f

From tutorial :

$ curl -XPUT '[http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy)' -d '{ "name" :  
"Shay Banon" }'  
$ curl -XPUT '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' -d '  
{  
"user": "kimchy",  
"postDate": "2009-11-15T13:12:00",  
"message": "Trying out Elastic Search, so far so good?"  
}'  
$ curl -XPUT '[http://localhost:9200/twitter/tweet/2](http://localhost:9200/twitter/tweet/2)' -d '  
{  
"user": "kimchy",  
"postDate": "2009-11-15T14:12:12",  
"message": "Another tweet, will it be indexed?"  
}'  
$ curl [http://localhost:9200/\_search](http://localhost:9200/_search) -d '{"filter": {}, "query":  
{"match\_all": {}}}'  
{"took":4,"timed\_out":false,"\_shards":{"total":5,"successful":3,"failed":2,  
"failures":[{"index":"twitter","shard":2,"status":500,"reason":"QueryPhaseExecutionException[[twitter][2]:  
query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: NullPointerException; "},{"index":"twitter","shard":3,  
"status":500,"reason":"QueryPhaseExecutionException[[twitter][3]:  
query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute  
main query]]; nested: NullPointerException; "}]},"hits":{"total":0,  
"max\_score":null,"hits":}}

Benoît

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)
#### Post date: [August 28, 2013, 5:15pm UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/3 "2013-08-28T17:15:31Z")

</div>

can you open an issue for this please?

simon

On Wednesday, August 28, 2013 5:51:35 PM UTC+2, Benoît wrote:

> Hello again,
> 
> On Wednesday, August 28, 2013 5:35:56 PM UTC+2, Benoît wrote:
> 
> > I will try to reproduce it with a minimal setup.
> > 
> > Confirmed with a fresh extraction of 0.90.3 tar.gz
> 
> Steps :
> 
> $ tar zxf elasticsearch-0.90.3.tar.gz  
> $ cd elasticsearch-0.90.3/  
> $ bin/elasticsearch -f
> 
> From tutorial :
> 
> $ curl -XPUT '[http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy)' -d '{ "name" :  
> "Shay Banon" }'  
> $ curl -XPUT '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' -d '  
> {  
> "user": "kimchy",  
> "postDate": "2009-11-15T13:12:00",  
> "message": "Trying out Elastic Search, so far so good?"  
> }'  
> $ curl -XPUT '[http://localhost:9200/twitter/tweet/2](http://localhost:9200/twitter/tweet/2)' -d '  
> {  
> "user": "kimchy",  
> "postDate": "2009-11-15T14:12:12",  
> "message": "Another tweet, will it be indexed?"  
> }'  
> $ curl [http://localhost:9200/\_search](http://localhost:9200/_search) -d '{"filter": {}, "query":  
> {"match\_all": {}}}'  
> {"took":4,"timed\_out":false,"\_shards":{"total":5,"successful":3,"failed":2  
> ,"failures":[{"index":"twitter","shard":2,"status":500,"reason":"QueryPhaseExecutionException[[twitter][2]:  
> query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute  
> main query]]; nested: NullPointerException; "},{"index":"twitter","shard":  
> 3,"status":500,"reason":"QueryPhaseExecutionException[[twitter][3]:  
> query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute  
> main query]]; nested: NullPointerException; "}]},"hits":{"total":0,  
> "max\_score":null,"hits":}}
> 
> Benoît

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)
#### Post date: [August 28, 2013, 8:30pm UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/4 "2013-08-28T20:30:15Z")

</div>

hmm I tried to reproduce this but I can't can you maybe show me some  
outputs of the logs with trace logging enabled to see where the exception  
occurs?

simon

On Wednesday, August 28, 2013 7:15:31 PM UTC+2, simonw wrote:

> can you open an issue for this please?
> 
> simon
> 
> On Wednesday, August 28, 2013 5:51:35 PM UTC+2, Benoît wrote:
> 
> > Hello again,
> > 
> > On Wednesday, August 28, 2013 5:35:56 PM UTC+2, Benoît wrote:
> > 
> > > I will try to reproduce it with a minimal setup.
> > > 
> > > Confirmed with a fresh extraction of 0.90.3 tar.gz
> > 
> > Steps :
> > 
> > $ tar zxf elasticsearch-0.90.3.tar.gz  
> > $ cd elasticsearch-0.90.3/  
> > $ bin/elasticsearch -f
> > 
> > From tutorial :
> > 
> > $ curl -XPUT '[http://localhost:9200/twitter/user/kimchy](http://localhost:9200/twitter/user/kimchy)' -d '{ "name" :  
> > "Shay Banon" }'  
> > $ curl -XPUT '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' -d '  
> > {  
> > "user": "kimchy",  
> > "postDate": "2009-11-15T13:12:00",  
> > "message": "Trying out Elastic Search, so far so good?"  
> > }'  
> > $ curl -XPUT '[http://localhost:9200/twitter/tweet/2](http://localhost:9200/twitter/tweet/2)' -d '  
> > {  
> > "user": "kimchy",  
> > "postDate": "2009-11-15T14:12:12",  
> > "message": "Another tweet, will it be indexed?"  
> > }'  
> > $ curl [http://localhost:9200/\_search](http://localhost:9200/_search) -d '{"filter": {}, "query":  
> > {"match\_all": {}}}'  
> > {"took":4,"timed\_out":false,"\_shards":{"total":5,"successful":3,"failed":  
> > 2,"failures":[{"index":"twitter","shard":2,"status":500,"reason":"QueryPhaseExecutionException[[twitter][2]:  
> > query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute  
> > main query]]; nested: NullPointerException; "},{"index":"twitter","shard"  
> > :3,"status":500,"reason":"QueryPhaseExecutionException[[twitter][3]:  
> > query[ConstantScore(_:_)],from[0],size[10]: Query Failed [Failed to execute  
> > main query]]; nested: NullPointerException; "}]},"hits":{"total":0,  
> > "max\_score":null,"hits":}}
> > 
> > Benoît

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Benoit](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Benoit](https://discuss.elastic.co/u/Benoit)
#### Post date: [August 29, 2013, 7:02am UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/5 "2013-08-29T07:02:25Z")

</div>

Hello,

Thanks for looking at this.

The issue : [NullPointerException on empty filter with 0.90.3 · Issue #3595 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3595)

A gist with log at DEBUG level :

> <https://gist.github.com/benoit-intrw/6374962>

On Wednesday, August 28, 2013 10:30:15 PM UTC+2, simonw wrote:

> hmm I tried to reproduce this but I can't can you maybe show me some  
> outputs of the logs with trace logging enabled to see where the exception  
> occurs?

I'm don't know what you mean by "trace logging enabled" so i've just set  
log level to DEBUG but i can quickly re-run the test with another  
configuration if needed.

Benoît

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Benoit](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@Benoit](https://discuss.elastic.co/u/Benoit)
#### Post date: [August 29, 2013, 9:32am UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/6 "2013-08-29T09:32:54Z")

</div>

Simon report that it was already fixed, see issue

> <https://github.com/elastic/elasticsearch/issues/3477>
>
> The following causes failure to execute search request:
> 
> \`\`\`
> curl -XPOST 'http:/…/localhost:9200/test/\_search?pretty=true' -d '{ 
> "query" : {"query\_string":{"query":"\*","default\_operator":"AND"}},
> "filter":{} 
> }'
> \`\`\`

Sorry to not have found the existing issue.

Benoît

On Thursday, August 29, 2013 9:02:25 AM UTC+2, Benoît wrote:

> Hello,
> 
> Thanks for looking at this.
> 
> The issue : [NullPointerException on empty filter with 0.90.3 · Issue #3595 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/3595)
> 
> A gist with log at DEBUG level :  
> [NullPointerException on empty filter with 0.90.3 · GitHub](https://gist.github.com/benoit-intrw/6374962)
> 
> On Wednesday, August 28, 2013 10:30:15 PM UTC+2, simonw wrote:
> 
> > hmm I tried to reproduce this but I can't can you maybe show me some  
> > outputs of the logs with trace logging enabled to see where the exception  
> > occurs?
> 
> I'm don't know what you mean by "trace logging enabled" so i've just set  
> log level to DEBUG but i can quickly re-run the test with another  
> configuration if needed.
> 
> Benoît

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:19am UTC](https://discuss.elastic.co/t/nullpointerexception-on-empty-filter-with-0-90-3/13371/7 "2017-07-06T02:19:03Z")

</div>


