Chronograf not loading InfluxDB connections using .src file

I’m trying to define manually an InfluxDB connection in Chronograf using a .src file as explained in this page:
Managing InfluxDB connections using .src files

This should help me to persist my connection (which has authentication enabled) and prevent me having to edit it each time I relaunch my Chronograf container using docker.

For this I created a file called “influxdbconnection.src” that I mount in “/usr/share/chronograf/resources/” when starting my container.

{
  "id": "10000",
  "name": "My InfluxDB",
  "username": "admin",
  "password": "mypassword",
  "url": "http://influxdb:8086",
  "type": "influx",
  "insecureSkipVerify": false,
  "default": true,
  "telegraf": "telegraf",
  "organization": "example_org"
}

However, the connection is not loaded in the UI of Chronograf. A default connection is displayed but doesn’t correspond to the one defined in the resource file.

I also tried to set the RESOURCES_PATH manually in /etc/default/chronograf as follow:

RESOURCES_PATH=/usr/share/chronograf/resources

But this didn’t help to load the connection.

Is there a way I can debug this issue? I analysed the log of chronogaf but couldn’t find anything related to loading the resource file.

Thanks in advance for your help.

Hi , is your hostname Influxdb
As you specified here …

“url": “http://influxdb:8086”,

Thanks MarcV for your answer. Yes, the URL was correct.

I finally could make it work by defining the RESOURCES_PATH environment variable in my docker-compose file.

# docker-compose.yml
version: '3.2'
services:
  chronograf:
    image: chronograf
    environment:
      RESOURCES_PATH: "/usr/share/chronograf/resources"

So it seems it was an issue with the docker image and defined environment variables.

2 Likes

This is still an issue. Seems like the documentation or the source should have been fixed by now.

Hello @kramik1,
InfluxDB has released 2.0 GA. The platform and image is different. However this might be helpful https://github.com/influxdata/sandbox
What exactly is the issue you’re facing? Does the solution above not work for you?

This doesn’t have anything to do with 2.0. The issue has a workaround that was solved in April of last year but the documentation still specifies that it has a default which isn’t true. The image will not do anything with those files until you specify it explicitly. There are a couple of other issues on here and on github that have similar or the same issues with the same problem. This is the only one pointing out the solution.

I will switch to 2.0 sometime in the future. I have pilot program built around this version at the moment.