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
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...