Webhook is failing

helidona
Excursionist
19 0 3

Hi,

I have created a webhook create order where I set the endpoint to call (https), but still receiving webhook is failing.
Here you can find my code:

 

 

 

        $jobData = json_decode($request->getContent());

        OrdersCreateJob::dispatchAfterResponse(
            $jobData
        );

        return Response::make('', 200);

 

 

Warning email from Shopify:

Error: read tcp xx.xx.xx.xx:34696->xx.xx.xxx.xx:443 : i/o timeout



May someone help me why the webhook is failing even after I'm returning a response with status 200 and dispatching the Job in order to response within 5 seconds!



All the best

0 Likes
james-langille
Shopify Staff
Shopify Staff
49 10 12

Hello, @helidona, If webhooks are not responded to quickly, we mark it as a failure so that we can continue serving other apps. Is it possible that although your app responds with a 200 in code, there's some network-level problem or latency that might cause Shopify to timeout on the connection itself? 

Do your webhook subscriptions have the correct URIs, and are those hosts available to receive requests via those URIs?

james-langille | Developer @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
helidona
Excursionist
19 0 3

HI @james-langille,

Well, the URLs are correct, but as far as I noticed this is caused sometimes, and the host is available any time because we have set up our app in web hosting. 
But, I couldn't figure it out that is caused by?! Or am I doing the right way how I am responding (using dispatch Job in order to return within 5 seconds)

Thank you for your help!


0 Likes