# Flux is Enabled in config but not enabled in influxd

**URL:** <https://community.influxdata.com/t/flux-is-enabled-in-config-but-not-enabled-in-influxd/28394>\
**Category:** InfluxQL\
**Tags:** influxdb, flux\
**Created:** [January 31, 2023, 11:49am UTC](https://community.influxdata.com/t/flux-is-enabled-in-config-but-not-enabled-in-influxd/28394 "2023-01-31T11:49:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sajeel\_Ahmed](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sajeel_ahmed/32/12536_2.png) [@Sajeel\_Ahmed](https://community.influxdata.com/u/Sajeel_Ahmed)\
**Post date:** [January 31, 2023, 11:49am UTC](https://community.influxdata.com/t/flux-is-enabled-in-config-but-not-enabled-in-influxd/28394/1 "2023-01-31T11:49:28Z")

</div>

influx db **v1.8,**

Hi,  
I am new to influx. I have been working on Influxd to extract my data in a neat format with tag values as rows and timestamps as columns for all of my tag values. I know i need to use pivot function of flux for this. But the problem is that I am not able to enable flux on my influxdb.  
If I use “-config” command to point to my edited config file it works but then my restored database does not show up in buckets/databases.

I have tried everything. But still not able to achieve it. Apparently there is another config file that influxdb reverts to by default, becuase it keeps working even if I delete the config file in the influx folder.

Attached is the screenshot of my influxdb config file.,

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/4/4c372d3a6f9085d191d7bed72340673a61881428.png)

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [January 31, 2023, 9:41pm UTC](https://community.influxdata.com/t/flux-is-enabled-in-config-but-not-enabled-in-influxd/28394/2 "2023-01-31T21:41:53Z")

</div>

Hello @Sajeel_Ahmed,  
What errors are you getting?  
Can you upgrade to 2.x?  
What environment are you running it in?  
How are you trying to use Flux? Through the UI?

These resources might help:

> [@Flux not working with InfluxDB 1.8](https://community.influxdata.com/t/flux-not-working-with-influxdb-1-8/13936/2):
>
> Hi! I had the same issue and I solved it by adding the following parameter to the influx cli : -path-prefix /api/v2/query Now I can run flux queries through influx cli in InfluxDB 1.8. I hope this helps you, Regards!

> <https://github.com/hassio-addons/addon-influxdb/issues/117>
>
> \# Problem/Motivation
> 
> I am not able to use the flux query language (using chro…nograf, 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...

---

<div class="post-metadata">

**Author:** ![Sajeel\_Ahmed](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sajeel_ahmed/32/12536_2.png) [@Sajeel\_Ahmed](https://community.influxdata.com/u/Sajeel_Ahmed)\
**Post date:** [February 1, 2023, 9:35am UTC](https://community.influxdata.com/t/flux-is-enabled-in-config-but-not-enabled-in-influxd/28394/3 "2023-02-01T09:35:53Z")

</div>

Hi @Anaisdg. Thanks for your reply.

1. I am getting the error “flux query not enabled”.
2. Its the same for Influx cli and Grafana.  
Due to this reason I am not able to add a datasource based on flux in Grafana.

I have already gone through the link you mentioned. The thing is I am able to point to my edited config file and it enables flux but It no longer shows my restored database then.  
Is there any other config file my influxdb is referring to by default? By other I mean other than the one in my influxdb folder.  
I have also tried echoing the config path environment variable but it just comes back with the name of the variable that I typed.  
echo $influxdb\_config\_path will give  
$influxdb\_config\_path

unfortunately I cannot update my influx to 2.x. As doing so will alter the existing data collection or might stop it and I am not skilled enough to set up a new one.
