# Plugin index-pattern loading issues on multiple spaces

**URL:** https://discuss.elastic.co/t/plugin-index-pattern-loading-issues-on-multiple-spaces/350396
**Category:** Kibana
**Tags:** kibana-plugin-development
**Created:** [January 4, 2024, 4:31pm UTC](https://discuss.elastic.co/t/plugin-index-pattern-loading-issues-on-multiple-spaces/350396 "2024-01-04T16:31:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![JSFern83](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsfern83/32/130537_2.png) [@JSFern83](https://discuss.elastic.co/u/JSFern83)
#### Post date: [January 4, 2024, 4:31pm UTC](https://discuss.elastic.co/t/plugin-index-pattern-loading-issues-on-multiple-spaces/350396/1 "2024-01-04T16:31:31Z")

</div>

Hi All,

Our team is having trouble getting our plugin to load on multiple spaces. We have created an index-pattern for each space. Below is the configuration for the index-patterns saved in Elasticsearch.

```auto
Space 1
{
    "page": 1,
    "per_page": 20,
    "total": 1,
    "saved_objects": [
        {
            "type": "index-pattern",
            "id": "f7c83c95-fae5-4e9d-9f0a-9044b64dad0c",
            "namespaces": [
                "koat"
            ],
            "originId": "7ba4d7f0-6bdc-11eb-9964-a72532fd2883",
            "attributes": {
                "name": "p-sent*"
            },
            "references": [],
            "managed": false,
            "migrationVersion": {
                "index-pattern": "8.0.0"
            },
            "coreMigrationVersion": "8.8.0",
            "typeMigrationVersion": "8.0.0",
            "updated_at": "2023-10-20T16:30:39.569Z",
            "created_at": "2023-09-20T14:58:17.378Z",
            "version": "WzU0OTUwLDE3XQ==",
            "score": 0
        }
    ]
}

Space 2
{
    "page": 1,
    "per_page": 20,
    "total": 1,
    "saved_objects": [
        {
            "type": "index-pattern",
            "id": "84cad637-2177-469c-a295-93d99976bb8f",
            "namespaces": [
                "koat-2"
            ],
            "originId": "7ba4d7f0-6bdc-11eb-9964-a72532fd2883",
            "attributes": {
                "name": "p-sent*"
            },
            "references": [],
            "managed": false,
            "migrationVersion": {
                "index-pattern": "8.0.0"
            },
            "coreMigrationVersion": "8.8.0",
            "typeMigrationVersion": "8.0.0",
            "updated_at": "2023-10-25T14:55:36.884Z",
            "created_at": "2023-10-25T14:55:36.884Z",
            "version": "WzU2MDM0LDE3XQ==",
            "score": 0
        }
    ]
}

```

Regardless of which space we try to load the plugin on, it attempts to get the first index-pattern. We have checked our codebase and found no instance of an id being hardcoded anywhere. Could this possibly be related to user and role configurations? Thanks in advance.

---

<div class="post-metadata">

### Author: ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)
#### Post date: [January 4, 2024, 9:43pm UTC](https://discuss.elastic.co/t/plugin-index-pattern-loading-issues-on-multiple-spaces/350396/2 "2024-01-04T21:43:13Z")

</div>

Could you check and see if the `defaultIndex` advanced setting is set in each of these spaces to the same thing?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c1b829b26f6513dbcf136c7cae78acba89265ab5.png)

---

<div class="post-metadata">

### Author: ![JSFern83](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsfern83/32/130537_2.png) [@JSFern83](https://discuss.elastic.co/u/JSFern83)
#### Post date: [January 5, 2024, 4:06pm UTC](https://discuss.elastic.co/t/plugin-index-pattern-loading-issues-on-multiple-spaces/350396/3 "2024-01-05T16:06:25Z")

</div>

Hi Lukas,

It turns out that this was the precise issue as we had a default set in the original space and copied those settings over to the new space when we created it. Removing the defaults allowed the plugin to load. Thank you for your help.

---

<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: [February 2, 2024, 4:07pm UTC](https://discuss.elastic.co/t/plugin-index-pattern-loading-issues-on-multiple-spaces/350396/4 "2024-02-02T16:07:17Z")

</div>

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