Webhook not working
Hello,
I am using the open source version and its wonderful, now as we want to keep contacts in sync with the latest changes in the crm, we started to impleement a webhook strategy for people and companies but, the webhook dont trigger at all.
Any ideea what we can do regarding this?
36 Replies
p.s the issue remain even if I chosee all events to be triggered.
@martmull 🙂
Hey @Denis , is your worker running?
Twenty - Local Setup
Mostly for contributors or curious developers
worker is needed for webhooks to work
Hmm, fair enough, mostlikely It was never addded in the docker-compose file as I deployed it via coolify. - I will check and implement it - I will come back with a answer regarding this. thanks 💫
I was looking in the worker log and eveything its working as it should (or at least, no error appear) - any idea on how to fix this?
here is the docker-compose file I have:
https://docs.google.com/document/d/1o0967WUnk4ktj6nHxi4_aUyon3SCtuCeq6pjcsTqOcA/edit?usp=sharing
Google Docs
version: '3
version: '3.9' services: twenty: image: 'twentycrm/twenty:latest' environment: - SERVICE_FQDN_TWENTY_3000=domain.tld - SERVER_URL=https://domain.tld - FRONT_BASE_URL=https://domain.tld - ENABLE_DB_MIGRATIONS=true - 'CACHE_STORAGE_TYPE=${CACHE_STORAGE_TYPE:...
you should be able to see worker log lines like this one
can you explore your database? What contains your <workspace_schema>.webhook table?
hmm.
in the worker image I have just (see the txt attached)
@martmull I was keep looking in the logs to see what I am missing and I see:
2024-11-19T11:55:11.318508295Z ForbiddenException: Forbidden resource
2024-11-19T11:55:11.318512252Z at canActivateFn (/app/node_modules/@nestjs/core/helpers/external-context-creator.js:157:23)
2024-11-19T11:55:11.318525006Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-11-19T11:55:11.318528222Z at async target (/app/node_modules/@nestjs/core/helpers/external-context-creator.js:73:31)
2024-11-19T11:55:11.318531187Z at async Object.currentUser (/app/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)
2024-11-19T11:55:11.318534143Z at async field.resolve (/app/node_modules/@envelop/on-resolve/cjs/index.js:36:42)
2024-11-19T11:55:11.318537079Z at async /app/node_modules/@graphql-tools/executor/cjs/execution/promiseForObject.js:18:35
2024-11-19T11:55:11.318540004Z at async Promise.all (index 0) {
2024-11-19T11:55:11.318542839Z path: undefined,
2024-11-19T11:55:11.318545655Z locations: undefined,
2024-11-19T11:55:11.318548500Z extensions: { code: 'INTERNAL_SERVER_ERROR', response: 'Forbidden resource' }
2024-11-19T11:55:11.318551455Z }
2024-11-19T11:55:11.318554201Z ]
I see at process.processTicksAndRejections (node:internal/process/task_queues:95:5), it can be the reason why the worker is not triggering?
Mmh, is that a worker log error? It looks like a server error
Well, the worker dont show any error, just modules that were initialized.
so, to sumup, your worker is running, you have created a webhook that send POST payload to webhook.site/... on C_UD people, and when you create a person, you don't see anything, either in logs or in webhook.site
Can you double check the MESSAGE_QUEUE_TYPE=pg-boss env variable?
what does it mean when defined like this?
- 'MESSAGE_QUEUE_TYPE=${MESSAGE_QUEUE_TYPE:-pg-boss}'
Yes, thats right, I will hardcode the variable in docker-compose as well but, small chances for this to be the issue as in the same way I send other variables like app_secret, SERVER_URL, FRONT_BASE_URL and ther est
I changed it to: " - 'MESSAGE_QUEUE_TYPE=pg-boss'" and the issue remain the same.
ok, server and workers need to be restarted to take into account new environment variables
think might be the issue in fact, as MESSAGE_QUEUE_TYPE now defaults to bull-mq, and bull-mq needs redis
Hm, I was reloading the docker images everytime but fair enough, I will give this a shot as well, p.s thank you for your kindness, we reached 20 messages in this thread 🫶
sadly the issue still persist 😦
@charles any idea on that?
I have the same issue!!
@martmull @Marcelo Tate @Denis pg-boss is depreciated, could you guys switch to bull-mq? (you should have redis already present in your docker-compose on latest versions)
you are on v0.32 right? (there is actually an issue in our docker build commands and v0.32 container actually containers v0.33-canary
nope, we used the :latest tag in the docker-compose for all the images.
ok! It's fine 🙂 this should point to the v0.32 but we have an issue with the build commands so you get the v0.33
you should not have any issue with webhooks on this version
could you make sure to use bull-mq?
MESSAGE_QUEUE_TYPE=bull-mq
this is what your docker-compose should look like now: https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/docker-compose.yml
And associated .env: https://github.com/twentyhq/twenty/blob/main/packages/twenty-docker/.env.example
if you don't specify MESSAGE_QUEUE_TYPE it will default to bull-mq
Note: keep your current twenty-postgres container, no need to upgrade to twenty-postgres-spilo yet
I gave it a try but still not working 😦
@Marcelo Tate let's schedule a call to fix this with you, when would you be availble?
Sure! Im available now ill send you a pm 🙂
This is the same for me as well :/
we have a call at 5PM Paris time tomorrow, would you like to join? We will be on Discord #voice channel
Codefile.io
Untitled file — Codefile
Create collaborative code files online for your technical interviews, pair programming, teaching, etc.
Hey @Denis, are you available for a 30min call today to fix this issue?
Yes
Anytime
Are you available a 3pm paris time?
Yes, perfect
Great
@Denis found the issue, it looks to be an issue with the coolify image