influxdata / influxdata/kapacitor
Unable to delete smtp config override using API
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
Hello,
I'm having an issue trying to delete the smtp override in the Kapacitor database. According to the [API documentation](https://docs.influxdata.com/kapacitor/v1.2/api/api/#configuration) the following method is supposed to remove an smtp override. Despite getting a successful `HTTP 204` returned, the override still shows up in the config returned by the API. As a workaround, I've been able to set `skip-config-overrides = true` in the kapacitor.conf and that works around the issue for me.
data.json:
```
{
"delete":[
"enabled"
]
}
```
`curl -X POST -d "@data.json" http://localhost:9092/kapacitor/v1/config/smtp/`
in the kapacitor.log:
`[httpd] 127.0.0.1 - - [04/Dec/2017:11:12:14 -0700] "POST /kapacitor/v1/config/smtp/ HTTP/1.1" 204 0 "-" "curl/7.47.0"`
The override still appears to exist:
```
curl http://localhost:9092/kapacitor/v1/config/smtp
{"link":{"rel":"self","href":"/kapacitor/v1/config/smtp"},"elements":[{"link":{"rel":"self","href":"/kapacitor/v1/config/smtp/"},"options":{"enabled":true,"from":"kapacitor@localhost","global":true,"host":"smtp.example.com","idle-timeout":"30s","no-verify":true,"password":false,"port":25,"state-changes-only":true,"to":["user@example.com"],"username":""},"redacted":["password"]}]}
```
Any help would be appreciated. Thanks!
OS: Ubuntu 16.04 64-bit
Kapacitor deb pkg Version: 1.3.3-1
InfluxDB deb pkg Version: 1.4.2-1
Contributor guide
Research direction
Start by reproducing the POST to /kapacitor/v1/config/smtp/ with the data.json payload, then GET the same endpoint and compare the returned elements. Review the configuration override handling behind this API; done means deleting "enabled" removes the SMTP override instead of returning it, without requiring skip-config-overrides in kapacitor.conf.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100