# Kibana: mapping set to strict, dynamic introduction of \[references\] within \[doc\] is not allowed

**URL:** <https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403>\
**Category:** Kibana\
**Created:** [April 11, 2019, 12:38pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403 "2019-04-11T12:38:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [April 11, 2019, 12:38pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/1 "2019-04-11T12:38:12Z")

</div>

Hi

elastic, kibana 7.0.0 (rpm installation)  
Centos7

Updated both from 6.7.1 to 7.0.0.  
Cluster is green, but when browsing kibana on browser, I get:

> {"message":"mapping set to strict, dynamic introduction of [references] within [doc] is not allowed: [strict\_dynamic\_mapping\_exception] mapping set to strict, dynamic introduction of [references] within [doc] is not allowed","statusCode":400,"error":"Bad Request"}

Elasticsearch log has this:

```
[2019-04-11T15:32:31,084][DEBUG][o.e.a.b.TransportShardBulkAction] [dev-dc1-rk] [.kibana_1][0] failed to execute bulk item (create) index {[.kibana][_doc][config:7.0.0], source[{"config":{"buildNum":23117,"defaultIndex":"11ed3b50-4180-11e9-8c13-3da5f557b485"},"type":"config","references":[],"updated_at":"2019-04-11T12:32:31.082Z"}]}
org.elasticsearch.index.mapper.StrictDynamicMappingException: mapping set to strict, dynamic introduction of [references] within [doc] is not allowed
        at org.elasticsearch.index.mapper.DocumentParser.parseArray(DocumentParser.java:536) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.mapper.DocumentParser.innerParseObject(DocumentParser.java:394) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrNested(DocumentParser.java:381) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.mapper.DocumentParser.internalParseDocument(DocumentParser.java:98) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.mapper.DocumentParser.parseDocument(DocumentParser.java:71) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:267) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:770) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.shard.IndexShard.applyIndexOperation(IndexShard.java:747) ~[elasticsearch-7.0.0.jar:7.0.0]
        at org.elasticsearch.index.shard.IndexShard.applyIndexOperationOnPrimary(IndexShard.java:719) ~[elasticsearch-7.0.0.jar:7.0.0]

```

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![cedricw](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cedricw](https://discuss.elastic.co/u/cedricw)\
**Post date:** [April 11, 2019, 1:26pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/2 "2019-04-11T13:26:00Z")

</div>

Same issue here. Came from an elastic stack 6.7.1 and just updated to 7.0.0.  
Our stack runs in docker. Kibana has no additional config.

---

<div class="post-metadata">

**Author:** ![mbutton77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbutton77/32/37682_2.png) [@mbutton77](https://discuss.elastic.co/u/mbutton77)\
**Post date:** [April 11, 2019, 3:06pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/3 "2019-04-11T15:06:34Z")

</div>

Encountering the same behavior, after upgrading from 6.7.0 to 7.0.0 (tar.gz).  
I copied the configuration ( **kibana.yml** ) from my previous install.

I tried to find where was this reference to **mapping {dynamic: "strict"}** and it's located in the indexes .kibana\_\*

```auto
{
  ".kibana_1": {
    "aliases": {},
    "mappings": {
      "dynamic": "strict",
      "_meta": {
[...]

```

I then stopped Kibana and removed those indexes  
( **WARNING : it will delete all your visualizations and dashboards. Be sure to have a backup** ) :

```auto
curl -XDELETE localhost:9201/.kibana_*

```

Just to check it's OK :

```auto
curl -XGET localhost:9201/.kibana_*
{}

```

But when I start Kibana, it recreates **.kibana\_X** indexes with the attribute set to the incompatible value.

---

<div class="post-metadata">

**Author:** ![TQvist](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@TQvist](https://discuss.elastic.co/u/TQvist)\
**Post date:** [April 11, 2019, 3:08pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/4 "2019-04-11T15:08:11Z")

</div>

Same issue on Ubuntu 18.04.2  
Came from 6.7.1 to 7.0.0 (apt)

---

<div class="post-metadata">

**Author:** ![Reedler](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Reedler](https://discuss.elastic.co/u/Reedler)\
**Post date:** [April 11, 2019, 3:28pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/5 "2019-04-11T15:28:49Z")

</div>

Having the exact same issue coming from version 6.7.1.

---

<div class="post-metadata">

**Author:** ![Reedler](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Reedler](https://discuss.elastic.co/u/Reedler)\
**Post date:** [April 11, 2019, 4:07pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/6 "2019-04-11T16:07:31Z")

</div>

> [@mbutton77](#):
>
> .kibana\_\*

Removed the .kibana\_\* from above uninstalled kibana, then reinstalled.  
Kibana is up and running.

---

<div class="post-metadata">

**Author:** ![nicpenning](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicpenning/32/36366_2.png) [@nicpenning](https://discuss.elastic.co/u/nicpenning)\
**Post date:** [April 11, 2019, 7:59pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/7 "2019-04-11T19:59:32Z")

</div>

Be careful with this because this will remove all of your saved objects (searches, visualizations, dashboards, index patterns, etc..). Well at least it did for me.

Please let me know if there is a way to retrieve the saved objects because I can't find those anywhere after deleting kibana\* 😕

---

<div class="post-metadata">

**Author:** ![Reedler](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Reedler](https://discuss.elastic.co/u/Reedler)\
**Post date:** [April 11, 2019, 8:57pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/8 "2019-04-11T20:57:28Z")

</div>

Sorry forgot to mention that. This was a test cluster so I didn't care.

---

<div class="post-metadata">

**Author:** ![j.backs](https://avatars.discourse-cdn.com/v4/letter/j/bbce88/32.png) [@j.backs](https://discuss.elastic.co/u/j.backs)\
**Post date:** [April 12, 2019, 6:09am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/9 "2019-04-12T06:09:11Z")

</div>

Same issue on RHEL  
Came from 6.7.1 to 7.0.0 (yum)

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [April 12, 2019, 6:41am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/10 "2019-04-12T06:41:57Z")

</div>

I wonder, why anyone doesn't react from kibana's side!

This isn't some minor issue, after all this forbids us to use kibana at all.

Delete'ing .kibana\_\* indices is not an option, since all the settings, dashboards etc are gone after that.

Raul

---

<div class="post-metadata">

**Author:** ![mbutton77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbutton77/32/37682_2.png) [@mbutton77](https://discuss.elastic.co/u/mbutton77)\
**Post date:** [April 12, 2019, 8:51am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/11 "2019-04-12T08:51:43Z")

</div>

Yes you're right : it was only for debugging and as I have a backup, I forgot to mention that too.  
I'll edit my post with a warning.

---

<div class="post-metadata">

**Author:** ![warp](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@warp](https://discuss.elastic.co/u/warp)\
**Post date:** [April 12, 2019, 9:26am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/12 "2019-04-12T09:26:01Z")

</div>

Strange, I have the same problem when I setup a fresh installation of elasticsearch+kibana 7.0.0 and restore my backup from my old \<7.0.0 installation.  
When I however restore my backup into a fresh 6.7.1 installation and then simply update to 7.0.0, it still works fine even after the update.

---

<div class="post-metadata">

**Author:** ![nicpenning](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicpenning/32/36366_2.png) [@nicpenning](https://discuss.elastic.co/u/nicpenning)\
**Post date:** [April 12, 2019, 1:48pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/13 "2019-04-12T13:48:07Z")

</div>

I was fortunate to have exported all the objects from a month ago. This too is my test environment.

Would you back up with a snapshot or exported objects for this specific example?

---

<div class="post-metadata">

**Author:** ![mbutton77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbutton77/32/37682_2.png) [@mbutton77](https://discuss.elastic.co/u/mbutton77)\
**Post date:** [April 12, 2019, 2:59pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/14 "2019-04-12T14:59:26Z")

</div>

Glad to hear you found a backup.

As a I'm migrating from a 6.7.0 env, I copied the 6.7.0 ES _data_ directory into the 7.0.0 ES directory.  
That way, I can play with my data without any risk : if I mess it up, I just have to perform another copy.

---

<div class="post-metadata">

**Author:** ![mbutton77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbutton77/32/37682_2.png) [@mbutton77](https://discuss.elastic.co/u/mbutton77)\
**Post date:** [April 12, 2019, 3:05pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/15 "2019-04-12T15:05:17Z")

</div>

Interesting : the only migration path I'm aware of is the first one you described, by copying the data directory into the freshly installed 7.0.0 ES, as I understood it from the _rolling update page_ : [https://www.elastic.co/guide/en/elasticsearch/reference/7.0/rolling-upgrades.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/rolling-upgrades.html)

Then, what do you mean by "simply update to 7.0.0" ?

---

<div class="post-metadata">

**Author:** ![warp](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@warp](https://discuss.elastic.co/u/warp)\
**Post date:** [April 12, 2019, 3:11pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/16 "2019-04-12T15:11:02Z")

</div>

I see, I was not precise in my wording: I'm running elasticsearch/kibana in a k8s cluster (elasticsearch running as a statefulset). When I say "simply update", I mean that I just replace the pointer to the docker images in that statefulset, the effect is that the running containers are replaced and the data directories are preserved (that's the rolling upgrade as referenced by you).  
As said, this one works fo me.  
What doesn't work: I have regular backups (elasticsearch snapshot API) stashed into a gcs bucket. When I restore a snapshot that was created from 6.7 directly into an empty 7.0 elasticsearch/kibana installation, then it fails with the error discussed in this thread.

---

<div class="post-metadata">

**Author:** ![ogtool](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ogtool/32/18767_2.png) [@ogtool](https://discuss.elastic.co/u/ogtool)\
**Post date:** [April 12, 2019, 8:22pm UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/17 "2019-04-12T20:22:16Z")

</div>

Same issue here - elastic cloud managed environment - 6.7.1 to 7.0.0 upgrade via UI. Have just saved .kibana\_\*, deleted and restarted and can at least get in to the UI again now.

---

<div class="post-metadata">

**Author:** ![mbutton77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mbutton77/32/37682_2.png) [@mbutton77](https://discuss.elastic.co/u/mbutton77)\
**Post date:** [April 15, 2019, 7:54am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/18 "2019-04-15T07:54:45Z")

</div>

Ok, I get it now, thanks for explaining !

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [April 15, 2019, 8:15am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/19 "2019-04-15T08:15:26Z")

</div>

I opened bug report here, perhaps they'll review it there:

> <https://github.com/elastic/kibana/issues/35061>

Raul

---

<div class="post-metadata">

**Author:** ![kaem2111](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaem2111/32/24961_2.png) [@kaem2111](https://discuss.elastic.co/u/kaem2111)\
**Post date:** [April 15, 2019, 10:08am UTC](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403/21 "2019-04-15T10:08:40Z")

</div>

Hi,  
it seems, that the old kibana\_\* like e.q. kibana\_7 has type:doc while the new kibana\_8 has type:\_doc. When now using an index pattern of kibana\_\* you run into the strict rule.  
On my testsystem I had .kibana\_8 and .kibana\_7 where .kibana\_8 seems to be a migrated version of kibana\_7. I bypassed this issue by executing

```
curl -XGET localhost:9200/.kibana_7/_search >kibana_7
curl -XDELETE localhost:9200/.kibana_7

```

After Kibana restart I have access, but lost the Kibana Index patterns and the dashboards. I will wait for a fix before upgrading my prod system.

[Next page](https://discuss.elastic.co/t/kibana-mapping-set-to-strict-dynamic-introduction-of-references-within-doc-is-not-allowed/176403.md?page=2)
