Skip to content

--bearer-token flag doesn't work with influxdb3 serve despite being documented #26296

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

Closed
bherbruck opened this issue Apr 19, 2025 · 3 comments
Closed

Comments

@bherbruck
Copy link

Steps to reproduce:
List the minimal actions needed to reproduce the behaviour.

  1. Install InfluxDB 3 Core (recently GA)
  2. Try to run influxdb3 serve with the --bearer-token flag
  3. Attempt to use the environment variable alternative INFLUXDB3_BEARER_TOKEN

Expected behaviour:
The --bearer-token flag should work as documented in the official documentation at https://docs.influxdata.com/influxdb3/core/reference/config-options/#bearer-token. The server should start with the specified bearer token configured.

Actual behaviour:
The CLI reports an error when using the --bearer-token flag:

$ influxdb3 serve --bearer-token=<token>

error: unexpected argument '--bearer-token' found

Usage: influxdb3 serve --node-id <NODE_IDENTIFIER_PREFIX> <--object-store <object-store>|--bucket <bucket>|--data-dir <data-dir>|--aws-access-key-id <aws-access-key-id>|--aws-secret-access-key <aws-secret-access-key>|--aws-default-region <aws-default-region>|--aws-endpoint <aws-endpoint>|--aws-session-token <aws-session-token>|--aws-allow-http|--aws-skip-signature|--google-service-account <google-service-account>|--azure-storage-account <azure-storage-account>|--azure-storage-access-key <azure-storage-access-key>|--object-store-connection-limit <object-store-connection-limit>|--object-store-http2-only|--object-store-http2-max-frame-size <object-store-http2-max-frame-size>|--object-store-max-retries <object-store-max-retries>|--object-store-retry-timeout <object-store-retry-timeout>|--object-store-cache-endpoint <object-store-cache-endpoint>>

The environment variable method also does not appear to work. The only available method seems to be the post-installation configuration, which is problematic for container deployments.

Environment info:

  • Command used: influxdb3 serve --bearer-token=<token>
  • System info: Linux x86_64 5.15.0-76-generic
  • Running in a Docker container with the official influxdb3 image

Config:
No additional configuration was used beyond the CLI arguments shown above.

Logs:
The error message shown above is the only output received.

@hiltontj
Copy link
Contributor

Hi @bherbruck, thanks for opening the issue.

With the 3.0.0 (and now 3.0.1) release, we moved away from the --bearer-token argument for starting the server with authorization enabled.

Now, the server, started with influxdb3 serve, will start with authorization enabled by default. You must create a token with the influxdb3 create token --admin command, and pass that in the Authorization header. This is outlined in the CLI help output (influxdb3 serve --help or influxdb3 serve --help-all):

# Run with local file storage:
1. influxdb3 serve --node-id node1 --object-store file --data-dir ~/.influxdb_data
2. influxdb3 create token --admin
3. Write and query with unhashed token

We do need to update the docs that you linked to reflect this change, so once that is done we can close this issue out.

Otherwise, you can now start the server without authentication using the --without-auth CLI argument, i.e., influxdb3 serve --without-auth.

@hiltontj
Copy link
Contributor

I opened influxdata/docs-v2#6007

@bherbruck
Copy link
Author

influxdata/docs-v2#6007

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