influxdata / influxdata/influxdb
Tasks: Bubble up errors from scripts
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
See this issue for the query: https://github.com/influxdata/flux/issues/2075
Looks like the error message from the logs is not getting bubbled up into the logs of the task response:

It looks like the task system doesn't bubble that error up: https://github.com/influxdata/influxdb/blob/fc7bb9fcaf48f5e481a18752a36b0b1b1b0669b4/task/backend/executor/executor.go#L179
```
2019-10-28T20:39:05.058531Z debug Created run; beginning execution {"log_id": "0Im11qZ0000", "svc": "taskd/scheduler", "task_id": "04a1b4334ae66000", "run_slot": 0, "run_id": "04b105569360b000", "now": 1572295145}
2019-10-28T20:39:05.058599Z debug Ticked {"log_id": "0Im11qZ0000", "svc": "taskd/scheduler", "now": 1572295145, "tasks_affected": 1}
2019-10-28T20:39:05.089431Z info Executing task (start) {"log_id": "0Im11qZ0000", "service": "task-executor", "task_id": "04a1b4334ae66000", "run_id": "04b105569360b000", "op_name": "execute", "op_event": "start"}
2019/10/28 13:39:05 http: TLS handshake error from [::1]:59852: remote error: tls: bad certificate
2019-10-28T20:39:05.100580Z info Error exhausting result iterator {"log_id": "0Im11qZ0000", "service": "task-executor", "task_id": "04a1b4334ae66000", "run_id": "04b105569360b000", "op_name": "execute", "error": "Get https://localhost:9999/metrics: x509: certificate signed by unknown authority", "name": "to2"}
2019-10-28T20:39:05.100625Z debug Completed successfully {"log_id": "0Im11qZ0000", "service": "task-executor", "task_id": "04a1b4334ae66000", "run_id": "04b105569360b000", "op_name": "execute"}
2019-10-28T20:39:05.100648Z info Executing task (end) {"log_id": "0Im11qZ0000", "service": "task-executor", "task_id": "04a1b4334ae66000", "run_id": "04b105569360b000", "op_name": "execute", "op_event": "end", "op_elapsed": "11.218ms"}
2019-10-28T20:39:05.136198Z debug Execution succeeded {"log_id": "0Im11qZ0000", "svc": "taskd/scheduler", "task_id": "04a1b4334ae66000", "run_slot": 0, "run_id": "04b105569360b000", "now": 1572295145}
```
Contributor guide
Research direction
Start with task/backend/executor/executor.go around line 179 and review the related Flux issue 2075. Reproduce the task execution shown in the logs and trace how the iterator error is handled. Done means the script error is surfaced in the task response instead of the run being reported as successful.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100