addon-influxdb: Error "Flux not enabled" even though it is enabled by environment variable

Problem/Motivation

I am not able to use the flux query language (using chronograf, I did not test the CLI). I read that I have to enable flux first. Therefore I used the environment variable INFLUXDB_HTTP_FLUX_ENABLED to enable it. But it is still not working.

Expected behavior

Using flux with chronograf should work.

Actual behavior

I get the following error message in chronograf:

400: Error flux not enabled: <nil>

I can see the following output with log_level debug in the logs:

[30/Jan/2021:21:08:05 +0100] 200 192.168.178.31, 172.30.32.1(172.30.32.2) GET /chronograf/v1/me HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0) time="2021-01-30T21:08:06+01:00" level=debug msg=Request component=server method=POST remote_addr="127.0.0.1:57164" url=/api/hassio_ingress/C0cikYe5QGxOLmd4D8xjl7fwtjhdn5YQkXxt4nlfVIg/chronograf/v1/flux/ast time="2021-01-30T21:08:06+01:00" level=info msg="Response: OK" component=server method=POST remote_addr="127.0.0.1:57164" response_time=8.079669ms status=200 [30/Jan/2021:21:08:06 +0100] 200 fe80::bde4:7d50:285d:7074, 172.30.32.1(172.30.32.2) POST /chronograf/v1/flux/ast HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0) time="2021-01-30T21:08:06+01:00" level=debug msg=Request component=server method=POST remote_addr="127.0.0.1:57166" url="/api/hassio_ingress/C0cikYe5QGxOLmd4D8xjl7fwtjhdn5YQkXxt4nlfVIg/chronograf/v1/sources/0/proxy/flux?path=/api/v2/query?organization%3Ddefaultorgname" time="2021-01-30T21:08:06+01:00" level=error msg="Error message Error flux not enabled: <nil>" component=server http_status =400 time="2021-01-30T21:08:06+01:00" level=info msg="Response: Bad Request" component=server method=POST remote_addr="127.0.0.1:57166" response_time="982.231µs" status=400 [30/Jan/2021:21:08:06 +0100] 400 192.168.178.31, 172.30.32.1(172.30.32.2) POST /chronograf/v1/sources/0/proxy/flux?path=/api/v2/query?organization%3Ddefaultorgname HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0) time="2021-01-30T21:08:15+01:00" level=debug msg=Request component=server method=GET remote_addr="127.0.0.1:57168" url=/api/hassio_ingress/C0cikYe5QGxOLmd4D8xjl7fwtjhdn5YQkXxt4nlfVIg/chronograf/v1/me time="2021-01-30T21:08:15+01:00" level=info msg="Response: OK" component=server method=GET remote_addr="127.0.0.1:57168" response_time="271.143µs" status=200

Steps to reproduce

Here is my configuration:

auth: true reporting: false ssl: true certfile: fullchain.pem keyfile: privkey.pem envvars: - name: INFLUXDB_HTTP_FLUX_ENABLED value: ‘true’ log_level: debug

I restarted the addon-on after the changes.

I can see that the environment variable is set:

[21:19:42] INFO: Kapacitor is waiting until InfluxDB is available… [21:19:42] INFO: Chronograf is waiting until InfluxDB is available… [21:19:42] DEBUG: Setting Env Variable INFLUXDB_HTTP_FLUX_ENABLED to true [21:19:42] INFO: Starting the InfluxDB…

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 39 (14 by maintainers)

Most upvoted comments

Hi, I didn’t see the ping for my name on this issue until this morning. Sorry for the delay. Taking a look, this issue seems to closely track with an upgrade to Chronograf 1.8.9.1 in this commit and there seem to have been some changes related to Flux that could trigger this message that seem to have originated in 1.8.9.1. I suspect these aren’t unrelated.

I’ll see if I can either diagnose the issue or inform another person who might be able to help more.

Issue still there. Can we keep this issue open? (unstale)

Hi @frenck , The release v4.2.0 doesn’t appear (yet) in HA supervisor. Can you help out? Thx

The fix is now merged, it will work fine in the next chronograf nightly build / release.

@jsternberg , I see on Github that you are part of the Influx team. Perhaps you can help out here? #daretoask We have InfluxDB running in a Docker container (as part of an implementation of InfluxDB as an add-on in Home Assistant). Even though Flux is enabled through environment variables, the error “400: Error flux is not enabled: <nil>” is thrown. The docker container runs following packages:

  • InfluxDB 1.8.4
  • Chronograf 1.8.10
  • Kapacitor 1.5.7-1

As @sinclairpaul mentioned in this issue, there would be an upstream issue, hence my reach-out to you.

Thanks in advance!

I see that @frenck is updating the add-on, to include v1.9.0 —> pull request: https://github.com/hassio-addons/addon-influxdb/pull/187

This will resolve this issue.

Update: I see that the push to Chronograf 1.9.0 is included in release v4.2.0 of this add-on. However, this release is not available (yet) in my Home Assitant supervisor: image

Is v4.2.0 in Beta phase? Or another reason?

Thanks for the quick information. I took a closer look and I’m probably 90-95% certain this is a regression from adding v2 support.

When the influxdb connection is specified by the command line, such as is done in this add-on, a hard-coded connection is created and it doesn’t get created with a server version. Chronograf now assumes that no version means it is connected to a v2 server and determines that Flux isn’t enabled.

I believe this to be erroneous and I’ll pass on this information to the relevant developer to determine the correct fix.

I do not presently see a workaround beyond reverting back to chronograf 1.8.9.0. I’ll try to get an answer by end of day for when we might expect a fix with a release so you can decide whether you want to downgrade the plugin temporarily or wait for the release.

Downgrading Chronograf to 1.8.8 appears to resolve, so would suggest its an upstream issue.