-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting all recordings corrupts list of recordings #1295
Comments
@hraftery I have been able to reproduce this bug. I'll put together a fix, for now if you remove your entire |
Great, thanks. Was just going to confirm the bug on a different installation with this simple reproduction method:
Anyway to export the existing tasks ready for re-import, prior to deleting kapacitor.db? |
First make a copy of the db file. Then it should be pretty straightforward to put together a script to download and save the JSON for each of the tasks from the API. Then you can POST that JSON back for each task (minus some read only fields). See https://docs.influxdata.com/kapacitor/v1.2/api/api/#tasks If anything goes wrong just restore your copy of the db file and everything will be back(bug included). |
I can now confirm that this process works like something like this:
with a couple of caveats:
|
@hraftery Yes, those statements look good as a work around with the current version. PR #1296 should provide a permanent fix. The steps once that is merged and released will be:
The issue stems from stale and invalid indexes existing in the database from previous versions of Kapacitor. The fix is to provide an API endpoint to rebuild indexes , which is what is happening above. |
I think this was triggered by issuing
kapacitor delete recordings *
because initially that didn't work either and the issue appeared immediately afterwards.Now when I issue
kapacitor list recordings
I get:failed to list recordings with pattern "": no key exists
I can see the following appear in
kapacitor.log
:[httpd] 127.0.0.1 - - [03/Apr/2017:08:44:48 +1000] "GET /kapacitor/v1/recordings?fields=type&fields=size&fields=date&fields=status&limit=100&offset=0&pattern= HTTP/1.1" 400 92 "-" "KapacitorClient" fa11ae1f-17f5-11e7-8332-000000000000 16340
Strangely enough, I still seem to be able to record and replay recordings just fine.
The text was updated successfully, but these errors were encountered: