Webhooks don't work

Whenever an action is supposed to trigger a notification, I see the following in the logs:

2024-01-12T18:54:23.739623563Z: ERROR :arrow_forward: models/Handle 1d1 Event payload does not contain task ID
2024-01-12T18:54:24.532611241Z: ERROR :arrow_forward: events/func1 1e9 Error while handling message c3463d05-43da-4271-933d-74808d3fde17, subscriber_poisoned=gochannel.GoChannel, reason_poisoned=Error 1146 (42S02): Table ‘vikunja.webhooks’ doesn’t exist, topic_poisoned=task.comment.created, handler_poisoned=task.comment.created.webhook.listener, payload={task:{id:7,title:test,description:,done:false,done_at:0001-01-01T00:00:00Z,due_date:0001-01-01T00:00:00Z,reminders:null,project_id:6,repeat_after:0,repeat_mode:0,priority:0,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:2024-01-12T17:52:14Z,updated:2024-01-12T18:30:39Z,bucket_id:9,position:65536,kanban_position:65536,created_by:null},comment:{id:10,comment:\u003cp\u003etest\u003c/p\u003e,author:{id:2,name:,username:REDACTED,created:2024-01-12T07:57:11Z,updated:2024-01-12T08:05:46Z},created:2024-01-12T18:54:23.73075706Z,updated:2024-01-12T18:54:23.73076112Z},doer:{id:2,name:,username:REDACTED,created:2024-01-12T07:57:11Z,updated:2024-01-12T08:05:46Z}}

Related issue: #1676 - Webhook events task.relation.created and task.relation.deleted doesn't appear to trigger - api - Gitea

Which events did you try?

I subscribed to a task and added a comment to it.

I’m still getting these errors above in the latest API unstable version.

When I GET e.g. https://..**/api/v1/projects/7/webhooks

I get:

{
“message”: “Internal Server Error”
}

The API Docker container says:

handler/ReadAllWeb 284 Error 1146 (42S02): Table ‘vikunja.webhooks’ doesn’t exist

My docker stack:

version: ‘3’

services:
db:
image: mariadb:10
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
USER_ID: REDACTED
GROUP_ID: REDACTED
MYSQL_ROOT_PASSWORD: REDACTED
MYSQL_USER: REDACTED
MYSQL_PASSWORD: REDACTED
MYSQL_DATABASE: REDACTED
volumes:
- /volume1/docker/vikunja/db:/var/lib/mysql
restart: unless-stopped
api:
image: vikunja/api:unstable
environment:
USER_ID: REDACTED
GROUP_ID: REDACTED
VIKUNJA_DATABASE_HOST: REDACTED
VIKUNJA_DATABASE_PASSWORD: REDACTED
VIKUNJA_DATABASE_TYPE: REDACTED
VIKUNJA_DATABASE_USER: REDACTED
VIKUNJA_DATABASE_DATABASE: REDACTED
VIKUNJA_SERVICE_JWTSECRET: REDACTED
VIKUNJA_SERVICE_FRONTENDURL: REDACTED
VIKUNJA_SERVICE_ENABLEREGISTRATION: 1
VIKUNJA_SERVICE_ENABLETASKATTACHMENTS: 1
VIKUNJA_SERVICE_ENABLEEMAILREMINDERS: 1
VIKUNJA_WEBHOOKS_ENABLED: 1
VIKUNJA_WEBHOOKS_TIMOUTSECONDS: 180
VIKUNJA_MAILER_ENABLED: 1
VIKUNJA_DEFAULTSETTINGS_WEEK_START: 1
VIKUNJA_MAILER_HOST: smtp.gmail.com
VIKUNJA_MAILER_PORT: 587
VIKUNJA_MAILER_USERNAME: REDACTED
VIKUNJA_MAILER_PASSWORD: REDACTED
volumes:
- /volume1/docker/vikunja/files:/app/vikunja/files
depends_on:
- db
restart: unless-stopped
frontend:
image: vikunja/frontend
restart: unless-stopped
proxy:
image: nginx
ports:
- REDACTED:80
volumes:
- /volume1/docker/vikunja/nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api
- frontend
restart: unless-stopped

Also maybe worth mentioning that I’ve added VIKUNJA_WEBHOOKS_ENABLED after the initial instalation in a later restart.

Which migrations were run?

I didnt run any migrations. It seems I’m missing something.

Can you check in the migrations table which migrations were run?

There is no migrations table.
This is what’s in the migration table:

SCHEMA_INIT
20190324205606
20190328074430
20190430111111
20190511202210
20190514192749
20190524205441
20190718200716
20190818210133
20190920185205
20190922205826
20191008194238
20191010131430
20191207204427
20191207220736
20200120201756
20200219183248
20200308205855
20200308210130
20200322214440
20200322214624
20200417175201
20200418230432
20200418230605
20200420215928
20200425182634
20200509103709
20200515172220
20200515195546
20200516123847
20200524221534
20200524224611
20200614113230
20200621214452
20200801183357
20200904101559
20200905151040
20200905232458
20200906184746
20201025195822
20201121181647
20201218152741
20201218220204
20201219145028
20210207192805
20210209204715
20210220222121
20210221111953
20210321185225
20210328191017
20210403145503
20210403220653
20210407170753
20210411113105
20210411161337
20210413131057
20210527105701
20210603174608
20210709191101
20210709211508
20210711173657
20210713213622
20210725153703
20210727204942
20210727211037
20210729142940
20210802081716
20210829194722
20211212151642
20211212210054
20220112211537
20220616145228
20220815200851
20221002120521
20221113170740
20221228112131
20230307171848
20230611170341
20230824132533
20230828125443
20230831155832
20230903143017
20230913202615
20231022144641
20231108231513
20240114224713

These are all the tables that are there:

Does it work if you delete the entry for 20230913202615 and restart the Vikunja api?

Was this a new installation or an upgrade?

It was a fresh instalation.
That seems to have gotten rid of the missing table error, however now when I add a comment to a task I’m still getting this error:

models/Handle 162 Event payload does not contain task ID

This should be fixed with the latest unstable build, can you check with that?

Got the latest API unstable docker image and the issue is still there.

This error only happens when I add or update a comment.

This doesn’t appear to be webhook related. I missunderstood that webhooks need to be setup per project manually and tought they worked globally based on actions taken.

Looks like the ci build failed and thus the unstable build you used didn’t contain the fix. The current latest unstable build now has the fix, please pull the update and try again.

I can confirm the error is no longer there on the latest unstable version.

1 Like