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

Unable to create a password protected influxDB #19576

Open
WaleedNaveed opened this issue Sep 16, 2020 · 1 comment
Open

Unable to create a password protected influxDB #19576

WaleedNaveed opened this issue Sep 16, 2020 · 1 comment

Comments

@WaleedNaveed
Copy link

I am working on a C# application with InfluxDB and Grafana. I am using InfluxData.Net (https://github.com/pootzko/InfluxData.Net#createdatabaseasync). I have to create a password protected Influx database. My code is:

var httpClientHandler = new HttpClientHandler();
httpClientHandler.ServerCertificateCustomValidationCallback = OnHandleSSl;
var client = new HttpClient(httpClientHandler);

InfluxDbClient _influxDbClient = new InfluxDbClient(Server, Username, Password, InfluxDbVersion.v_1_3, QueryLocation.FormData, client);
var response = await _influxDbClient.Database.CreateDatabaseAsync(DatabaseName);

Issue is that when i go to Grafana on the server and add new data source with this database, data source works fine and does not show any error regarding username/password. Even the data in the database is shown in the grafana. I am using InfluxDB image. I have also tried to enable INFLUXDB_HTTP_AUTH_ENABLED in DockerFile of InfluxDB. My DockerFile is:

FROM influxdb:1.7.6

ENV TZ=America/Los_Angeles
ENV INFLUXDB_HTTP_AUTH_ENABLED true

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

When i run the image created from this DockerFile, i don't get INFLUXDB_HTTP_AUTH_ENABLED entry in influxdb.conf file. As per InfluxDB documentation, setting INFLUXDB_HTTP_AUTH_ENABLED in environment variable will enable the authentication on the influx server but, in my case its not working.

How can i make a password protected influx database through influxDB image ? What can be the possible issue ? I am stuck and unable to create the password protected database. Any help would be much appreciated.

@russorat
Copy link
Contributor

russorat commented Mar 2, 2021

@WaleedNaveed thank you for the issue. please upgrade to the latest influxdb 1.8 version and let us know if you have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants