# Getting this error "because \\"namedWriteable\\" is null"

**URL:** <https://forum.opensearch.org/t/getting-this-error-because-namedwriteable-is-null/11382>\
**Category:** Open Source Elasticsearch and Kibana\
**Tags:** troubleshoot\
**Created:** [October 31, 2022, 2:51pm UTC](https://forum.opensearch.org/t/getting-this-error-because-namedwriteable-is-null/11382 "2022-10-31T14:51:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yogesh85](https://avatars.discourse-cdn.com/v4/letter/y/ecae2f/32.png) [@yogesh85](https://forum.opensearch.org/u/yogesh85)\
**Post date:** [October 31, 2022, 2:51pm UTC](https://forum.opensearch.org/t/getting-this-error-because-namedwriteable-is-null/11382/1 "2022-10-31T14:51:33Z")

</div>

Hi All,

Executing below query and getting this error:

Error:  
“type”: “null\_pointer\_exception”,  
“reason”: “Cannot invoke "org.opensearch.common.io.stream.NamedWriteable.getWriteableName()" because "namedWriteable" is null”

Query:  
{  
“aggs”: {“time\_series”: {  
“date\_histogram”: {  
“fixed\_interval”: “1d”,  
“field”: “@timestamp”  
},  
“aggs”: {“diff\_terms”: {  
“multi\_terms”: {  
“size”: 20000000,  
“terms”: [  
{“field”: “tag.process\_name.keyword”},  
{“field”: “tag.env.keyword”},  
{“field”: “tag.status.keyword”},  
{“field”: “tag.endpoint.keyword”}  
]  
},  
“aggs”: {“d\_count”: {“sum”: {“field”: “cai\_process.total\_count”}}}  
}}  
}}  
}

Same query works on ElasticSearch 7.15 but getting error in OpenSearch 2.1.0. Please help.

---

<div class="post-metadata">

**Author:** ![yogesh85](https://avatars.discourse-cdn.com/v4/letter/y/ecae2f/32.png) [@yogesh85](https://forum.opensearch.org/u/yogesh85)\
**Post date:** [November 2, 2022, 6:05pm UTC](https://forum.opensearch.org/t/getting-this-error-because-namedwriteable-is-null/11382/2 "2022-11-02T18:05:21Z")

</div>

If I use terms aggregation instead of multi\_terms, I don’t get the error.
