# Error saving Spaces

**URL:** https://discuss.elastic.co/t/error-saving-spaces/157118
**Category:** Kibana
**Created:** [November 16, 2018, 6:16pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118 "2018-11-16T18:16:03Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 16, 2018, 6:16pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/1 "2018-11-16T18:16:04Z")

</div>

Hi all,  
I'm trying to create (using Kibana UI) a Spaces on Kibana 6.5 but I'm facing the error "Error saving space:".  
so I tried to create it using API. every command ends correctly but when I try to search it using Kibana UI I cannot find anything.

this is the output of `GET /api/spaces/space`

> {  
> "\_index" : "api",  
> "\_type" : "spaces",  
> "\_id" : "space",  
> "\_version" : 1,  
> "found" : true,  
> "\_source" : {  
> "id" : "marketing",  
> "name" : "Marketing",  
> "description" : "This is the Marketing Space",  
> "color" : "#aabbcc",  
> "initials" : "MK"  
> }  
> }

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 16, 2018, 6:25pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/2 "2018-11-16T18:25:20Z")

</div>

Hey @rschirin, is that the full error that you're seeing when trying to create the Space using the UI? If you check your Kibana logs, are there any additional errors shown there?

Also, how are you trying to search for the Space in the UI, are you not seeing it listed in the Space Management screen?

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 16, 2018, 6:28pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/3 "2018-11-16T18:28:27Z")

</div>

yes, it is the full error. so, it is empty.  
if I take a look to ` kibana.out` I can see this:

> {"type":"response","@timestamp":"2018-11-16T18:26:41Z","tags":,"pid":26008,"method":"post","statusCode":403,"req":{"url":"/api/spaces/space","method":"post","headers":{"host":"[saelk2.domain.com:5601](http://saelk2.domain.com:5601)","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0","accept":"application/json, text/plain, _/_","accept-language":"it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3","accept-encoding":"gzip, deflate","referer":"[http://saelk2.domain.com:5601/app/kibana","content-type":"application/json;charset=utf-8","kbn-version":"6.5.0","content-length":"37","connection":"keep-alive"},"remoteAddress":"10.0.37.149","userAgent":"10.0.37.149","referer":"http://saelk2.domain.com:5601/app/kibana"},"res":{"statusCode":403,"responseTime":14,"contentLength":9},"message":"POST](http://saelk2.domain.com:5601/app/kibana%22,%22content-type%22:%22application/json;charset=utf-8%22,%22kbn-version%22:%226.5.0%22,%22content-length%22:%2237%22,%22connection%22:%22keep-alive%22%7D,%22remoteAddress%22:%2210.0.37.149%22,%22userAgent%22:%2210.0.37.149%22,%22referer%22:%22http://saelk2.domain.com:5601/app/kibana%22%7D,%22res%22:%7B%22statusCode%22:403,%22responseTime%22:14,%22contentLength%22:9%7D,%22message%22:%22POST) /api/spaces/space 403 14ms - 9.0B"}

no, I cannot see it in the Space Management screen 😣

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 16, 2018, 6:39pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/4 "2018-11-16T18:39:44Z")

</div>

Hey @rschirin, are you using Kibana with security? If so, what user are you using and which roles are assigned?

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 16, 2018, 6:47pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/5 "2018-11-16T18:47:06Z")

</div>

these are the setted keys in my kibana.yml :

server.port: 5601  
server.host: 0.0.0.0

> elasticsearch.url: "[https://localhost:9200](https://localhost:9200)"  
> kibana.index: ".kibana"  
> elasticsearch.username: "elastic"  
> elasticsearch.password: "xxx"  
> xpack.reporting.encryptionKey: "xxx"  
> pid.file: /var/run/kibana/kibana.pid

I have a gold subscription. nothing else....

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 16, 2018, 7:19pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/6 "2018-11-16T19:19:31Z")

</div>

When you access Kibana, are you being prompted to login? If you are, would you mind running the following query using DevTools and replying with the response? `GET _xpack/security/_authenticate`

The reason I'm asking is that you're getting a 403 when you try to save the Space, which is generally when you're using security and you don't have the necessary privileges.

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 19, 2018, 9:15am UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/7 "2018-11-19T09:15:44Z")

</div>

sorry since I'm late, anyway this is the output result:

> {  
> "username" : "roger",  
> "roles" : [  
> "superuser"  
> ],  
> "full\_name" : null,  
> "email" : null,  
> "metadata" : {  
> "ldap\_dn" : "CN=roger,OU=User Accounts,DC=dc,DC=dc,DC=com",  
> "ldap\_groups" : [  
> "a lot of them"  
> ]  
> },  
> "enabled" : true  
> }

so, it seems ok.

---

<div class="post-metadata">

### Author: ![Alufolie](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Alufolie](https://discuss.elastic.co/u/Alufolie)
#### Post date: [November 19, 2018, 10:14am UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/8 "2018-11-19T10:14:57Z")

</div>

Hello,  
I've noticed the same behavior since the ELK update from 6.4.2 to 6.5. Like described in the OP I can create spaces through API requests but in the UI I get "Error Saving Space:".

An similar behavior I can observe when I try to manage a security Role. After clicking on a Role the Kibana status bar is showing up, but the UI keeps staying in the role lists. The kibana.log shows up an GET againts /api/spaces/space with 403 as response.

here the relevant log entries:  
[https://pastebin.com/TgrHV2Cz](https://pastebin.com/TgrHV2Cz)

GET \_xpack/security/\_authenticate:

> **Summary**
>
> {  
> "username" : "elastic",  
> "roles" : [  
> "superuser"  
> ],  
> "full\_name" : null,  
> "email" : null,  
> "metadata" : {  
> "\_reserved" : true  
> },  
> "enabled" : true  
> }

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 19, 2018, 3:36pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/9 "2018-11-19T15:36:30Z")

</div>

@Alufolie, it looks like the call to retrieve a list of Spaces is throwing a 403 for you. If you go to Management -\> Spaces, do you see any Spaces listed?

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 19, 2018, 3:38pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/10 "2018-11-19T15:38:15Z")

</div>

@rschirin interesting, you have the `superuser` role, so you shouldn't be getting a 403 when you try to save the Space. If you open up your browser's developer tools, and look at the network requests that are being made, do you see a specific request getting the 403?

---

<div class="post-metadata">

### Author: ![Alufolie](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Alufolie](https://discuss.elastic.co/u/Alufolie)
#### Post date: [November 19, 2018, 4:10pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/11 "2018-11-19T16:10:22Z")

</div>

Hey @Brandon_Kobel, thank you for the answer!

No I cant see any Spaces. Neither the created space through the api nor the default space.  
So, same behavior like described in the OP.

The Kibana UI gives me also a 403 when I try to add a space through management -\> spaces while monitoring the traffic with the browser dev tools.

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 19, 2018, 4:45pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/12 "2018-11-19T16:45:36Z")

</div>

@Alufolie, have you specified the `kibana.index` setting in your `kibana.yml`?

---

<div class="post-metadata">

### Author: ![Alufolie](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Alufolie](https://discuss.elastic.co/u/Alufolie)
#### Post date: [November 20, 2018, 7:33am UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/13 "2018-11-20T07:33:38Z")

</div>

@Brandon_Kobel  
yes.  
kibana.index: ".kibana"

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 20, 2018, 12:45pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/14 "2018-11-20T12:45:47Z")

</div>

@Brandon_Kobel, opening `Management-->Spaces` section I'm getting this:

`GET https://ftpmonitoring.crifnet.com/api/spaces/space 403 @ vendors.bundle.js:277`

but I'm not facing any popup error. it seems to be hidden.  
then, when I click on `Create Space` (after that I filled a name) I faced this one:

`POST https://ftpmonitoring.crifnet.com/api/spaces/space 403 @ vendors.bundle.js:277`

so, effectively there is a 403 error

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 20, 2018, 3:23pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/15 "2018-11-20T15:23:21Z")

</div>

I'm having trouble replicating what you all are seeing. You you all mind running the following query using the Dev Tools application in Kibana and replying with the response?

```auto
GET _xpack/security/user/_privileges

```

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 20, 2018, 4:12pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/16 "2018-11-20T16:12:36Z")

</div>

that's the output:

```
{
  "cluster" : [
    "all"
  ],
  "global" : [],
  "indices" : [
    {
      "names" : [
        "*"
      ],
      "privileges" : [
        "all"
      ]
    }
  ],
  "applications" : [
    {
      "application" : "*",
      "privileges" : [
        "*"
      ],
      "resources" : [
        "*"
      ]
    }
  ],
  "run_as" : [
    "*"
  ]
}
```

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 20, 2018, 4:47pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/17 "2018-11-20T16:47:01Z")

</div>

Thanks for working through this with me @rschirin, I really appreciate it.

Those privileges look completely fine for the superuser role which I saw assigned.

Would you mind also running the following two queries using Dev Tools and replying with their responses?

```auto
GET .kibana/doc/_search
{
  "query": {
        "terms" : { "type" : ["space"]}
    }
}

```

```auto
GET _xpack/security/user/_has_privileges
{
  "applications": [
    {
      "application": "kibana-.kibana",
      "resources": "space:default",
      "privileges": [
        "action:login"
      ]
    }
  ]
}

```

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 20, 2018, 5:25pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/18 "2018-11-20T17:25:50Z")

</div>

hey @Brandon_Kobel, are you kidding me? thank you for the help

this is the output of the first query:

```
{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : ".kibana_7",
        "_type" : "doc",
        "_id" : "space:default",
        "_score" : 1.0,
        "_source" : {
          "space" : {
            "name" : "Default",
            "description" : "This is your default space!",
            "color" : "#00bfb3",
            "_reserved" : true
          },
          "type" : "space",
          "updated_at" : "2018-11-16T17:14:11.779Z"
        }
      }
    ]
  }
}

```

while this is the output of the second query:

```
{
  "username" : "l72rugschiri",
  "has_all_requested" : true,
  "cluster" : { },
  "index" : { },
  "application" : {
    "kibana-.kibana" : {
      "space:default" : {
        "action:login" : true
      }
    }
  }
}
```

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [November 20, 2018, 6:31pm UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/19 "2018-11-20T18:31:12Z")

</div>

@rschirin those responses make me even more confused, as you should be being authorized to list the Spaces then...

If you could set the following two settings in your kibana.yml, this will enable our security audit logs and write the log output to a file:

```auto
xpack.security.audit.enabled: true
logging.dest: /var/log/kibana.log

```

if you could then restart Kibana, go to Management -\> Spaces to try to list all of the Spaces, and then attach the log output here, hopefully that'll provide some insight into what is going awry.

Also, would you mind sharing your full `kibana.yml` here (redacting the sensitive settings)?

---

<div class="post-metadata">

### Author: ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)
#### Post date: [November 21, 2018, 11:37am UTC](https://discuss.elastic.co/t/error-saving-spaces/157118/20 "2018-11-21T11:37:53Z")

</div>

so, enabling `audit` key I saw this error in the `kibana.out` file:

`{"type":"response","@timestamp":"2018-11-21T11:29:37Z","tags":[],"pid":16301,"method":"post","statusCode":403,"req":{"url":"/api/spaces/space","method":"post","headers":{"host":"saelk1.net.com:5601","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0","accept":"application/json, text/plain, */*","accept-language":"it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3","accept-encoding":"gzip, deflate","referer":"http://saelk1.net.com:5601/app/kibana","content-type":"application/json;charset=utf-8","kbn-version":"6.5.0","content-length":"27","connection":"keep-alive"},"remoteAddress":"10.0.37.149","userAgent":"10.0.37.149","referer":"http://saelk1.net.com:5601/app/kibana"},"res":{"statusCode":403,"responseTime":37,"contentLength":9},"message":"POST /api/spaces/space 403 37ms - 9.0B"}`

here you can find my `kibana.yml`:

```
server.port: 5601
server.host: 0.0.0.0
elasticsearch.url: "https://localhost:9200"
kibana.index: ".kibana"
elasticsearch.username: "elastic"
elasticsearch.password: "xxx"
xpack.reporting.encryptionKey: "xxxxxx"
xpack.infra.sources.default.metricAlias: "m.*"
elasticsearch.ssl.verificationMode: none
pid.file: /var/run/kibana/kibana.pid
logging.dest: /var/log/kibana/kibana.out
xpack.security.audit.enabled: true
```

[Next page](https://discuss.elastic.co/t/error-saving-spaces/157118.md?page=2)
