# Painless request returns unexpected field 'source'

**URL:** <https://discuss.elastic.co/t/painless-request-returns-unexpected-field-source/128339>\
**Category:** Kibana\
**Created:** [April 17, 2018, 11:15am UTC](https://discuss.elastic.co/t/painless-request-returns-unexpected-field-source/128339 "2018-04-17T11:15:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PolterFox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polterfox/32/29781_2.png) [@PolterFox](https://discuss.elastic.co/u/PolterFox)\
**Post date:** [April 17, 2018, 11:15am UTC](https://discuss.elastic.co/t/painless-request-returns-unexpected-field-source/128339/1 "2018-04-17T11:15:45Z")

</div>

Hey guys,

I have a problem with a painless request in the kibana console.

My request body looks like this:

> **My request**
>
> ```
> GET logstash-2018.04.17/_search
> {
> "query": {
> "match_all": {}
> },
> "script_fields": {
> "sc_username": {
> "script":{
> "lang": "painless",
> "source": "...MyPainlessScript..."
> }
> }
> }  
> }
> 
> ```

Kibana returns the following message:

> **The result**
>
> ```
> {
> "error": {
> "root_cause": [
> {
> "type": "script_parse_exception",
> "reason": "unexpected field [source]"
> }
> ],
> "type": "search_phase_execution_exception",
> "reason": "all shards failed",
> "phase": "query",
> "grouped": true,
> "failed_shards": [
> {
> "shard": 0,
> "index": "logstash-2018.04.17",
> "node": "...",
> "reason": {
> "type": "script_parse_exception",
> "reason": "unexpected field [source]"
> }
> }
> ]
> },
> "status": 500
> }
> 
> ```

I hope anybody can help me!

Best regards,  
Robert

---

<div class="post-metadata">

**Author:** ![PolterFox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polterfox/32/29781_2.png) [@PolterFox](https://discuss.elastic.co/u/PolterFox)\
**Post date:** [April 17, 2018, 1:23pm UTC](https://discuss.elastic.co/t/painless-request-returns-unexpected-field-source/128339/2 "2018-04-17T13:23:06Z")

</div>

The problem was a incompatible version of ES.

---

<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:** [May 15, 2018, 1:23pm UTC](https://discuss.elastic.co/t/painless-request-returns-unexpected-field-source/128339/3 "2018-05-15T13:23:21Z")

</div>

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