Good day, I am wondering how stable appwrite functions are. I am running the same function on every team creation and sometimes it creates everything fine, sometimes it does not execute properly. This function should execute every time a team is created.
This is the errors I get sometimes: Error: Server Error at Client.call (/usr/local/server/src/function/node_modules/node-appwrite/lib/client.js:172:31) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Databases.createCollection (/usr/local/server/src/function/node_modules/node-appwrite/lib/services/databases.js:239:16) at async Module.default (file:///usr/local/server/src/function/src/main.js:117:33) at async execute (/usr/local/server/src/server.js:141:22) at async /usr/local/server/src/server.js:158:13
I got this in the logs once it is not an error but the function did not execute fully:
Unsupported logs detected. Use context.log() or context.error() for logging.
AppwriteException [Error]: Server Error at Client.call (/usr/local/server/src/function/node_modules/node-appwrite/lib/client.js:172:31) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Databases.createBooleanAttribute (/usr/local/server/src/function/node_modules/node-appwrite/lib/services/databases.js:427:16) { code: 500, type: 'general_unknown', response: { message: 'Server Error', code: 500, type: 'general_unknown', version: '1.4.13' } }
the function code is in the attachment. I am just wondering why if works sometimes but does not sometimes, and I am not changing anything about how I am creating the team.
Thanks
The log error could be due to an unsupported format different from a string or an unhandled error.
The other error looks due to an incorrect attribute when creating a document
what is confusing is that it works sometimes.
So is it a problem with the way I structured the function?
And that has been my experience using appwrite functions. Sometimes a function does not work and I just try again and it works. So I am wondering if there is something I can do to stop this from happening. I am selfhosting my appwrite server, and some of these function executions are essential for my app, so if they do not run properly then that would be a mess. Last time it worked but did not create an attribute randomly.
How much time does it take for each function to run?
out of all the functions maxumum 1 second
and I have set timeout to 180 seconds
And does that happen when multiple functions are executed at the same time?
Also, I checked your code, and I recommend await in all the DB actions
Since that could be causing errors while sending all requests at the same time
Hey, are you logging anything?
I would also change your timeout to 15 seconds, because that's very long for a function.
Recommended threads
- Connectivity issue after upgrade to 1.9....
When running this command :- docker compose exec appwrite doctor I am getting the following error:- 🔴 Console.DB.(console)...........................disconnect...
- Transaction feature is not working somet...
I am getting the below error sometimes and sometimes it is working perfectly fine. Transaction failed: AppwriteException: transaction_not_found, Transaction wi...
- Updating to 1.9.0
Docs are lacking, I've already run in to some issues: - Firstly the web UI port doesn't work... had to add ```--http-port=9999``` in to the docker run command t...