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
- Unable to signup to appwrite cloud
When attempting to create an online cloud account on appwrite.io, I get the following message : "This email address must already be in its canonical form. Pleas...
- Email address must be in its canonical f...
Hello, Recently I was trying to signup with my GitHub account with appwrite account for availing the student benifits but while trying to signup I saw such erro...
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...