Socket hang up issues

Hi, I am using a workflow to update inventory in our shopify through API.
The workflows fetches shipment lines from postgres db and loops over them (Batches of 10 with delay of 100ms) . The loop code calls a function like so "const response = await adjust_item_inventory(shopify_store, access_token, location_id,inventory_item_id,available)" which does the post call to shopify. Most of the times the workflow completes successfully but recently we started receiving more and more exceptions on several calls ("Exception: FetchError: request to https://edikted.retool.com/api/workflow/runQueryForSandboxed failed, reason: socket hang up").

Would love some assistance on this issue.

Thanks,

@taluk,
Can you please export the json file for your workflow so I can take a look? Are you using a python code block or js?

Thank!

Hi @lindakwoo ,

Thanks for reaching out.
PFA the workflow json (took out credentials from it)

The loop itself is using a js block to do the job . There is one python data prep block in the workflow but it can be moved to js relatively easy and doesn't seem to create any issues.
Thanks,
upload_store_shipment - loop (1).json (129.0 KB)

@taluk,
This socket hang up error is a known bug that our engineering team is working on. We THINK it has to do with python code and the workaround thus far has been to change your code from python to js, but as you stated, you are already using js for the actual loop. It MAY still be related to your python code, however. Until we get this fixed, can you try converting all your python code to js and see if it fixes your problem?

Thanks very much.

Hi @lindakwoo ,

I will do the change and monitor the workflow.

Thanks,

Hi @lindakwoo,

I moved the workflow to JS only and the error reproduced again :frowning:

okay @taluk, Can you provide me with the the workflow id on the js-code workflow that has this error?

If you click on the Run history tab in the bottom left hand corner of your workflow, you can find it:

I will let our engineering folks know this is not isolated to python code only. Thanks!

Thanks @lindakwoo.

The workflow with the failures is : 3b9671f3-42b7-419d-93ed-c1d136735d20

LMK if you need any other details.

Thanks,

@taluk,
Can you also send me the exported json for your latest js-coded workflow and a screenshot of the error you are getting? thanks!

PFA the exported workflow after the change
upload_store_shipment - loop.json (137.6 KB).

As per the error - I'm handling the exceptions in the code so this is from exception catch:
"Exception: Error: request to https://XXXXX.myshopify.com/admin/api/2024-04/inventory_levels/adjust.json failed, reason: "

In the workflow logs I'm seeing : "
Error evaluating adjust_item_inventory: Unexpected error occurred while running query"

@taluk,
Are you still getting the specific "socket hang up" error?

@lindakwoo I'm also getting this issue but within the workflow loop using a REST API Resource

I tried uploading the json but it's not letting me since I'm a new user

@Salar_Hajimirsadeghi,
You can send me the json file at my email address: lindakwoo@retool.com

Is it the same socket hang up error? Can I get a screenshot please? Do you have any python code blocks in your workflow?
thanks!