Man NguyenOriginal post
Android Developer
My function responds a small ogg audio data, the console showed successful executions, but I got a server error from the client sdk (Android/Kotlin):
JSON
{ "message" : "Server Error", "code" : 500, "type" : "general_unknown", "version" : "1.7.4"}Function side (Go 1.23):
Go
// audio is a non-nil []byteContext.Log("Audio generated:", len(audio), "bytes")return Context.Res.Binary(audio)The console logged "Audio generated: 2779 bytes" with status code 200. However, my client received an AppwriteException described above.
I tried to encode the binary into base64 and it worked! But this is not the solution.
Thank you!
Summary
Developers are encountering a server error 500 'general_unknown' when responding with raw binary data from a Go server function, despite successful executions. Encoding binary data into base64 temporarily resolves the issue but isn't the ideal solution.
Solution: Consider potential data format issues when handling raw binary data responses.