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
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- AppwriteException - Transaction with the...
I am using "node-appwrite" module and I have successfully created transaction id but when passing it to tablesDB.createRow function with some other required dat...
- unlike any other provider, your sites DN...
your nameservers dont work with a funny little CNAME error, which is a weird bug but thats what you get when you try to be the kitchen sink, funny errors.