#victoria.fabris - webhook 500
1 messages ยท Page 1 of 1 (latest)
Have you checked your server logs to see if any internal errors are being thrown by your webhook endpoint code?
And do you know about how long your handler is taking to process these requests? You have about 30 seconds to respond, so if it is taking longer than that, that could be the culprit
im receiving this
when i just take out the pieces of code that takes an action depending on the event type, this happens
Can you step through the code that you have commented out and see if an error is thrown?
Server libraries often respond with 500s if there is an uncaught error in your code
ok, im going to do some checks along the code to see if some error is thrown
maybe im getting some error trying to get the subscription id throug the event
Hello ๐
Taking over for Pompey here as they need to step
Yeah, that would cause the code to throw 500
in python, is this the right way to do that?
im constructing the event with the stripe.Webhook.construct_event
and then im doing
subscription_id = event.data.object.id
can you try printing it out before you access the properties?
print the event?
I'd start from event.data and then .object and then the .id
ok, im gonna do that
ok, so now that i correct the way i was getting the subscription id from the event, i still receiving some 500 error
i took out the piece of code where i send a push notification to the user, and then i received a http 200
Cool. So seems like the push notification is causing this 500.
when i take out the notification
I still do see some 500s
You'd likely want to test one line at a time and make sure it isn't throwing any exceptions
ok, going to do that
thank you in advance, i see that im going to find this error!
NP! ๐ Good luck