influxdata / influxdata/kapacitor
[kapacitor 1.5.8] Crashing kapacitor on Invalid URL for sideload node
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Dear maintainers,
Today I have found an issue where kapacitor service will immediatly crash on giving an invalid URL for the sideload node.
Whenever trying to restart the kapacitor service, it will crash on loading the problematic script.
This is the tickscript to reproduce the error:
```
var data = stream
|from()
.database('telegraf_staging')
.retentionPolicy('high_res')
.measurement('my_measurement')
.groupBy('tag1', 'tag2')
|sideload()
.source(' http://example.com/sideload')
.order('{{.tag1}}')
.tag('tag1', 'ignore')
```
The following is the error message whenever you enable this tickscript. Also any time you try to start kapacitor, you will find that the process will exit with an error message in the logs.
```
ts=2021-02-23T15:55:41.363Z lvl=debug msg="starting enabled task on startup" service=task_store task=crash_me
ts=2021-02-23T15:55:41.374Z lvl=debug msg="starting task" service=kapacitor task_master=main task=crash_me
2021/02/23 15:55:41 parse " http://example.com/sideload": first path segment in URL cannot contain colon
```
The only way I could recover from this error is by removing the problematic tickscript manually from the boltdb `kapacitor.db` file using https://github.com/br0xen/boltbrowser
Contributor guide
Research direction
Start with the provided sideload tickscript and reproduce the startup failure using the invalid URL. Inspect how the enabled task is loaded from the kapacitor.db BoltDB file and compare the logged URL parse error with the service startup path. Done means the invalid sideload configuration no longer causes Kapacitor to exit during startup, with behavior verified against this reproduction.
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
- 38/100