Connection refused error reading buckets

Post “http://localhost:8086/api/v2/query?org=f425c45b4849be2d”: dial tcp 127.0.0.1:8086: connect: connection refused error reading buckets

Can anybody help me, I’m stuck in this error. Currently using influxdb 2.0 trying to link it with grafana and this error comes up.

I already try to change all token, all link, and still wont work. Can anybody help me?
I’m still new in this, so please bare with me :')

hello,
can you try to leave the bucket option empty ?
are you sure this is your organisation name ?
you can see this in influxd interface on your user profile.

hi alexandrearmand,

still come up the same error.
i try both with organization token id and name. still same error.

Ok this is a classic configuration example :


you can notice you only need one authentification method.
But i have to say i think you miss understand what is your organisation ID
I believe you take the grafana organisation (or your encoded id in influxdb ),
But ! i know this is confusing but influxdb got organisation group too !
Be careful to be sure to use your Influxdb organisation, not the grafana , you can find it here on the influxdb GUI


image

is it correct based on your guidance. still come up same error.

Ok this could be right issue,
Can you try to make a new token with full admin right in influxdb ?
You don’t need Username and password too
Have you atleast one bucket already created ?

if you have token you do not need Basic Auth configured.

  1. Disable Basic auth:
  2. Clear out Basic Auth Details, user and password
  3. Use Only Token.

Please show us your token page (not your token) or create a new one that has read permissions on all buckets

I already done it and still comes up the same error. I even create full access but nothing happened. I still couldn’t figure out the issue.

already did. still come up the same error.

where is your influxdb in relation to grafana is it on same host? what OS?

yes, both are on the same os.

hello,
maybe you can try to reach influxdb with a classic curl http request,
if it’s working this is your parameter for the grafana datasource

my question was “are they on the same host or on the same server?”

whats you meant by same host and same server ? both are running from my pc.

so they are both on the same host which is your pc.
Now how many tokens do you have on your influxdb?

Hi. I have the same problem. Has anyone overcome the issue?

I had the same problem and solved it by running grafana locally. Not sure why it matters but it doesn’t work when I use the main website login. I had to download grafana and run it locally then login through running the web server.

see this guide

to setup the datasource but note step 2 which says “download and install Grafana”
that takes you to the download page

for an easier set of instructions to set it up see link in step 3 “start Grafana”

1 Like

I had the same issue. My problem was, that I was running both influxdb and grafana in a docker container. You need a docker network to allow both containers to communicate with each other.
I used a similar docker-compose file to establish a network:

services:
  influxdb:
    image: influxdb:2.7
    restart: always
    ports:
      - 8086:8086
    volumes:
      - influxDb:/var/lib/influxdb2 
  grafana:
    image: grafana/grafana
    restart: always
    depends_on:
      - influxdb
    ports:
      - 3000:3000
    volumes:
      - grafana:/var/lib/grafana
volumes:
  influxDb: {}
  grafana: {}

The influxdb Url for Grafana needs to be your docker service name than:

Hope this might help someone :slight_smile:

3 Likes