# Error in pipeline aggregation

**URL:** <https://discuss.elastic.co/t/error-in-pipeline-aggregation/142373>\
**Category:** Elasticsearch\
**Created:** [July 31, 2018, 1:39pm UTC](https://discuss.elastic.co/t/error-in-pipeline-aggregation/142373 "2018-07-31T13:39:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![umeshmishra099](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umeshmishra099/32/47939_2.png) [@umeshmishra099](https://discuss.elastic.co/u/umeshmishra099)\
**Post date:** [July 31, 2018, 1:39pm UTC](https://discuss.elastic.co/t/error-in-pipeline-aggregation/142373/1 "2018-07-31T13:39:42Z")

</div>

Trying to run below request but getting error:  
/prof\_dc44f7ef-d590-44bc-8845-3f1cf82bc521/\_search Post  
{  
"aggregations": {  
"Frequency": {  
"terms": {  
"field": "gender",  
"size": 2147483647,  
"min\_doc\_count": 1,  
"shard\_min\_doc\_count": 0,  
"show\_term\_doc\_count\_error": false,  
"order": [  
{  
"\_count": "desc"  
},  
{  
"\_key": "asc"  
}  
]  
},  
"aggregations": {  
"count": {  
"value\_count": {}  
}  
}  
},  
"extended\_stats\_bucket": {  
"extended\_stats\_bucket": {  
"buckets\_path": [  
"Frequency\>count"  
],  
"gap\_policy": "skip",  
"sigma": 3  
}  
}  
}  
}

Error:

"root\_cause": [  
{  
"type": "illegal\_state\_exception",  
"reason": "value source config is invalid; must have either a field context or a script or marked as unwrapped"  
}  
],  
"type": "search\_phase\_execution\_exception",  
"reason": "all shards failed",  
"phase": "query",  
"grouped": true,  
"failed\_shards": [  
{  
"shard": 0,  
"index": "345196a2-4194-43e8-8e17-dd3aad7469c6",  
"node": "wIszR4kjRYyxjPudM6BXbg",  
"reason": {  
"type": "illegal\_state\_exception",  
"reason": "value source config is invalid; must have either a field context or a script or marked as unwrapped"  
}  
}  
],  
"caused\_by": {  
"type": "illegal\_state\_exception",  
"reason": "value source config is invalid; must have either a field context or a script or marked as unwrapped",  
"caused\_by": {  
"type": "illegal\_state\_exception",  
"reason": "value source config is invalid; must have either a field context or a script or marked as unwrapped"  
}  
}

---

<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 28, 2018, 1:39pm UTC](https://discuss.elastic.co/t/error-in-pipeline-aggregation/142373/2 "2018-08-28T13:39:57Z")

</div>

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