# Influxdb datasource failed to fetch

**URL:** <https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760>\
**Category:** InfluxDB\
**Created:** [March 12, 2024, 10:42am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760 "2024-03-12T10:42:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 12, 2024, 10:42am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/1 "2024-03-12T10:42:14Z")

</div>

- What Grafana version and what operating system are you using?  
10.2.3
- **What** are you trying to achieve?  
I am tryng to add a influxdb datasource.
- **How** are you trying to achieve it?  
I have a influxdb datasource with data inside:

```auto
http://localhost:8086/query?db=nagiosdb&pretty=true&q=show%20series

```

Running command above gives:

```auto
{
    "results": [
        {
            "statement_id": 0,
            "series": [
                {
                    "columns": [
                        "key"
                    ],
                    "values": [
                        [
                            "metrics,command=check-host-alive,crit-fill=none,host=localhost,performanceLabel=pl,service=hostcheck,unit=%,warn-fill=none"
                        ],
                        [
                            "metrics,command=check-host-alive,crit-fill=none,host=localhost,performanceLabel=rta,service=hostcheck,unit=ms,warn-fill=none"
...

```

I configure add new datasource with url [http://localhost:8086](http://localhost:8086), and database name nagiosdb. I did not change the other default values.

- What happened?  
I click save and test, but show failed to fetch.

- What did you **expect** to happen?  
Should add datasource successfully.

- Can you copy/paste the configuration(s) that you are having problems with?

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.

- Did you follow any online instructions? If so, what is the URL?  
[https://www.youtube.com/watch?v=KBfAfW-hUNE](https://www.youtube.com/watch?v=KBfAfW-hUNE)

I really wish that someone could help me with this matter, I also created an empty database test to try to connect but also failed. I don’t know how I should debug this since there is no other information. If there is any minimal script to connect with a dummy database in influxdb, I would also love to try. I am using influxdb 1.8.10. Thank you very much.

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 12, 2024, 10:44am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/2 "2024-03-12T10:44:54Z")

</div>

My system is CentOS 7

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 12, 2024, 10:47am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/3 "2024-03-12T10:47:34Z")

</div>

I am also interested in which situations might lead to failure? Like should connecting to an totally empty database succeed or fail (If is succeed I can’t achieve as well)? Thanks!

---

<div class="post-metadata">

**Author:** ![codi639](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@codi639](https://community.grafana.com/u/codi639)\
**Post date:** [March 12, 2024, 11:01am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/4 "2024-03-12T11:01:10Z")

</div>

Hello,

Did you configured the database name you want to connect to?  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/7/2/72ca2d1f56d267d61b0feeb5307c58d9513b6ad6.png)

Regards

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 12, 2024, 11:08am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/5 "2024-03-12T11:08:10Z")

</div>

Thanks for your reply! Yes I did. I tried my aim database nagiosdb and also the empty database test.

---

<div class="post-metadata">

**Author:** ![codi639](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@codi639](https://community.grafana.com/u/codi639)\
**Post date:** [March 12, 2024, 11:15am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/6 "2024-03-12T11:15:04Z")

</div>

Assuming you correctly configured your `bind-address`.

Can you configure `access-log-path` and assure that `auth-enable` is set to `false` (or commented), it’s only for the debug. (Both in the [http] part of the `/etc/influxdb/influxdb.conf` file)

Try to connect and show the access logs please.

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 12, 2024, 2:50pm UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/7 "2024-03-12T14:50:54Z")

</div>

Thanks a lot! I followed the instructions to first modify the influxdb.conf file as follows:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/d/7/d7d7d2c5de160ae37962c749d037e80a982f2c53.png)  
Then I restarted influxdb service: `service influxdb restart`  
I tried again to connect in grafana:  
(I had tried both the actual ip 172xxx and also localhost for the url)  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/f/9fedbd728ffebc81fb295e4e84c83719c65baf68.png)

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/4/3/43822a934f133afb6e1fdc4a2617252d0673cc4c.png)  
But I did not see any logs under that path.  
Not sure what went wrong (Is it because influxd has no access to the path? This is the home path of my account and I also use root to run certain commands).

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 12, 2024, 2:57pm UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/8 "2024-03-12T14:57:56Z")

</div>

I hoped to analyze the packet sent from grafana to influxdb to see what kind of http request that is. I used this command `ngrep -d any port 8086`.  
The outputs are a bit flooded, I guess that comes from my monitor app keep sending data into influxdb (into database nagiosdb). I can’t really filter them all, but it seems that when I click on Save & Test in grafana I don’t identify packets which seems like grafana sending packets to my influxdb. Could this be the problem?

Updated: I stopped my monitor app to stop sending data into influxdb to control the incoming packets. Now I don’t see any traffic at all even though I click Save & Test.

---

<div class="post-metadata">

**Author:** ![codi639](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@codi639](https://community.grafana.com/u/codi639)\
**Post date:** [March 12, 2024, 8:22pm UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/9 "2024-03-12T20:22:46Z")

</div>

Okay,

You **need** to create a user if you want to use your base. With `auth-enable = false` you’ll not have to use a good password to acces via Grafana:

```sql
CREATE USER influx WITH PASSWORD 'influx'
GRANT ALL PRIVILEGES ON your_measurement TO influx

```

Then you can do this  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/8/b/8b3fe53017ac925c1dda36da191304efd783e0e4.png)

but with the credentials. You can use any password to log in with your user since auth-enable is false.

Try this, and let me know if this works 👍…

Regards

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 13, 2024, 2:08am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/10 "2024-03-13T02:08:19Z")

</div>

Thanks, but sadly it didn’t. I created user influx:

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/0/4/041b2d29ed0fbc4d1db8a68d4de435ae5cb15396.png)  
I tried logging in with the new user and it works.  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/a/4/a40ab51e338ff42f784baf34af03320198eb65ae.png)  
Again I tried in grafana but still failed.  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/7/7/777c94b0d503751111647a0435adc8b289f00546.png)

Meanwhile, there is still no traffic to influxdb observed on ngrep.  
I think the problem is with grafana instead of influxdb.  
When I click on Save&Test, I monitored the website’s traffic through chrome.  
In this screenshot, I pressed the button three times and there is three packets which failed named bdffcv\*.

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/9/5/9571ef1b9a0e1ac508ce0fc475e4cc5a09cf1617.png)  
 ![image](https://us1.discourse-cdn.com/grafana/original/3X/a/f/afb5272d8d15f17c34fa8e4deff60aea7ce5ad16.png)  
I will now try to install grafana on my mac instead of my centos server, and try if it could connect to my influxdb on centos7 successfully.

---

<div class="post-metadata">

**Author:** ![twilightshuxin](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/twilightshuxin/32/43219_2.png) [@twilightshuxin](https://community.grafana.com/u/twilightshuxin)\
**Post date:** [March 13, 2024, 2:42am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/11 "2024-03-13T02:42:56Z")

</div>

Pretty interesting…  
I installed grafana again on my mac, and it connected successfully!

 ![image](https://us1.discourse-cdn.com/grafana/original/3X/5/6/565d5764a9145a3d285a183192ab20e43fc065a2.png)  
Is this a bug specific to CentOS? For I tried to install two different versions of grafana on my centos server, and also tried both on the machine itself and with docker environment. Neither worked.

---

<div class="post-metadata">

**Author:** ![bigdandobbs](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@bigdandobbs](https://community.grafana.com/u/bigdandobbs)\
**Post date:** [March 15, 2024, 9:04pm UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/12 "2024-03-15T21:04:58Z")

</div>

I’m not sure if this was covered already, however, did you check your SELinux rules and firewall setup? There’s a non-zero chance that something internal to the OS just decided to block traffic to port 3000.

---

<div class="post-metadata">

**Author:** ![worti](https://avatars.discourse-cdn.com/v4/letter/w/b782af/32.png) [@worti](https://community.grafana.com/u/worti)\
**Post date:** [May 24, 2024, 7:41am UTC](https://community.grafana.com/t/influxdb-datasource-failed-to-fetch/116760/13 "2024-05-24T07:41:31Z")

</div>

Hey there, I’m currently experiencing the same behavior. I have influxdb:2.7.6 and grafana:10.4.2 running via docker on my Raspberry Pi 3B+ with RaspianOS.

After some time, Grafana seems to struggle to fetch data from the InfluxDB. However, I’m able to access the InfluxDB and I’m also able to see the correct data. It also seems to me that there’s something wrong with Grafana not being able to fetch data from Influx.
