Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "Flux not enabled" even though it is enabled by environment variable #117

Closed
i-C-o-d-e-r opened this issue Jan 30, 2021 · 39 comments
Closed

Comments

@i-C-o-d-e-r
Copy link

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...

@esnil
Copy link

esnil commented Feb 3, 2021

Having the exact same situation.

How do you get into the CLI when running as Hassio Add on?

@sinclairpaul
Copy link
Member

Looks to be an issue and will need more investigation (I can duplicate), in theory you don't need the variable as it is default

@i-C-o-d-e-r
Copy link
Author

How do you get into the CLI when running as Hassio Add on?

I am using the SSH & Web Terminal add-on to get a shell on the root file system. Afterwards I am using the docker cli to start the influxdb cli within the docker container.

@NullEnt1ty
Copy link

Flux was working for me until v4.0.1 (or v4.0.0, not sure). I tried to enable it with the environment variable too, but without luck.

Running ps eww $(pidof influxd) inside the Docker container shows, that the environment variable does get passed to influxd 😕

@donpablos
Copy link

The same issue :(

@alexelite
Copy link

Same issue here, flux was working a few weeks ago without any envvars.

auth: true
reporting: true
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
envvars:
  - name: INFLUXDB_HTTP_ENABLED
    value: 'true'
  - name: INFLUXDB_HTTP_FLUX_ENABLED
    value: 'true'

@sinclairpaul
Copy link
Member

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

@michaelpiron
Copy link
Contributor

michaelpiron commented Feb 26, 2021

How can this downgrade of Chronograf to 1.8.8 be done? I guess the add-on code needs to be updated and it's not something which every user should to him/herself in their local configuration? (sorry for these questions, I'm quite new in this, and I would like to understand better)

For information, I'm currently having the same issues.
My setup:
System info:

  • Home Assistant OS 5.12, running as VM in Proxmox on an Intel NUC (NUC7i7BNH) with 3GB RAM and 32GB disk space
  • Supervisor 2021.02.9
  • Core 2021.2.3
  • InfluxDB Add-on: version: 4.0.3

Configuration of InfluxDB add-on:

auth: true
reporting: true
ssl: false
certfile: ''
keyfile: ''
envvars:
  - name: INFLUXDB_HTTP_FLUX_ENABLED
    value: 'true'
  - name: INFLUXDB_CONTINUOUS_QUERIES_ENABLED
    value: 'true'

image

@donpablos
Copy link

I don't have any clue how to downgrade INFLUXDB :(

@sinclairpaul
Copy link
Member

How can this downgrade of Chronograf to 1.8.8 be done?

You can't, and unfortunately it also means that is unlikely there is anything we can do from an addon perspective as it looks like it needs to be fixed upstream.

@michaelpiron
Copy link
Contributor

@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: " 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!

@github-actions
Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Mar 30, 2021
@michaelpiron
Copy link
Contributor

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

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Mar 31, 2021
@jralopes
Copy link

jralopes commented Apr 1, 2021

I have the same issue here. I can't even open the webui. Most of the times the addon starts and after a small amount of time it stops. Would be nice to have this corrected.
Thank you all

@MattyBoy4444
Copy link

Any progress. Same issue

@TheNetAdmin
Copy link

Same issue, and the envvars not working for me, I'm using this version of influxdb addon:

 Add-on: InfluxDB
 Scalable datastore for metrics, events, and real-time analytics
-----------------------------------------------------------
 Add-on version: 4.0.4
 You are running the latest version of this add-on.
 System: Home Assistant OS 5.12  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2021.4.1
 Home Assistant Supervisor: 2021.03.9
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------

@TheNetAdmin
Copy link

TheNetAdmin commented Apr 9, 2021

How can this downgrade of Chronograf to 1.8.8 be done?

You can't, and unfortunately it also means that is unlikely there is anything we can do from an addon perspective as it looks like it needs to be fixed upstream.

@sinclairpaul Since this could be an upstream bug, would you point out which GitHub issue it's related to? If there's no such an issue created in upstream GitHub repo, I can open one.

@sinclairpaul
Copy link
Member

There is no upstream issue that I have seen, the repo would be the InfluxDB one...

@jsternberg
Copy link

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.

@jsternberg
Copy link

It looks like this change might be related: influxdata/chronograf#5631.

This change says the default is v1 which should not change any part of the configuration. It seems this add-on uses the v1 version of the database so we would want to use that option. Can you check that the configuration is configured to use v1? For a running instance, i think this can be changed by going to configuration and clicking on the specific connection.

@NullEnt1ty
Copy link

@jsternberg According to the connection configuration I'm using v1 authentication.

grafik

@jsternberg
Copy link

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.

@jsternberg
Copy link

@NullEnt1ty
Copy link

Thanks for your time and effort @jsternberg!

@sranka
Copy link

sranka commented Apr 13, 2021

influxdata/chronograf#5724 contains a fix

@sranka
Copy link

sranka commented Apr 14, 2021

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

@edalquist
Copy link

Will this still require a new release/push of the InfluxDB Addon to fix the issue?

@michaelpiron
Copy link
Contributor

Yes, but first the Influx team has to release Chronograf v1.9.0 which will contain the fix. After that release, this home assistant add-in can be updated.

@github-actions
Copy link

github-actions bot commented Jun 7, 2021

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Jun 7, 2021
@esnil
Copy link

esnil commented Jun 7, 2021

Yes, but first the Influx team has to release Chronograf v1.9.0 which will contain the fix. After that release, this home assistant add-in can be updated.

Have you seen an roadmap that predicts when the next release of Chronograf will take place? Tried to look at the different influxdb sites and repos but could only find historical releases.

@michaelpiron
Copy link
Contributor

Didn't find any info about a Chronograf v1.9.0 either.
Perhaps @jsternberg can help us with that?

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Jun 8, 2021
@catadiel
Copy link

catadiel commented Jun 30, 2021

Seems that the Influx team released Chronograf 1.9.0 a couple of days ago.

@sranka
Copy link

sranka commented Jun 30, 2021

Yes, chronograf 1.9 is out since Monday, the add-on can be now updated to use chronograf 1.9.

@michaelpiron
Copy link
Contributor

michaelpiron commented Jul 8, 2021

I see that @frenck is updating the add-on, to include v1.9.0 —> pull request: #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?

@taufikp
Copy link

taufikp commented Jul 16, 2021

I'm patiently waiting for the version 4.2.0 as well....

@michaelpiron
Copy link
Contributor

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

@michaelpiron
Copy link
Contributor

Issue has been opened in HA add-ons repository, because it seems that the release bot didn't automatically take up the new version of the InfluxDB add-on: hassio-addons/repository#313

@michaelpiron
Copy link
Contributor

V4.2.1 of the add-on was released, which includes Chronograf v1.9.0

@michaelpiron
Copy link
Contributor

I tested: Now Flux works! So this issue can be closed.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests