influx: Usage, Options & Common CI Errors
influx administers and queries an InfluxDB time-series database.
influx sets up buckets and writes points for time-series tests in CI. The dominant confusion is v1 vs v2: the CLI, auth model, and query language changed completely between them.
What it does
The influx CLI (v2) talks to an InfluxDB server over HTTP to manage buckets and orgs, write line-protocol points, and run Flux queries. It authenticates with an API token, not a username/password like v1.
Common usage
influx ping --host http://localhost:8086
influx bucket list --host http://localhost:8086 -o myorg -t ${INFLUX_TOKEN}
influx write --host http://localhost:8086 -o myorg -b mybucket -t ${INFLUX_TOKEN} 'cpu,host=a usage=0.6'
influx query --host http://localhost:8086 -o myorg -t ${INFLUX_TOKEN} 'from(bucket:"mybucket") |> range(start:-1h)'Options
| Flag | What it does |
|---|---|
| --host <url> | Server URL (v2 uses HTTP, default :8086) |
| -t / --token | API token (INFLUX_TOKEN env) |
| -o / --org | Organization |
| -b / --bucket | Target bucket for writes |
| write / query | Write line protocol / run a Flux query |
| ping | Check server health |
Common errors in CI
Error: ... unauthorized: unauthorized access - the token is missing, wrong, or lacks permission; set -t / INFLUX_TOKEN and the right -o org. Mixing v1 and v2 is the classic trap: the v1 influx CLI used InfluxQL and -username/-password, while v2 uses Flux and tokens - match the CLI to the server version. "connection refused" on :8086 means the server is not up yet; gate on influx ping.