Skip to content
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

kapacitor tasks migration #2791

Open
liukaiyuliukaiyu opened this issue Dec 12, 2023 · 0 comments
Open

kapacitor tasks migration #2791

liukaiyuliukaiyu opened this issue Dec 12, 2023 · 0 comments

Comments

@liukaiyuliukaiyu
Copy link

I can now confirm that this process works like something like this:
kapacitor version 1.3.1
1.sudo mv /var/lib/kapacitor/kapacitor.db /var/lib/kapacitor/kapacitor.db.backup
2.sudo service kapacitor restart, An empty db file is used at startup
3. call http://127.0.0.1:9092/kapacitor/v1/tasks,rebuild all tasks
but the following panic error occurred during the tasks migration, and when I issue kapacitor list tasks I get:
kapacitor failed to list tasks with pattern "": no key exists

[httpd] 10.169.64.40 - - [12/Dec/2023:14:38:37 +0800] "GET /kapacitor/v1/ping HTTP/1.1" 204 0 "-" "okhttp/3.12.0" 14a2520d-98b9-11ee-9308-000000000000 67
log messages must have 'L!' prefix where L is one of 'D', 'I', 'W', 'E'[log] 2023/12/12 14:38:37 http: panic serving 10.169.64.40:26208: page 233 already freed
goroutine 165344 [running]:
net/http.(*conn).serve.func1(0xc421060100)
/usr/local/go/src/net/http/server.go:1491 +0x12a
panic(0x1bb4d80, 0xc4205a7990)
/usr/local/go/src/runtime/panic.go:458 +0x243
github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt.(*freelist).free(0xc4201342a0, 0x5ef, 0x7fa0c98cd000)
/root/go/src/github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt/freelist.go:117 +0x2c0
github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt.(*node).spill(0xc42036c070, 0xc421602de0, 0xc42096e958)
/root/go/src/github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt/node.go:363 +0x1dc
github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt.(*Bucket).spill(0xc420786e00, 0xc421602c00, 0xc42096ebc8)
/root/go/src/github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt/bucket.go:541 +0x43b
github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt.(*Bucket).spill(0xc4200e22b8, 0x2e31dddc, 0x2e88300)
/root/go/src/github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt/bucket.go:508 +0x93b
github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt.(*Tx).Commit(0xc4200e22a0, 0x0, 0x0)
/root/go/src/github.com/influxdata/kapacitor/vendor/github.com/boltdb/bolt/tx.go:163 +0x125
github.com/influxdata/kapacitor/services/storage.(*boltTx).Commit(0xc4205a7780, 0xc4205a7780, 0x0)
/root/go/src/github.com/influxdata/kapacitor/services/storage/bolt.go:181 +0x2f
github.com/influxdata/kapacitor/services/storage.DoUpdate(0x2e26c60, 0xc420397700, 0xc421602cc0, 0x0, 0x0)
/root/go/src/github.com/influxdata/kapacitor/services/storage/storage.go:94 +0xe8
github.com/influxdata/kapacitor/services/storage.(*Bolt).Update(0xc420397700, 0xc421602cc0, 0x0, 0xc4209ec420)
/root/go/src/github.com/influxdata/kapacitor/services/storage/bolt.go:27 +0x41
github.com/influxdata/kapacitor/services/storage.(*IndexedStore).put(0xc42023a5a0, 0x2e2c0e0, 0xc421064000, 0x1f30000, 0x1, 0xc421064000)
/root/go/src/github.com/influxdata/kapacitor/services/storage/indexed.go:198 +0xa2
github.com/influxdata/kapacitor/services/storage.(*IndexedStore).Create(0xc42023a5a0, 0x2e2c0e0, 0xc421064000, 0x4a99f2, 0x6577ffed)
/root/go/src/github.com/influxdata/kapacitor/services/storage/indexed.go:175 +0x46
github.com/influxdata/kapacitor/services/task_store.(*taskKV).Create(0xc4204960a8, 0xc420d9a450, 0x24, 0x0, 0xc4209ec400, 0x1, 0x1, 0xc420a06000, 0x23f, 0x0, ...)
/root/go/src/github.com/influxdata/kapacitor/services/task_store/dao.go:224 +0x8d
github.com/influxdata/kapacitor/services/task_store.(*Service).handleCreateTask(0xc42026bb80, 0x2e340e0, 0xc4209ec340, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/task_store/service.go:777 +0x5d0
github.com/influxdata/kapacitor/services/task_store.(*Service).(github.com/influxdata/kapacitor/services/task_store.handleCreateTask)-fm(0x2e340e0, 0xc4209ec340, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/task_store/service.go:130 +0x48
github.com/influxdata/kapacitor/services/httpd.authorize.func1(0x2e340e0, 0xc4209ec340, 0xc4209f21e0, 0x1fba4d3, 0xa, 0x1, 0x2ea8360, 0x0, 0x0, 0xc420422de0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:714 +0xe9
github.com/influxdata/kapacitor/services/httpd.authenticate.func1(0x2e340e0, 0xc4209ec340, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:579 +0xa6d
net/http.HandlerFunc.ServeHTTP(0xc42036a040, 0x2e340e0, 0xc4209ec340, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.jsonContent.func1(0x2e340e0, 0xc4209ec340, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:818 +0xb1
net/http.HandlerFunc.ServeHTTP(0xc42036a060, 0x2e340e0, 0xc4209ec340, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.gzipFilter.func1(0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:811 +0x1e3
net/http.HandlerFunc.ServeHTTP(0xc42036a080, 0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.versionHeader.func1(0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:827 +0xbc
net/http.HandlerFunc.ServeHTTP(0xc42036a0a0, 0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.cors.func1(0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:860 +0xee
net/http.HandlerFunc.ServeHTTP(0xc42036a0c0, 0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.requestID.func1(0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:870 +0x138
net/http.HandlerFunc.ServeHTTP(0xc42036a0e0, 0x2e2bd60, 0xc4209ec300, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.logHandler.func1(0x2e2bd60, 0xc4209ec2e0, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:878 +0xfa
net/http.HandlerFunc.ServeHTTP(0xc42036a120, 0x2e2bd60, 0xc4209ec2e0, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.recovery.func1(0x2e33e20, 0xc42041a410, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:887 +0xfa
net/http.HandlerFunc.ServeHTTP(0xc42036a1c0, 0x2e33e20, 0xc42041a410, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:1726 +0x44
github.com/influxdata/kapacitor/services/httpd.(*ServeMux).ServeHTTP(0xc420360d20, 0x2e33e20, 0xc42041a410, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/mux.go:163 +0x7f
github.com/influxdata/kapacitor/services/httpd.(*Handler).ServeHTTP(0xc4203d1380, 0x2e33e20, 0xc42041a410, 0xc4209f21e0)
/root/go/src/github.com/influxdata/kapacitor/services/httpd/handler.go:365 +0xcf
net/http.serverHandler.ServeHTTP(0xc4204e7080, 0x2e33e20, 0xc42041a410, 0xc4209f21e0)
/usr/local/go/src/net/http/server.go:2202 +0x7d
net/http.(*conn).serve(0xc421060100, 0x2e360a0, 0xc421702200)
/usr/local/go/src/net/http/server.go:1579 +0x4b7
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2293 +0x44d

This problem has bothered me for half a year, and I need help urgently. Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant