Unable to create influxdb connection in

Terminal 1:
vault server -dev -dev-root-token-id=root

Terminal 2:
export VAULT_ADDR=“http://127.0.0.1:8200
vault secrets enable database

docker run -d -p 8086:8086
-e DOCKER_INFLUXDB_INIT_MODE=setup
-e DOCKER_INFLUXDB_INIT_USERNAME=admin
-e DOCKER_INFLUXDB_INIT_PASSWORD=adminpass
-e DOCKER_INFLUXDB_INIT_ORG=my-org
-e DOCKER_INFLUXDB_INIT_BUCKET=my-bucket
influxdb:2.0

vault write database/config/my-influxdb-database
plugin_name=“influxdb-database-plugin”
host=127.0.0.1
username=admin
password=adminpass
allowed_roles=vault-admin

Result:
Error writing data to database/config/my-influxdb-database: Error making API request.

URL: PUT http://127.0.0.1:8200/v1/database/config/my-influxdb-database
Code: 400. Errors:

  • error creating database object: error verifying connection: error getting if provided username is admin: received status code 401 from server
1 Like

Same issue for me. Can someone help ? Thanks