Webhooks not sent in local setup
I tried setting webhooks in Settings to be sent to https://webhook.site to check @Skyfox675's problem with duplicated webhooks but upon setting them, no webhook was sent to specific address. From what I know, there's no need to set any kind of authorization as they're basically a callbacks. What am I setting wrong?
Webhook.site - Test, transform and automate Web requests and emails
Instantly generate a free, unique URL and email address to test, inspect, and automate (with a visual workflow editor and scripts) incoming HTTP requests and emails
41 Replies
@ɃØĦɆᵾS do you have your worker running?
The app itself is running fine if that's what you mean by worker, I set the URL in UI, not in .env in twenty-server
no I mean that for webhooks to work you shoud also run:
- npx nx run twenty-server:worker
in parallel with:
- npx nx run twenty-server:start
the worker is handling all async jobs (including webhooks!)
Oh, no, it's not running, I'll check it and brb
cool, that should be it!
I have running
npx nx start
in one terminal and run npx nx run twenty-server:worker
in another but worker exits with no problems, I guess this shouldn't happen if it's supposed to be running in parallel
Also tried running npx nx run twenty-server:start
npx nx run twenty-front:start
and npx nx run twenty-server:worker
in separate terminals but again, worker exits after ~15 secoh, are you running out of memory on your machine?
Right now it's a nightmare: the front takes 6GB, the server 1.7GB and the worker 1.7GB too, I'm on a mission this week-end to get it back to some normal level and identify the issue
npx nx run twenty-server:worker should stay up and running like npx nx run twenty-server:start is
can you try to run
npx nx run twenty-front:start
in a terminal and npx nx run twenty-server:worker
in another one
You'll miss the server but it will confirm if you don't have enough memory for the 3 running togetherNo, I have way more memory than normal user needs 😄
okay!
could you share a screen of your npx nx run twenty-server:worker terminal?
Sure, I can
But what's weirder for me is a fact that I turned off server, run worker in different terminal and it "Successfully ran target"
weird, could you share your screens?
it should look like this
Meanwhile I'm testing webhooks on demo and found another bug 😆
there is something wrong, your worker is triggering your server
have you touched your configuration ?
are you on main branch?
Yes, I'm on main
And by configuration, you mean .env in twenty-server?
more nx stuff such as nx.json or project.json
No, I'm not nowhere near them, they're too scary for me
haha
oooh hold on
I see that you are using MESSAGE_QUEUE_TYPE=sync which is the default
but we are deprecating it
do you have redis ?
that would be the best setup if you can add it
and then MESSAGE_QUEUE_TYPE=bull-mq
Nope, only postgres
is your postgres on docker or local?
Postgres is in docker
perfecg
so can you also add a redis ? a basic redis would do it
To docker? Why not, I'll check how
a redis container yes
it's something I want to add by default in all configurations
for self-host and production it improves a lot Twenty performance
and it's super easy to setup
How to Deploy and Run Redis in a Docker Container
Build fast apps fast with Redis.
$ docker run -d --name my-redis-stack -p 6379:6379 redis/redis-stack-server:latest
and so your server can use it in your .env:
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
MESSAGE_QUEUE_TYPE=bull-mq
this will set up your queue (processed by the worker) to use bull-mq which is using redis
and if you want you can also use redis for cache: CACHE_STORAGE_TYPE=redis
This week-end I will remove this sync driver and add redis to all default configurations
Okay, I'm checking it, I had to create the bug https://github.com/twentyhq/twenty/issues/6726
GitHub
Missing creator's data in webhooks · Issue #6726 · twentyhq/twenty
Found on demo, probably reproducible on self-hosted Scenario: Log in Go to https://webhook.site/ and copy unique URL Go to Settings > Developers, add copied URL to webhooks Create any object (Pe...
Now it works, geez
interesting!
thanks for reporting the issue, Jeremy will look into that next week
No problem, checked it already on self-host and I can't reproduce it there 🤔
Create an issue for updating the documentation for developers?
I think it's important of these changes in case somebody will want to have webhooks working on self-hosted
I will do this we! disconnecting for tonight!
Have a great we @ɃØĦɆᵾS 🙂
Thanks for the help and also, have a nice weekend! 👍
GitHub
Update dev's documentation for enabling webhooks on self-hoster · I...
Based on conversation in Discord server https://discord.com/channels/1130383047699738754/1276587741144154193 Right now, there's no documentation regarding enabling webhooks on self-hosted. As i...
Hey @ɃØĦɆᵾS sorry just now seeing this been swamped today, glad to see you got it fixed!
Chill and thanks (but still that's thanks to @charles help)
@charles I can take a run at the doc updates if it's helpful
@ɃØĦɆᵾS I just finished a fairly basic N8n workflow that triggers on incoming webhook, uses a few If's to filter eventName's and IP CIDR's, then leverages the TwentyCRM Rest API a few times and creates a Trello card from a template. Not sure if direct import will work for you or not, since you won't have access to the credential objects but you can give this a try to get up and running if it helps:
Nice, but you should at least do some basic anonymization, just saying 🙂
And let's move to other thread as I got my problem solved
@charles something to take care of as I just found out: Redis must support rebuilding from schema, I had to reset whole Postgres due to shenanigans, launched Redis again and I got many errors about wrong workspace but when I added webhook URL to new workspace, it literally spammed my terminal despite not sending webhook
Ehhh it's one of a 100 emails, they're disposable 😎 thanks for pointing it out though appreciate it!
interesting!