# Multi-tenancy kibana default index error

**URL:** <https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466>\
**Category:** Search Guard\
**Created:** [May 31, 2017, 11:58am UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466 "2017-05-31T11:58:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksey\_Kiselev](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aleksey\_Kiselev](https://forum.search-guard.com/u/Aleksey_Kiselev)\
**Post date:** [May 31, 2017, 11:58am UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/1 "2017-05-31T11:58:05Z")

</div>

I try to use kibana multi-tenancy. With global tenant all good. But if i switch to other tenant and try to set default index pattern i have a error:

> {“statusCode”:404,“error”:“Not Found”,“message”:“[document\_missing\_exception] [config][5.4.0]: document missing, with { index\_uuid="n6YqxlkCT1mPbezpnrWa3g" & shard="0" & index=".kibana\_-1180334778\_testmain" }”}

> ``

But in elastic search server logs i found this message:

[2017-05-31T11:29:23,354][INFO][o.e.c.m.MetaDataCreateIndexService] [Master-01] [.kibana\_-1180334778\_testmain] creating index, cause [api], templates , shards [1]/[1], mappings [config]  
[2017-05-31T11:29:23,981][INFO][o.e.c.r.a.AllocationService] [Master-01] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana\_-1180334778\_testmain][0]] …]).  
[2017-05-31T11:29:24,230][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [config]  
[2017-05-31T11:31:06,358][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] create\_mapping [index-pattern]  
[2017-05-31T11:31:08,786][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [index-pattern]

``

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [May 31, 2017, 12:04pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/2 "2017-05-31T12:04:40Z")

</div>

Did you upgrade from a previous version by chance? Maybe you hit the following bug:

> <https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9>
>
> Steps to reproduce:
> 
> \- Install ES and KI 5.3.1, with full MT support 
> \- Log i…n with a user that has some tenants
> \- Choose the Global tenant
> \- Create an index pattern, a visualization etc.
> \- Choose a tenant other than Global
> \- Create an index pattern, a visualization etc.
> \- Upgrade ES and KI to 5.3.2
> \- Login again with the same user
> 
> Result: 
> When accessing the Global tenant, everything works as expected. When trying to access data the non-Global tenant, 404s are returned.
> 
> Cause:
> I'm not 100% sure yet about the sequence of calls from KI, but here are the findings so far:
> 
> When creating the indices with 5.3.1, both have one entry of type config with id 5.3.1:
> 
> \`\`\`
> {
> \_index: ".kibana",
> \_type: "config",
> \_id: "5.3.1",
> \_score: 1,
> \_source: { 
> buildNum: 14844,
> defaultIndex: "humanresources"
> }
> \`\`\`
> 
> After the upgrade to 5.3.2, the Global tenant has a second entry with version 5.3.2, and the same contents as the 5.3.1 one:
> 
> \`\`\`
> {
> \_index: ".kibana",
> \_type: "config",
> \_id: "5.3.2",
> \_score: 1,
> \_source: {
> buildNum: 14849,
> defaultIndex: "humanresources"
> }
> }
> \`\`\`
> 
> This entry is missing in all other tenants, leading to 404s. There seems to be a problem with the PrivilegesInterceptor when Kibana tries to copy over the entry, or creating it new. 
> 
> I will investigate the calls from KI during the upgrade process.
> 
> Might be related to #8

> **···**
>
> On Wednesday, May 31, 2017 at 1:58:06 PM UTC+2, Aleksey Kiselev wrote:
> 
> > I try to use kibana multi-tenancy. With global tenant all good. But if i switch to other tenant and try to set default index pattern i have a error:
> > 
> > > {“statusCode”:404,“error”:“Not Found”,“message”:“[document\_missing\_exception] [config][5.4.0]: document missing, with { index\_uuid="n6YqxlkCT1mPbezpnrWa3g" & shard="0" & index=".kibana\_-1180334778\_testmain" }”}
> 
> > > ``
> 
> > 
> 
> > But in elastic search server logs i found this message:
> 
> > 
> 
> > [2017-05-31T11:29:23,354][INFO][o.e.c.m.MetaDataCreateIndexService] [Master-01] [.kibana\_-1180334778\_testmain] creating index, cause [api], templates , shards [1]/[1], mappings [config]  
> > [2017-05-31T11:29:23,981][INFO][o.e.c.r.a.AllocationService] [Master-01] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana\_-1180334778\_testmain][0]] …]).  
> > [2017-05-31T11:29:24,230][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [config]  
> > [2017-05-31T11:31:06,358][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] create\_mapping [index-pattern]  
> > [2017-05-31T11:31:08,786][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [index-pattern]
> 
> > ``
> 
> > 
> 
> > What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Aleksey\_Kiselev](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aleksey\_Kiselev](https://forum.search-guard.com/u/Aleksey_Kiselev)\
**Post date:** [May 31, 2017, 12:14pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/3 "2017-05-31T12:14:01Z")

</div>

I think is the same error. Is this my config document:  
{  
“_index": ".kibana_-1180334778\_testmain”,  
“\_type”: “config”,  
“\_id”: “5.1.2”,  
“\_score”: 1,  
“\_source”: {  
“buildNum”: 14588,  
“defaultIndex”: “XXXXXXX”  
}  
}

``

In this document version: 5.1.2. But now I have a 5.4.0 es version. I will try to change config version in that document.

> **···**
>
> среда, 31 мая 2017 г., 15:04:40 UTC+3 пользователь Jochen Kressin написал:
> 
> > Did you upgrade from a previous version by chance? Maybe you hit the following bug:
> 
> > [https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9](https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9)
> > 
> > On Wednesday, May 31, 2017 at 1:58:06 PM UTC+2, Aleksey Kiselev wrote:
> > 
> > > I try to use kibana multi-tenancy. With global tenant all good. But if i switch to other tenant and try to set default index pattern i have a error:
> > > 
> > > > {“statusCode”:404,“error”:“Not Found”,“message”:“[document\_missing\_exception] [config][5.4.0]: document missing, with { index\_uuid="n6YqxlkCT1mPbezpnrWa3g" & shard="0" & index=".kibana\_-1180334778\_testmain" }”}
> 
> > > > ``
> 
> > >
> 
> > > But in elastic search server logs i found this message:
> 
> > >
> 
> > > [2017-05-31T11:29:23,354][INFO][o.e.c.m.MetaDataCreateIndexService] [Master-01] [.kibana\_-1180334778\_testmain] creating index, cause [api], templates , shards [1]/[1], mappings [config]  
> > > [2017-05-31T11:29:23,981][INFO][o.e.c.r.a.AllocationService] [Master-01] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana\_-1180334778\_testmain][0]] …]).  
> > > [2017-05-31T11:29:24,230][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [config]  
> > > [2017-05-31T11:31:06,358][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] create\_mapping [index-pattern]  
> > > [2017-05-31T11:31:08,786][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [index-pattern]
> 
> > > ``
> 
> > >
> 
> > > What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [May 31, 2017, 12:15pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/4 "2017-05-31T12:15:44Z")

</div>

It should match the Kibana version, but you should run the same ES and KI version anyways. Yes, updating the version should work as a temporary workaround until the fix is released.

> **···**
>
> On Wednesday, May 31, 2017 at 2:14:01 PM UTC+2, Aleksey Kiselev wrote:
> 
> > I think is the same error. Is this my config document:  
> > {  
> > “_index": ".kibana_-1180334778\_testmain”,  
> > “\_type”: “config”,  
> > “\_id”: “5.1.2”,  
> > “\_score”: 1,  
> > “\_source”: {  
> > “buildNum”: 14588,  
> > “defaultIndex”: “XXXXXXX”  
> > }  
> > }
> 
> > ``
> 
> > 
> 
> > In this document version: 5.1.2. But now I have a 5.4.0 es version. I will try to change config version in that document.
> 
> > среда, 31 мая 2017 г., 15:04:40 UTC+3 пользователь Jochen Kressin написал:
> > 
> > > Did you upgrade from a previous version by chance? Maybe you hit the following bug:
> 
> > > [https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9](https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9)
> > > 
> > > On Wednesday, May 31, 2017 at 1:58:06 PM UTC+2, Aleksey Kiselev wrote:
> > > 
> > > > I try to use kibana multi-tenancy. With global tenant all good. But if i switch to other tenant and try to set default index pattern i have a error:
> > > > 
> > > > > {“statusCode”:404,“error”:“Not Found”,“message”:“[document\_missing\_exception] [config][5.4.0]: document missing, with { index\_uuid="n6YqxlkCT1mPbezpnrWa3g" & shard="0" & index=".kibana\_-1180334778\_testmain" }”}
> 
> > > > > ``
> 
> > > >
> 
> > > > But in elastic search server logs i found this message:
> 
> > > >
> 
> > > > [2017-05-31T11:29:23,354][INFO][o.e.c.m.MetaDataCreateIndexService] [Master-01] [.kibana\_-1180334778\_testmain] creating index, cause [api], templates , shards [1]/[1], mappings [config]  
> > > > [2017-05-31T11:29:23,981][INFO][o.e.c.r.a.AllocationService] [Master-01] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana\_-1180334778\_testmain][0]] …]).  
> > > > [2017-05-31T11:29:24,230][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [config]  
> > > > [2017-05-31T11:31:06,358][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] create\_mapping [index-pattern]  
> > > > [2017-05-31T11:31:08,786][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [index-pattern]
> 
> > > > ``
> 
> > > >
> 
> > > > What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Aleksey\_Kiselev](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aleksey\_Kiselev](https://forum.search-guard.com/u/Aleksey_Kiselev)\
**Post date:** [May 31, 2017, 12:24pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/5 "2017-05-31T12:24:11Z")

</div>

After updating document version all works fine!

Really thanks for the fast answer!

> **···**
>
> среда, 31 мая 2017 г., 15:15:44 UTC+3 пользователь Jochen Kressin написал:
> 
> > It should match the Kibana version, but you should run the same ES and KI version anyways. Yes, updating the version should work as a temporary workaround until the fix is released.
> > 
> > On Wednesday, May 31, 2017 at 2:14:01 PM UTC+2, Aleksey Kiselev wrote:
> > 
> > > I think is the same error. Is this my config document:  
> > > {  
> > > “_index": ".kibana_-1180334778\_testmain”,  
> > > “\_type”: “config”,  
> > > “\_id”: “5.1.2”,  
> > > “\_score”: 1,  
> > > “\_source”: {  
> > > “buildNum”: 14588,  
> > > “defaultIndex”: “XXXXXXX”  
> > > }  
> > > }
> 
> > > ``
> 
> > >
> 
> > > In this document version: 5.1.2. But now I have a 5.4.0 es version. I will try to change config version in that document.
> 
> > > среда, 31 мая 2017 г., 15:04:40 UTC+3 пользователь Jochen Kressin написал:
> > > 
> > > > Did you upgrade from a previous version by chance? Maybe you hit the following bug:
> 
> > > > [https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9](https://github.com/floragunncom/search-guard-module-kibana-multitenancy/issues/9)
> > > > 
> > > > On Wednesday, May 31, 2017 at 1:58:06 PM UTC+2, Aleksey Kiselev wrote:
> > > > 
> > > > > I try to use kibana multi-tenancy. With global tenant all good. But if i switch to other tenant and try to set default index pattern i have a error:
> > > > > 
> > > > > > {“statusCode”:404,“error”:“Not Found”,“message”:“[document\_missing\_exception] [config][5.4.0]: document missing, with { index\_uuid="n6YqxlkCT1mPbezpnrWa3g" & shard="0" & index=".kibana\_-1180334778\_testmain" }”}
> 
> > > > > > ``
> 
> > > > >
> 
> > > > > But in elastic search server logs i found this message:
> 
> > > > >
> 
> > > > > [2017-05-31T11:29:23,354][INFO][o.e.c.m.MetaDataCreateIndexService] [Master-01] [.kibana\_-1180334778\_testmain] creating index, cause [api], templates , shards [1]/[1], mappings [config]  
> > > > > [2017-05-31T11:29:23,981][INFO][o.e.c.r.a.AllocationService] [Master-01] Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[.kibana\_-1180334778\_testmain][0]] …]).  
> > > > > [2017-05-31T11:29:24,230][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [config]  
> > > > > [2017-05-31T11:31:06,358][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] create\_mapping [index-pattern]  
> > > > > [2017-05-31T11:31:08,786][INFO][o.e.c.m.MetaDataMappingService] [Master-01] [.kibana\_-1180334778\_testmain/n6YqxlkCT1mPbezpnrWa3g] update\_mapping [index-pattern]
> 
> > > > > ``
> 
> > > > >
> 
> > > > > What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Rakesh](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rakesh](https://forum.search-guard.com/u/Rakesh)\
**Post date:** [May 31, 2017, 7:35pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/6 "2017-05-31T19:35:02Z")

</div>

I am also getting same error with version 5.2.2. Where do we update the version or is there any fix for this?

Config: Error 404 Not Found: [document\_missing\_exception] [config][5.2.2]: document missing, with { index\_uuid=“AJz_pRmu62bVeyxWXIw" & shard=“0” & index=".kibana_-85117435\_cadoperations” }

---

<div class="post-metadata">

**Author:** ![Aleksey\_Kiselev](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aleksey\_Kiselev](https://forum.search-guard.com/u/Aleksey_Kiselev)\
**Post date:** [May 31, 2017, 9:51pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/7 "2017-05-31T21:51:49Z")

</div>

At first step I check to global tenant and make query in Dev tools (sense):

GET .kibana/config

``

Look on all documents. In that list you should find a document with your kibana version.  
At second step I’m copy document body with right version.

At third step I’m switch to other tenant and delete all .kibana/config with wrong version. Query like:

DELETE .kibana/config/5.1.2  
DELETE .kibana/config/5.1.3  
…

``

At next step you should put right document like:

POST .kibana/config/5.4.0  
{  
… document body json here …  
}

``

It’s all. Try this please.

> **···**
>
> среда, 31 мая 2017 г., 22:35:02 UTC+3 пользователь Rakesh написал:
> 
> > I am also getting same error with version 5.2.2. Where do we update the version or is there any fix for this?
> > 
> > Config: Error 404 Not Found: [document\_missing\_exception] [config][5.2.2]: document missing, with { index\_uuid=“AJz_pRmu62bVeyxWXIw" & shard=“0” & index=".kibana_-85117435\_cadoperations” }
> 
> >

---

<div class="post-metadata">

**Author:** ![Rakesh](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Rakesh](https://forum.search-guard.com/u/Rakesh)\
**Post date:** [June 1, 2017, 6:12pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/8 "2017-06-01T18:12:50Z")

</div>

It worked 🙂  
Thank you Aleksey!

> **···**
>
> > >

---

<div class="post-metadata">

**Author:** ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)\
**Post date:** [June 10, 2017, 7:25pm UTC](https://forum.search-guard.com/t/multi-tenancy-kibana-default-index-error/466/9 "2017-06-10T19:25:04Z")

</div>

fixed with multitenancy v2 released today

> **···**
>
> On Thursday, 1 June 2017 20:12:50 UTC+2, Rakesh wrote:
> 
> > It worked 🙂  
> > Thank you Aleksey!
> 
> > > >
