# "Cannot copy field \[ \] to fields \[ \]. Copy-to currently only works for value-type fields, not objects

**URL:** <https://discuss.elastic.co/t/cannot-copy-field-to-fields-copy-to-currently-only-works-for-value-type-fields-not-objects/280429>\
**Category:** Elasticsearch\
**Created:** [August 4, 2021, 12:46pm UTC](https://discuss.elastic.co/t/cannot-copy-field-to-fields-copy-to-currently-only-works-for-value-type-fields-not-objects/280429 "2021-08-04T12:46:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moziada](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@moziada](https://discuss.elastic.co/u/moziada)\
**Post date:** [August 4, 2021, 12:46pm UTC](https://discuss.elastic.co/t/cannot-copy-field-to-fields-copy-to-currently-only-works-for-value-type-fields-not-objects/280429/1 "2021-08-04T12:46:30Z")

</div>

ES = ver 7.14  
Linux , mysql 8  
The error happens after upgrade to **7.14** from 7.13  
the issue :  
I use Logstash to input to ES from MySQL  
U used to add null (nil) value to copy\_to field, after upgrade it is not accepted and throw an exception  
e.x  
{  
...  
"product\_id"=\>12345,  
"price"=\>10,  
@timestamp"=\>2021-08-03T23:51:58.209Z,  
....  
"categories"=\>nil,  
.....  
}

**"reason"=\>"Cannot copy field [categories] to fields [catch\_all]. Copy-to currently only works for value-type fields, not objects."}}}}**

Logstash :  
output {  
elasticsearch {  
hosts =\> "localhost:9200"  
index =\> "my-index"  
document\_id =\> "%{product\_id}"  
**doc\_as\_upsert** =\> true  
action =\> "update"  
}  
stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![dancerjohn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dancerjohn/32/57013_2.png) [@dancerjohn](https://discuss.elastic.co/u/dancerjohn)\
**Post date:** [August 13, 2021, 5:20pm UTC](https://discuss.elastic.co/t/cannot-copy-field-to-fields-copy-to-currently-only-works-for-value-type-fields-not-objects/280429/2 "2021-08-13T17:20:38Z")

</div>

I am having the same issue. Any workaround found?

---

<div class="post-metadata">

**Author:** ![freost](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freost/32/93339_2.png) [@freost](https://discuss.elastic.co/u/freost)\
**Post date:** [August 18, 2021, 11:28am UTC](https://discuss.elastic.co/t/cannot-copy-field-to-fields-copy-to-currently-only-works-for-value-type-fields-not-objects/280429/3 "2021-08-18T11:28:51Z")

</div>

We're having the same issue. It appears that copying "null" values triggers the error ... this started happening after we upgraded our cluster to 7.14.0.

A fix is coming in 7.14.1 [https://github.com/elastic/elasticsearch/pull/76665/files](https://github.com/elastic/elasticsearch/pull/76665/files)

---

<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:** [September 15, 2021, 11:29am UTC](https://discuss.elastic.co/t/cannot-copy-field-to-fields-copy-to-currently-only-works-for-value-type-fields-not-objects/280429/4 "2021-09-15T11:29:41Z")

</div>

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