Back

Upgraded to 1.4.13 and now none of my database writes trigger associated functions

  • 0
  • Self Hosted
  • Functions
  • Databases
Drake
20 Dec, 2023, 23:04

True...

TL;DR
Issue: After upgrading to version 1.4.13, none of the database writes are triggering associated functions. Also experiencing issues with the number of functions running simultaneously, causing unreliable triggers. Solution: It was found that there appears to be a maximum number of functions that can run at the same time, beyond which functions become unreliable or are stopped from triggering. The issue was temporarily resolved by reducing the number of functions to 5. Further investigation and insights are still needed to address the problem. Additionally, there are inconsistencies with cron execution and the functions domain is still set to localhost, which may be related to the issue.
Drake
20 Dec, 2023, 23:04

No, that's async

Drake
20 Dec, 2023, 23:04

πŸ‘€

punti_z
20 Dec, 2023, 23:07

The hell ??? .. Let me check again.. I am completely lost at this point.. Let me delete all functions and redeploy them and test some more with crons and report back

punti_z
20 Dec, 2023, 23:32

Found something on redis logs. Not sure if its related

Drake
20 Dec, 2023, 23:39

Yes, this could be related

punti_z
20 Dec, 2023, 23:39

Also Crons are getting executed though inconsistently.. This is a every minute cron

punti_z
20 Dec, 2023, 23:46

Any ideas on what I should do to address it ? Atleast try to resolve this migraine of an issue

punti_z
20 Dec, 2023, 23:49

Also I have a custom domain setup for my appwrite instance but functions domain is still localhost. Not sure if its relevant but trying to provide as much information as possible

punti_z
21 Dec, 2023, 00:57

[SOLVED] Upgraded to 1.4.13 and now none of my database writes trigger associated functions

punti_z
21 Dec, 2023, 01:23

Upgraded to 1.4.13 and now none of my database writes trigger associated functions

punti_z
21 Dec, 2023, 01:38

Is there a max number of functions that can run at the same time ? When I removed all function and added a subset it started working again and then as I deployed all it stopped ??

Verified, definitely the root cause. Brought the function count down to 5 and its up and running again. There seems to be a max functions limit after which functions become unreliable or are stopped from triggering. Will wait for your insights on the matter.

Drake
21 Dec, 2023, 01:51

🧐 shouldn't be no...

Drake
21 Dec, 2023, 01:51

are they all listening on events?

Drake
21 Dec, 2023, 01:52

added a subset

Why did you need to do this?

punti_z
21 Dec, 2023, 01:55

Nothing was working so I deleting all my functions and just deployed a couple that trigger on user registration and they started working as expected. Added a couple more, kept working, added all and things went back to broken. Now I deleted all functions and again added just 2 and they are working again.

punti_z
21 Dec, 2023, 01:56

Well in total there are 14 functions, 4 are cron and 5 listen to db events and 1 to user session. Remaining 4 don't listen to events but are triggered by other functions

Drake
21 Dec, 2023, 01:57

maybe 1 of the functions is throwing an error and causing the rest to not execute

Drake
21 Dec, 2023, 01:58

functions triggering off functions can be dangerous πŸ‘€

punti_z
21 Dec, 2023, 01:59

How so ? I did it for efficiency otherwise a single function runs quite long so I split it and now have it create an execution if needed

Drake
21 Dec, 2023, 02:00

asynchronous execution?

punti_z
21 Dec, 2023, 02:01

Yup

Drake
21 Dec, 2023, 02:01

that might not be as bad

punti_z
21 Dec, 2023, 02:04

Well now need to spend time figuring out what function is causing issues. Will do that tomorrow. BTW the test server is only 2 vcpus, can low core count and multiple functions running cause any issues ?

Also 1.4.5 never had this issue. The application would become quite slow and function executions piled up but triggers would never fail. That upgrade to 1.4.13 opened quite the can of worms for me

Drake
21 Dec, 2023, 02:09

possibly if you're making a lot of network requests against Appwrite

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more