Hi,
I have a PHP app which is deployed using Docker (Caprover setup, but that does not matter from what I understand).
I have a webhook configured, which has been failing a lot lately. It sometimes finishes itself as well.
I tried moving all my steps inside a Try/Catch block and capture the error, but no luck so far.
I can see from Portainer logs that the request has been received on the server & the response is 500.
How do I see what the actuall error is? Its a production app and I have no idea why is the error being generated in the first place… while few hooks are also getting processed correctly.
I have tried setting Beeceptor in parallel with my app’s URL, and while Beeceptor just shows regular POST request with body & headers… my app is failing to process it all.
Could the size of the request POST body be a cause of this issue? Its 40-55K+ characters in the cases where its failing. I am able to store this information in DB, and it has almost filled up the “text” field in my MySQL DB which has a length of ~65K characters.
While I was writing this, the request size has increases even more, and now the Try/Catch is working just to record the $_ERROR value that data is too long for the column.
I guess every failed request from the webhook provider is accumulating newer requests into the next hook - increasing the POST body size.
I don’t know what kind of data you have, but seems you have to update the database to support the data size or truncate the data so it will fit in the column. In MySQL you could use the MEDIUMTEXT or LONGTEXT to support more then 64K characters.
I just read the POST body, and insert data in the DB.
Insert log with start time & POST body.
Check condition that there should be some types of headers available & POST should have id value.
Continue with rest of the steps of inserting in DB.
At last, update the log with completed time.
In case of error, record $_ERROR in log.
When the hook processing works, I can see point 4 working. So I know the setup works.
But when I see 500, only step 1 runs. There is no Catch log entry.
This. I have setup one of my SA as URL for webhook.
When the request comes in, it mostly fails with 500.. And randomly gets processed as well with 200.