influxdata / influxdata/kapacitor
Topic "all" seems to be illegal - intentional or bug?
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
It seems to be the case that if one of my handlers is subscribed to topic `all`, then Kapacitor will not launch.
To reproduce:
- Using Kapacitor 1.5
- Using provisioned handlers (i.e. they are packaged into a specific path `KAPACITOR_LOAD_DIR` is supplied)
- Since I'm deploy it fresh every time into a k8s env there is nothing to "reload" - everything is launching from scratch
- One of my handlers is subscribed to the topic `all`
The key error lines are these:
{noformat}
ts=2018-07-19T00:53:35.284Z lvl=error msg="failed to remove missing" service=load err="expected id to be topicID/handlerID"
ts=2018-07-19T00:53:35.284Z lvl=error msg="encountered error" service=run err="open server: failed to reload tasks/templates/handlers: expected id to be topicID/handlerID"
run: open server: failed to reload tasks/templates/handlers: expected id to be topicID/handlerID
{noformat}
I browsed the source code that yields these lines: https://github.com/influxdata/kapacitor/blob/master/services/load/service.go
Throwing darts at the board my hunch is that somewhere under-the-hood the topic "all" is being treated as a special case - perhaps by the restapi.
I couldn't seem to find any documentation about illegal topic names, so if this is intentional then it would be great to add that.
I don't have any particular need for a topic name of "all" so I simply renamed it to "all-alerts" and moved on once I tracked down the issue. However, I decided to open this issue behind in hopes of saving time for future-comers that run into this.
Contributor guide
Research direction
Start with services/load/service.go and reproduce the Kapacitor 1.5 startup using a provisioned handler subscribed to the topic `all`. Trace the `expected id to be topicID/handlerID` error during reload. Done means either the handler loads successfully with that topic or the restriction is documented for future users.
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