#Database events are not getting triggered in Appwrite selfhosted
16 messages · Page 1 of 1 (latest)
You can use
docker compose logs appwrite-realtime -fto see the logs of the realtime containerdocker compose logs appwrite -fto see the logs of appwrite
Version 1.5.7
Checked the logs as you said but when i tried triggering the update database operation it didn't triggered any logs or execution at all
Notice: PDOStatement::execute(): Send of 118 bytes failed with errno=104 Connection reset by peer in @swoole/library/core/Database/PDOStatementProxy.php on line 44
i had modified the data inside the collection and check for this, still it didn't called the events function
i need this database trigger that handles most logics, i had migrated from firebase and worked on appwrite for more than 3 months to setup everything and came this far, now the required features are seen to be implemented porely 😦
what can be solution sir to fix this?
What SDK and version are you using?
SDK version doesn't matter here right, because i had created a function and uploaded it with an event, in the appwrite dashboard i can see the event in settings but even when i ran the logs commands you shared didn't displayed any logs when am trying to run the function, and node-appwrite version inside the functions were latest, i ran the command npm install node-appwrite@latest
debugging is difficult in this scenerio sir
"node-appwrite": "^13.0.0"
this is the exact version i got when i ran latest command yesterday
So please upload the function with the code you're using. You need to provide all information you can to help you. How did you trigger the function? describe your problem as better possible with the steps to reproduce it
Just a tip, your original post mentions usercart so I assume this is user-facing and needs to be responsive. Given that I would not rely on event triggered functions since all of them are Asynchronously executed and can be blocked if volume is high.
I would highly recommend that from your user app create an explicit function execution call using your SDK of choice since those are executed synchronously and would respond immediately.
I know it because it made this mistake and then had to spend days post going live migrating away from event triggers, same goes for cron jobs as well, they are also async.
i was taking count of total users added the item to cart,
to reproduce this issue do one thing, simply create a function with a log message, and set the event to this function as some collection documents gets updated, then update the documents in the collection, the issue will be reproduced as there will be no calls made to the functions
@mental basalt i tried the above steps too nothing worked
@mental basalt sir, simply created a function, then added an event like onupdate of document in a collection it should trigger the function with hello world that's t, but it didn't worked for me.