influxdata / influxdata/influxdb
UI: cannot save task: invalid options
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
I have not found a way to find how exactly reproduce this issue , but here goes anyway: often, when I try to save the task, even when I do not make a modification, I get `Failed to update task: invalid options: Err: loc 0:0-0:0 unknown operator ""`.
The options in the task are
```
option task = {
name: "check STOLICKA backup",
cron: "0 8 * * *",
}
```
Log message attached.
__Environment info:__
* InfluxDB version: 2.0 RC3
__Logs:__
```
Nov 03 14:11:15 ip-10-0-248-210 influxd2[19661]: ts=2020-11-03T14:11:15.911079Z lvl=debug msg=Request log_id=0QFbsUrl000 service=http method=PATCH host=ec2-13-57-118-201.us-west-1.compute.amazonaws.com:9999 path=/api/v2/tasks/0685313feb28f000 query= proto=HTTP/2.0 status_code=400 response_size=190 content_length=1863 referrer=https://ec2-13-57-118-201.us-west-1.compute.amazonaws.com:9999/orgs/05ebbd1b1f0bdb9f/tasks/0685313feb28f000/edit remote=37.48.59.129:14109 user_agent=Chrome took=30.044ms error=invalid error_code=invalid body="{\"flux\":\"import \\\"csv\\\"\\nimport \\\"influxdata/influxdb/v1\\\"\\nimport \\\"slack\\\"\\noption task = { \\n name: \\\"check STOLICKA backup\\\",\\n cron: \\\"0 8 * * *\\\",\\n}\\n\\nnoDataCsv = \\\"\\r\\n#group,false,false,false,false\\r\\n#datatype,string,long,long,long\\r\\n#default,_result,,,\\r\\n,result,table,errors,total\\r\\n,,0,0,0\\r\\n\\\"\\n\\nnoStats = csv.from(csv:noDataCsv)\\n\\ndata = from(bucket: \\\"prosek_it\\\")\\r\\n\\t|> range(start: -1d)\\r\\n\\t|> filter(fn: (r) =>\\r\\n\\t\\t(r._measurement == \\\"backup_log\\\" and r.host == \\\"STOLICKA\\\"))\\r\\n\\t|> drop(columns: [\\\"_start\\\", \\\"_stop\\\"])\\r\\n\\t|> v1.fieldsAsCols()\\r\\n\\t|> group()\\n\\nstats = data\\r\\n\\t|> reduce(fn: (r, accumulator) => ({\\r\\n total: accumulator.total + 1,\\r\\n\\t\\t\\terrors: accumulator.errors + (if r.err == \\\"ERR\\\" then 1 else 0),\\r\\n\\t\\t}), identity: {total: 0, errors: 0}\\r\\n\\t)\\n\\nslackFilterFn = (channel, text, color) => {\\r\\n\\tslack.message(\\r\\n\\t\\turl: \\\"https://hooks.slack.com/services/XXXXXXXXX/XXX78E5MW/XXXps4eszuTRar0tDnKQ1Q5n\\\", // Ales webhook\\r\\n\\t\\tchannel: channel,\\r\\n\\t\\ttext: text,\\r\\n\\t\\tcolor: color,\\r\\n\\t)\\r\\n\\r\\n\\treturn false\\r\\n}\\n\\nunion(tables: [noStats, stats])\\r\\n |> reduce(fn: (r, accumulator) => ({\\r\\n total: accumulator.total + r.total,\\r\\n\\t\\t\\terrors: accumulator.errors + r.errors,\\r\\n\\t }), identity: {total: 0, errors: 0}\\r\\n\\t)\\r\\n\\t|> filter(fn: (r) =>\\r\\n\\t\\t\\tif r.total == 0
Nov 03 14:11:15 ip-10-0-248-210 influxd2[19661]: then slackFilterFn(channel: \\\"\\\", text: \\\"Pozor: vcera asi na STOLICCE neprobehl backup!\\\", color: \\\"danger\\\")\\r\\n\\t\\t else if r.errors > 0 then slackFilterFn(channel: \\\"\\\", text: \\\"Pozor: vcera na STOLICCE pri backupu doslo k chybam!\\\", color: \\\"warning\\\")\\r\\n\\t\\t else slackFilterFn(channel: \\\"\\\", text: \\\"Info: vcera na STOLICCE backupu zrejme probehl v poradku.\\\", color: \\\"good\\\")\\r\\n\\t)\",\"name\":\"check STOLICKA backup\",\"token\":null,\"cron\":\"0 8 * * *\",\"every\":null}"
```
Contributor guide
Research direction
Start with the PATCH /api/v2/tasks request and the attached log, comparing the unchanged task options with the reported invalid-operator error. Reproduce the save operation if possible; done means an unchanged task can be saved without the invalid-options response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100