Problem Creation Tasks Influxdb 2.0

Hello,

I tried to create a task in influxdb 2.0 UI but every time I had the same problem below.

Failed to create new task: invalid options; Err: @8:1-13:2: option "task" reassigned: @8:1-13:2: option "task" reassigned
My Task is a basic one, I will put it below too.
// Task options
option task = {
name: “Task1”,
every: 1h,
offset: 0m,
concurrency: 1,
}

// Data source
data = from(bucket: “POC”)
|> range(start: -task.every)
|> filter(fn: (r) =>
r.host == “boujemaa-Lenovo-ideapad-320-15IKB”
)

//Show data
data
// Data transformation
|> aggregateWindow(
every: 5m,
fn: last
)
// Data destination
|> to(bucket: “Test”)
Thanks.

@Anis when adding tasks through the UI, leave out the option task assignment. The UI does this for you when you save the task.

I was having the same issue but i noticed a weird behaviour: the first time the task is created, the option task must be indeed left out, but on “edit” it must be included: is it inteded to work so?

@sh3rlock14 I’m not sure if it was the designed behavior. I think the challenge here is which do you honor? The settings in the form fields or the settings in the code? I think the rational was that users will configure these things in the form when creating the task and the task option gets injected into the code on save. When you’re updating the task, since the option was already injected, it validates that it does exist and then overwrites it with any changes from the form.

1 Like