Back
Synchronous Function Execution Timed Out (408) on Appwrite Cloud – Dart Function
- 0
- Flutter
- Functions
- Cloud
Hi Appwrite team 👋
I’m facing a synchronous function execution timeout issue on Appwrite Cloud and would appreciate some guidance.
I executed this function using flutter appwrite sdk: appwrite: 17.0.1
Error Message:
TypeScript
Error Code: 408```
```Function Details:
Runtime: Dart (dart-3.5)
Function Type: HTTP-triggered
Method: POST
Plan: Free plan (Appwrite Cloud)
Resources:
CPU: 0.5
Memory: 512 MB
Configured Timeout: 15 seconds
Execution Info:
Status Code: 500
Status: Failed
Triggered By: HTTP
Actual Duration: ~30 seconds```
TL;DR
Developers are facing a synchronous function execution timeout issue on Appwrite Cloud while using the Flutter appwrite SDK. The error message suggests switching to asynchronous execution or ensuring the duration doesn't exceed 30 seconds. The function details, including the runtime, method, and resources, are provided. Potential solutions include switching to asynchronous execution or optimizing the function to run within the time limit.How I executed function from Flutter Application
TypeScript
@override
Future<Uint8List?> sendByteData(Uint8List byteData) async {
Uint8List? responseData;
// Execute the function with the provided byte data
// and return the response as byte data.
//
// To send base64-encoded data:
// - Set Content-Type to 'text/plain'
// - Use path: '/xxx?type=base64'
// - Use body: base64Encode(byteData)
//
// To send binary data:
// - Set Content-Type to 'application/octet-stream'
// - Use path: '/xxx'
// - Use body: String.fromCharCodes(byteData)
await _functions
.createExecution(
functionId: _functionId,
headers: {
'Content-Type':
'text/plain', // Use 'application/octet-stream' for binary data
},
path: '/xxx?type=base64', // Use '/xxx' for binary data
method: ExecutionMethod.pOST,
body: base64Encode(
byteData), // Use String.fromCharCodes(byteData) for binary data
)
.then(
(Execution execution) {
// print('Execution MAP: => ${execution.toMap()}\n');
print('[PORT-XXX] Function executed successfully: ${execution.responseBody}\n');
// if it is not UnAuthorized response then responseData with byte data
if (!execution.responseBody.contains('UnAuthorized')) {
// When sending base64 data, the response is also base64-encoded
responseData = base64Decode(execution.responseBody);
}
},
).onError((error, stackTrace) {
throw "$error";
});
return responseData;
}
Recommended threads
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support 👋 I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...
- Bug: TOTP MFA verification always fails ...
*Bug: TOTP MFA verify always returns `user_invalid_token` (Cloud 1.8.1, Frankfurt)** Project ID: `68dd48440003e537d849` SDK: `appwrite@18.2.0` (also tested wit...
- SSL Certificate Issuance Failed
When we first deployed our site using appwrite and a custom domain everything was working, but it seems like the SSL certificate never got renewed. I tried dele...