Hi Community,
I’m tearing my hair out trying to figure out why my downsampling tasks have started failing since upgrading to influxdb oss 2.7.0 (arm64). Help sought (please) as to whether this in an influxdb issue, or user error as I can’t find any similar reports.
$influxd version
InfluxDB v2.7.0 (git: 85f725f8b9) build_date: 2023-04-05T15:32:18Z
In my case influxdb oss runs on a raspberrypi4 running ubuntu 22.11 stable…
uname -a
Linux pieman 5.19.0-1016-raspi #23-Ubuntu SMP PREEMPT Fri Mar 31 13:54:29 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
I think I’m hitting the issue as a result of this fix introduced in influxdb 2.7.0…
- 06a5902: Prevent unauthorized writes in flux “to” function
Any downsampling tasks that include a to() function fail with…
error exhausting result iterator: failed to initialize execute state: user not authorized to write
…however the flux code runs successfully (with same user and/ or token) when run as a regular query, including in the explorer.
Here’s a simple example that fails consistently for me with the arm64 variant of influxdb oss 2.7.0 on a raspberrypi4. I’ve tried running alpine, ubuntu and docker image using both the .deb and arm64 binaries.
$ influx setup --username admin-user --password admin-password --org my-org --bucket my-bucket
$ influx user create --org my-org --name testuser --password testpassword
$ influx auth create --user testuser --org my-org --description "test all-access token" --all-access
$ influx config create -a -n test -u http://localhost:8086 --org my-org -t <token produced by command above>
$ influx bucket create --org my-org -n testbucket
$ influx task create --org my-org - # <return> to open stdin pipe
import "influxdata/influxdb/sample"
option task = {
name: "Collect air sensor sample data",
every: 15m,
}
sample.data(set: "airSensor")
|> to(bucket: "testbucket")
# Linux & macOS: <ctrl-d> to close the pipe and submit the command
I believe this task should run successfully using the testuser all-access token (which I believe has write access to the bucket named testbucket) as it does when run as a query, or in the InfluxDB UI (explorer).
If I revert to the 2.6.1 version of influxdb oss the task completes successfully, though this release does not include the fix described above.
Any ideas?
Thanks!