# Exiting: error connecting to Kibana: fail to get the Kibana version

**URL:** https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353
**Category:** Kibana
**Created:** [August 22, 2023, 10:34am UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353 "2023-08-22T10:34:27Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [August 22, 2023, 10:34am UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/1 "2023-08-22T10:34:28Z")

</div>

Hi, I am new to ElasticStack and trying to load dashboards into Kibana.  
Kibana and Elastic Search run on same cluster and I want to monitor a remote server with metricbeat.

When I enter the command metricbeat setup --dashboards i get the following error message:

```auto
Exiting: error connecting to Kibana: fail to get the Kibana version: HTTP GET request to https://XXXX:port /api/status fails: invalid character '<' looking for beginning of va ./html>nter>nginx</center>ion Required</h1></center>d>

```

Any idea what I could do here?  
Thanks a lot

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [August 22, 2023, 1:55pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/2 "2023-08-22T13:55:27Z")

</div>

Hi @BenKenobi,

Welcome to the community! Which versions of Elasticsearch, Kibana and metricbeat are you using? Can you check your connection settings for metricbeat and share your config?

---

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [August 22, 2023, 2:44pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/3 "2023-08-22T14:44:28Z")

</div>

Hi, thanks.

Version numbers:

metricbeat 7.17.12  
Kibana: 8.9  
Elastic: 7.17.7

```auto
# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  host: "https://XXX:443"

# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["https://XXX:443"]

  # Protocol - either `http` (default) or `https`.
  protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  username: "username"
  password: "${password}"

```

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [August 22, 2023, 3:17pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/4 "2023-08-22T15:17:18Z")

</div>

Is there a reason why you have different versions of Kibana, Elasticsearch and Metricbeat? Looking at the [compatibility matrix](https://www.elastic.co/support/matrix#matrix_compatibility) you'll see that Elasticsearch and Kibana should be on the same version.

---

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [August 23, 2023, 2:17pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/5 "2023-08-23T14:17:35Z")

</div>

Hi Carly,

my mistake: The correct version numbers are

Kibana 7.17.7  
Elastic 7.17.7  
Metricbeat 7.17.12

Regards

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [August 24, 2023, 9:00am UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/6 "2023-08-24T09:00:46Z")

</div>

No worries @BenKenobi. That error suggests that metricbeat cannot connect to Kibana. Can you check your Kibana settings in the metricbeat config? I assume Kibana and Elasticsearch are both up and running and are accessible?

---

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [August 25, 2023, 12:35pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/7 "2023-08-25T12:35:22Z")

</div>

Hi Carly,

metricbeat cannot connect to Kibana as as we have a nginx proxy/WebServer in between.  
Kibana and Elasticsearch are both up and running.  
My colleague told me that instead of using the command "metricbeat setup --dashboards" to load the dashboards automatically there is a way to load a dashboard manually.

Could you tell me if this is correct and if yes, where in the documentation I can find that? Thanks

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [August 25, 2023, 12:49pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/8 "2023-08-25T12:49:07Z")

</div>

Hi @BenKenobi,

[As per the documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/load-kibana-dashboards.html) you either load the dashboards using the setup command as you've tried or [configure the dashboard loading in `metricbeat.yml`](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-dashboards.html).

If you have an instance where you have the dashboards, you could try using the export and import APIs instead.

The other thing to consider is using the [Log Monitoring](https://www.elastic.co/guide/en/observability/8.9/monitor-logs.html) and [Infrastructure Monitoring](https://www.elastic.co/guide/en/observability/8.9/analyze-metrics.html) apps within Kibana and see if those pre-built applications give you the views you need, especially the latter since you're capturing metrics with metricbeat.

---

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [August 29, 2023, 3:07pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/9 "2023-08-29T15:07:26Z")

</div>

Hi @carly.richmond

Thanks for the information regarding Dashboard Loading.  
I am trying to create a new dashboard and here I am chosing index pattern metrics-\* which has no fields to select from.  
Normally it should not be empty, right?  
I guess that I have to delete metrics-\* index pattern and load it again with metricbeat setup command as recommended here [Error in index or visualisations for "[Metricbeat System] Overview ECS" - Elastic Stack / Beats - Discuss the Elastic Stack](https://discuss.elastic.co/t/error-in-index-or-visualisations-for-metricbeat-system-overview-ecs/201490)?  
Thanks in advance

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

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/0/30bd1f83f9d3c7180ec01e62c9c187cf9d3cf351.png)

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [August 30, 2023, 3:24pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/10 "2023-08-30T15:24:57Z")

</div>

Hi @BenKenobi,

If you have extended the time range of the query and it's still not coming through then yes I would recommend following that thread.

Let us know how you get on!

---

<div class="post-metadata">

### Author: ![BenKenobi](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BenKenobi](https://discuss.elastic.co/u/BenKenobi)
#### Post date: [August 31, 2023, 3:25pm UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/11 "2023-08-31T15:25:54Z")

</div>

@carly.richmond I have deleted index pattern metrics-\* and also template metricbeat-7.17.12 and ran metricbeat setup

```auto
metricbeat setup

```

and

```auto
metricbeat -e

```

Then I restarted metricbeat.service  
Unfortunately no change.

When running command metricbeat setup I get following error message:  
[![](https://us1.discourse-cdn.com/elastic/optimized/3X/6/2/62d52eb94a1678a019f656f9c9a044ff11dedb0b_2_1035x24.png) ](https://us1.discourse-cdn.com/elastic/optimized/3X/6/2/62d52eb94a1678a019f656f9c9a044ff11dedb0b_2_1035x24.png)

There is no index pattern metricbeat-\* nor an index, just an index template :

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1b0e31510767ab5ce26866b5dd84721cc6854cf9.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/a/ea0abe39e5fe4ccca0ecd366dfe898de5954b556.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/0/6042273d599830cb1c3e3891deec02401c4a9a60.png)

The only enabled module is system module:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/2/02629119849fa7ce2ad42d376f10492293603928.png)

output test was successful:

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

As far as I understood from the guide [Metricbeat quick start: installation and configuration | Metricbeat Reference [8.9] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-installation-configuration.html) there is no need to create an index or an index pattern manually.  
This is done automatically when running setup command. It should not be that difficult to load data into Kibana.

---

<div class="post-metadata">

### Author: ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)
#### Post date: [September 1, 2023, 9:14am UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/12 "2023-09-01T09:14:30Z")

</div>

@BenKenobi yes you're right that metricbeat will create the index for you.

It's difficult to see from the error message image you provide, but I see you're getting a 403 forbidden message. It looks like Metricbeat can't connect to Elasticsearch.

Have you configured the proxy on both the Elasticsearch and Metricbeat sides? What does the config look like?

---

<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 29, 2023, 9:14am UTC](https://discuss.elastic.co/t/exiting-error-connecting-to-kibana-fail-to-get-the-kibana-version/341353/13 "2023-09-29T09:14:39Z")

</div>

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