Not exporting products to square

Exporting products to square from codeigniter was working fine. I used guzzle to export image to square, then attach that image_id to catalog object. It was working fine earlier. i was able to export more than 50 products some months back. But now after around 15-20 products, the function breaks. I think it is getting time out. Some times i am able to export 20, sometimes it breaks after 15. How can I fix it

Are you receiving any errors from our APIs? What’s your application id?

I couldn’t see any error. In console it showed error 500. If needed, i can share the code

Thanks

Application_id: sq0idp-L-2FiwDHoyvC8WKIjgmpcA

When is the last time it happened? In the past 3 days I only see one error with that application and it was when calling BatchDeleteCatalogObjects about it being rate limited (too many requests back to back).

No…I tried many times today. For 35 products, it exported. For 43 products, it exported once. But crashed many times.

What endpoint are you using, and what is it returning? Can you provide the full error that Square returns?

Now I tried 4 times. First time it exported 43 products. Next time it crashed. Then i tried for 35 products which was working some hours back. But now it crashed. Then for 25 products, it worked.

I used “/v2/catalog/images” api with guzzle for exporting images and then used $catalogApi->batchUpsertCatalogObjects for exporting.

It is not returning to catch{} so i can’t see the error. It shows the error 500 in console after around 2 minutes.

$response_info in callApi() in ApiClient.php for crashed export and for suceess is given below. There were 32 products in the body of batch-upsert at the time of crash

[url] => https://connect.squareup.com/v2/catalog/batch-upsert [content_type] => [http_code] => 0 [header_size] => 0 [request_size] => 0 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0 [namelookup_time] => 0 [connect_time] => 0 [pretransfer_time] => 0 [size_upload] => 0 [size_download] => 0 [speed_download] => 0 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => -1 [starttransfer_time] => 0 [redirect_time] => 0 [redirect_url] => [primary_ip] => [certinfo] => Array ( ) [primary_port] => 0 [local_ip] => [local_port] => 0 [http_version] => 0 [protocol] => 0 [ssl_verifyresult] => 0 [scheme] => [appconnect_time_us] => 0 [connect_time_us] => 0 [namelookup_time_us] => 0 [pretransfer_time_us] => 0 [redirect_time_us] => 0 [starttransfer_time_us] => 0 [total_time_us] => 0

[url] => https://connect.squareup.com/v2/catalog/batch-upsert [content_type] => application/json [http_code] => 200 [header_size] => 381 [request_size] => 310 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 0.819111 [namelookup_time] => 0.00029 [connect_time] => 0.024674 [pretransfer_time] => 0.060678 [size_upload] => 49959 [size_download] => 63644 [speed_download] => 77709 [speed_upload] => 61000 [download_content_length] => -1 [upload_content_length] => 49959 [starttransfer_time] => 0.060683 [redirect_time] => 0 [redirect_url] => [primary_ip] => 74.122.190.68 [certinfo] => Array ( ) [primary_port] => 443 [local_ip] => 162.144.181.24 [local_port] => 16738 [http_version] => 3 [protocol] => 2 [ssl_verifyresult] => 0 [scheme] => HTTPS [appconnect_time_us] => 60422 [connect_time_us] => 24674 [namelookup_time_us] => 290 [pretransfer_time_us] => 60678 [redirect_time_us] => 0 [starttransfer_time_us] => 60683 [total_time_us] => 819111

I do not see any 500 errors being returned by us. All of the BatchUpsertCatalogObjects and CreateCatalogImage responses were 200 for your application, so it seems like it’s not even making it to Square’s servers. I checked in with our Catalog team and they confirmed what I’m seeing (no 500s, only 200s). It sounds like it’s erroring out before fully hitting our servers somehow.

I am using the same code and same products for exporting. Sometimes export is working perfectly fine. in crashed cases, If the same code is not hitting your server, how can I fix it. My server is hostgator

It’s hard to say how to fix it since it’s not on our side, it’s a bit out of our scope. Are you able to see your any server logs within Hostgator that could point to what is happening?