mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-03-08 23:03:29 -05:00
task.comment.deleted triggers panic in event listener which sends webhook #627
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jjarboe on GitHub (Sep 15, 2025).
Description
I can't reproduce on demo because the error is only visible in the server log.
I have a webhook registered for task.comment.deleted events which never gets called when I delete comments. The server logs show:
vikunja-1 | time=2025-09-15T08:48:09.829Z level=ERROR msg="Error while handling message 1c903362-72d1-43e5-a05e-e2a40d2a6c0c, handler_poisoned=task.comment.deleted.webhook.listener, subscriber_poisoned=gochannel.GoChannel, reason_poisoned=panic occurred: &runtime.TypeAssertionError{_interface:(*abi.Type)(0x18724a0), concrete:(*abi.Type)(nil), asserted:(*abi.Type)(0x18f8880), missingMethod:""}, stacktrace: \ngoroutine 508 [running]:\nruntime/debug.Stack()\n\t/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/debug/stack.go:26 +0x5e\ngithub.com/ThreeDotsLabs/watermill/message/router/middleware.Recoverer.func1.1()\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router/middleware/recoverer.go:29 +0x50\npanic({0x18d60a0?, 0xc026423680?})\n\t/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/src/runtime/panic.go:783 +0x132\ncode.vikunja.io/api/pkg/models.reloadEventData(0xc025a75450, 0xc0263f4e10, 0xd)\n\t/go/src/code.vikunja.io/api/pkg/models/listeners.go:873 +0x5d4\ncode.vikunja.io/api/pkg/models.(*WebhookListener).Handle(0xc000416240, 0xc0261b3680)\n\t/go/src/code.vikunja.io/api/pkg/models/listeners.go:974 +0x5ba\ngithub.com/ThreeDotsLabs/watermill/message.(*Router).AddConsumerHandler.func1(0x5709e4?)\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router.go:349 +0x17\ngithub.com/ThreeDotsLabs/watermill/message/router/middleware.Recoverer.func1(0xc026183b3c?)\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router/middleware/recoverer.go:33 +0x70\ngithub.com/ThreeDotsLabs/watermill/message/router/middleware.Retry.Middleware-fm.Retry.Middleware.func1.2()\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router/middleware/retry.go:104 +0x9e\ngithub.com/cenkalti/backoff/v5.Retry[...]({0x26d48a0?, 0xc0265633b0}, 0xc026513290, {0xc026525860, 0x4, 0x481c65})\n\t/go/pkg/mod/github.com/cenkalti/backoff/v5@v5.0.3/retry.go:87 +0x207\ngithub.com/ThreeDotsLabs/watermill/message/router/middleware.Retry.Middleware-fm.Retry.Middleware.func1(0xc0261b3680)\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router/middleware/retry.go:127 +0x351\ngithub.com/ThreeDotsLabs/watermill/message/router/middleware.poisonQueue.Middleware-fm.poisonQueue.Middleware.func1(0x192bc40?)\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router/middleware/poison.go:100 +0xa2\ngithub.com/ThreeDotsLabs/watermill/components/metrics.HandlerPrometheusMetricsMiddleware.Middleware-fm.HandlerPrometheusMetricsMiddleware.Middleware.func1(0xc0261b3680)\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/components/metrics/handler.go:62 +0x2e8\ngithub.com/ThreeDotsLabs/watermill/message.(*handler).handleMessage(0xc000030750, 0xc0261b3680, 0xc000577aa0)\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router.go:824 +0x1cc\ncreated by github.com/ThreeDotsLabs/watermill/message.(*handler).run in goroutine 32\n\t/go/pkg/mod/github.com/!three!dots!labs/watermill@v1.5.1/message/router.go:670 +0x2a8\n, topic_poisoned=task.comment.deleted, payload={"task":{"id":49,"title":"vtask [TASK-2025-00006]","description":"\u003cp\u003edescription from vikunja\u003c/p\u003e","done":false,"done_at":"0001-01-01T00:00:00Z","due_date":"0001-01-01T00:00:00Z","reminders":null,"project_id":13,"repeat_after":0,"repeat_mode":0,"priority":1,"start_date":"0001-01-01T00:00:00Z","end_date":"0001-01-01T00:00:00Z","assignees":null,"labels":null,"hex_color":"","percent_done":0,"identifier":"","index":1,"related_tasks":null,"attachments":null,"cover_image_attachment_id":0,"is_favorite":false,"created":"2025-09-15T08:41:52Z","updated":"2025-09-15T08:45:15Z","bucket_id":0,"position":0,"reactions":null,"created_by":null},"comment":{"id":30,"comment":"","author":null,"reactions":null,"created":"0001-01-01T00:00:00Z","updated":"0001-01-01T00:00:00Z"},"doer":null}"
It looks like doer is nil at listeners.go:873 because the tc.Author is set from the return value of GetUserOrLinkShareUser(), which can return nil without err if neither if statement is entered. The nil value seems to be the source of the panic in watermill.
Vikunja Version
1.0.0-rc2
Browser and version
Chrome 139.0.7258.155 (Mac)
Can you reproduce the bug on the Vikunja demo site?
No
Screenshots
No response
@PhYdrogen commented on GitHub (Sep 17, 2025):
Got this error too, on the same version, but it's only when I use the share view mode
@kolaente commented on GitHub (Oct 8, 2025):
Fixed in https://github.com/go-vikunja/vikunja/pull/1621, please check with the next unstable build (should be ready for deployment in ~30min, also on try).