
Hi all, I'm encountering an issue when calling an Appwrite function from my Flutter app. Environment:
Appwrite Flutter SDK: 16.1.0```
**Problem:**
I'm getting the following error in the Flutter app when calling a function:
```AppwriteException: general_unknown, Server Error (500)
#0 ClientMixin.prepareResponse (package:appwrite/src/client_mixin.dart:90:9)
#1 ClientIO.call (package:appwrite/src/client_io.dart:412:14)
<asynchronous suspension>
#2 Functions.createExecution (package:appwrite/services/functions.dart:63:17)
<asynchronous suspension>
#3 DbBackendClient.sendByteData.<anonymous closure> (package:port_db_backend_client/db/db_client_flutter.dart:307:7)
<asynchronous suspension>
#4 DbBackendClient.sendByteData (package:port_db_backend_client/db/db_client_flutter.dart:296:5)
<asynchronous suspension>
#5 PortDbBackendClient._sendData.<anonymous closure> (package:port_db_backend_client/src/port_db_backend_client_base.dart:93:39)
<asynchronous suspension>
Notes: The function execution appears successful in the Appwrite Console, and I can even see the correct response there. But from the Flutter app, it throws a general_unknown (500) error.
Question: Am I missing something in the response handling, or is this a known issue with the Flutter SDK? Any ideas on how to debug or fix this?
Thanks in advance 🙏

My Flutter code
// and return the response in byte data
// execute for '/kmsgx' in backend cloud function
await _functions
.createExecution(
functionId: _functionId,
headers: {
'Content-Type': 'application/octet-stream',
},
path: '/kmsgx',
method: ExecutionMethod.pOST,
body: String.fromCharCodes(byteData),
)
.then(
(Execution execution) {
print('Function executed successfully: ${execution.responseBody}');
// if it is not UnAuthorized response then responseData with byte data
if (!execution.responseBody.contains('UnAuthorized')) {
// codeUnits will return the LIST<int> data
responseData = Uint8List.fromList(execution.responseBody.codeUnits);
}
},
).onError((error, stackTrace) {
print("error, stackTrace :: \n$error, \n $stackTrace");
});```
Recommended threads
- Appwrite Datetime Fields Display as "N/A...
I'm facing an UI issue on appwrite's collection documents list. A related question is opened by me on stackoverflow. https://stackoverflow.com/questions/796559...
- CORS errors with storage bucket
I have a javascript file in the storage bucket and I used the view endpoint in an `src` attribute of a `<script>` tag. But I am getting the `net::ERR_BLOCKED_BY...
- Oauth2-Error 400Invalid `success` param:...
My code: > await new Account(client).createOAuth2Session(OAuthProvider.Google, 'https://www.mydomain.online/home', 'https://www.mydomain.online'); I ha...
