Getting PHP Error Logs in Docker

Did that too, its empty… Same as nginx.

Doesn’t Beeceptor shows you the 500 error when proxying to your API?

Not sure what you mean by that.

I have tried setting beeceptor as webhook url in the 3rd party service, and then used the captured post/headers to call my SA API directly from postman. This did not result in 500.

But when SA processed the same from the webhook directly, it results in 500.

I’m asking if you’re using the following Beeceptor feature:

From my understanding, this would register the 500 error, which you’d be able to see on Beeceptor’s dashboard

1 Like

I did not know about this. Thanks for sharing.
Unfortunately, the input for Proxing just takes a domain name, and not the full API URL. So its not working.

@patrick I have captured a POST body where Wappler is failing. I don’t know what is wrong with this though. The JSON is correct as well.

I ran a test of the same on a NodeJS project, and was finally able to see an error, which my current PHP project was failing to return.

On my production server, the error is 500. While on my local machine, the error is 400 on both NodeJS & PHP.

Here’s the error:

This topic is about being able to read this error in PHP. So still need a solution for that.
I am creating a separate post for this parsing error.

Started today again after a small holiday, so sorry for the delay. The error is because of invalid json. I see double \, so maybe it is double escaped.

Welcome back. :slight_smile:

The double slash is from the NodeJS console output. The original data has just 1 slash.
I assume you have seen the original body in the separate post I have created for this.

The purpose of this post is to find a way within Docker to be able to see this PHP error, which I am sure is being generated there as well. If you could please help with that, it would be great. @patrick

@patrick If you could please help with this, I might be able to find out why the webhook request is failing in Wappler, but working fine when called directly.

Do you know the exact headers that are used with the request from the webhook?

{
  "content-length": "93819",
  "user-agent": "Shopify-Captain-Hook",
  "accept": "*/*",
  "accept-encoding": "gzip;q=1.0,deflate;q=0.6,identity;q=0.3",
  "content-type": "application/json",
  "x-shopify-api-version": "2021-04",
  "x-shopify-hmac-sha256": "4k/VxxxxxxxxxxvuKZgbE0DJkL/ix4=",
  "x-shopify-product-id": "846169",
  "x-shopify-shop-domain": "xxxxxx.myshopify.com",
  "x-shopify-topic": "products/update",
  "x-shopify-webhook-id": "d9bd87bf-44d8-438a-a66b-xxxxxxxxx"
}

Nothing special in the headers, does the content-length match exactly with the length of the json being send?

Yes.
I tested by setting webhook to both my app and beeceptor.
The app failed, but when I ran the app SA with headers and body captured in beeceptor directly, it worked.

@patrick Bump. This is still an issue. My webhook is disabled for about a month now.

If you’re inclined to dive deeper into this issue, I would suggest to setup XDebug tracing

Configure XDebug to begin tracing upon request:
https://xdebug.org/docs/all_settings#start_with_request#trigger

Set webhook URL to include $_GET[‘XDEBUG_TRIGGER’]

This way when webhook calls your app, XDebug will write to disk the functions called so you can see where the error is being thrown and what’s before that

Can you test if this update helps.

Request.zip (1.2 KB) Unzip to dmxConnectLib/lib/core.

It seems to be working - sort of. Logs in docker have not changed.
I can now at least see a new error being logged in the DB because its being captured via the TRY CATCH block.
Although, I don’t understand what the error is.

"Object of class stdClass could not be converted to string"

It doesn’t know how to convert some object to a string. You are trying to use some object somewhere as a string and that throws an error.

But its working for some hook requests, and failing for most.
The code is the same, and I assume the request format is too.

From what I understand, earlier, it could have been this error that was not being captured even by TRY-CATCH. The first step is where its probably failing, but I can’t say for sure. Its a condition which checks for $_POST & $_HEADER values.

Any suggestions?

I don’t think the condition is the problem, you are somewhere trying to use a variable as a string while it is actually an object. What do you do with the data of the webhook? One of the properties you are using is from the incorrect type.