I have a cloud function using python and I'm sending in a string which is then parsed using json.loads. Today for some reason, whenever I sent a string, I get a 500 internal server error. I'm able to run the cloud function fine without passing in any values. I'm not sure what's happening...
Do you can try to redeploy such function?
Yeah I redeployed a few times and I'm still getting the error.
Heyy. Do I understand correctly this seems to be the problem for you?
import json
data = json.loads(req.body_raw)
Also, can you please share your project ID? It helps us to look at server errors specifically in your project
Hey @D5 , I redeployed yesterday's cloud function and it worked fine!
Hey @Meldiron , I have it as req.body instead of req.body_raw! Also, I deployed the function with a small change this morning. Do you reckon that might be the issue because of the version changes? I thought cloud is on 1.5.x and not 1.6.x yet
req.body
is a bit "magical", it sets value based on content-type header. If it says JSON, it tried to parse. If it's some of binary formats like PDF or MP3, it gives binary. And String should be a fallback.
Do you know what type of body content type is being sent to a function? If we know exact header I can check expected behaviour on our end.
This can possibly be related to 1.6 upgrade. We are here to give you all the helping hand you may need to resolve this quickly. We are also active to do any bug fixes nessessary on our end.
Alternatively, if you need a quick fix, using those specific types you expect could resolve the bug for you:
String: req.body_text
JSON: req.body_json
Bianry: req.body_binary
- if you used to receive binary, there might be some more issues with type, but error message should be very clear if that happens, and it should be a matter of 1 simple convert
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- Our Appwrite organization is suspended
Please give support regarding this , no app is working now , please solve my issue and give support , no one is replying in message section or email.
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...