0

My Laeravel (5.5) site is currently in production and everything is fine but expected to one function. In this site we use various api s from different vendors and we do use their products in our site. The thing is there is a function to add other vendors products. The problem occures at that point when our admin try to add a product it gives below error.

error

This is the code that affect to the above error. We haven't change anything for last few weeks in this site.

$body = curl_exec($ch);
    $errno = curl_errno($ch);
    if ($errno !== 0) {
        throw new Exception(sprintf("Error connecting to CommissionJunction Token : [%s] %s", $errno, curl_error($ch)), $errno);
    }

    $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($http_status >= 400) {
        throw new Exception(sprintf("CommissionJunction Error Token  [%s] %s", $http_status, strip_tags($body)), $http_status);
    }
    return json_decode($body);
}

I have cleared all the cached via below code

After clearing caches it worked as previous for few minutes and now its happening again. Clearing cache doesn't work any more.

So could anyone please help me on this.

Nipun Tharuksha
  • 2,496
  • 4
  • 17
  • 40
  • 1
    It doesn't seem an application problem, but an error thrown from the other API since the error 503 it's a "Service Unavailable" error. Have you tried to check if the other part is active and available? With something like postman – IlGala Oct 14 '19 at 09:26
  • yes when I do relevant operations respect to that function manually to the DB. Everything working fine. Even api fetch all products related to product codes. – Nipun Tharuksha Oct 14 '19 at 09:29
  • 1
    This might be helpful https://stackoverflow.com/questions/57525585/error-connecting-to-commissionjunction-token-60-ssl-certificate-problem-una – Casper Oct 14 '19 at 09:34
  • @Casper thanks for the help – Nipun Tharuksha Oct 14 '19 at 09:45

1 Answers1

1

Maybe it's the vendor api breaks occasionally, you can feedback to them.

503 SERVICE UNAVAILABLE

ta_shuo
  • 101
  • 5