algolia / shopify-seo

Script to sync records positions in collections between Shopify and Algolia
7 stars 1 forks source link

Timeouts from Shopify #4

Open ghost opened 3 years ago

ghost commented 3 years ago

Running the script for products ends up timing out due to the following error:

Traceback (most recent call last):
    19: from ./bin/init.rb:56:in `<main>'
    18: from /home/algolia/lib/services/retrieve_collections.rb:8:in `call'
    17: from /home/algolia/lib/services/retrieve_collections.rb:44:in `filtered_collections'
    16: from /home/algolia/lib/services/retrieve_collections.rb:51:in `collections_with_product_ids'
    15: from /home/algolia/lib/services/retrieve_collections.rb:24:in `smart_collections_with_product_ids'
    14: from /home/algolia/lib/services/retrieve_collections.rb:24:in `map'
    13: from /home/algolia/lib/services/retrieve_collections.rb:25:in `block in smart_collections_with_product_ids'
    12: from /home/algolia/lib/services/retrieve_collections.rb:17:in `augment_collection'
    11: from /home/algolia/lib/services/retrieve_collections.rb:17:in `tap'
    10: from /home/algolia/lib/services/retrieve_collections.rb:19:in `block in augment_collection'
     9: from /home/algolia/lib/clients/shopify_api_client.rb:43:in `retrieve_collection_products'
     8: from /usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/base.rb:974:in `find'
     7: from /usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/base.rb:1069:in `find_every'
     6: from /usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/connection.rb:85:in `get'
     5: from /usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/connection.rb:220:in `with_auth'
     4: from /usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/connection.rb:85:in `block in get'
     3: from /usr/local/bundle/ruby/2.5.0/gems/shopify_api-9.2.0/lib/shopify_api/connection.rb:15:in `request'
     2: from /usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/connection.rb:126:in `request'
     1: from /usr/local/bundle/ruby/2.5.0/gems/shopify_api-9.2.0/lib/shopify_api/connection.rb:7:in `handle_response'
/usr/local/bundle/ruby/2.5.0/gems/activeresource-5.1.1/lib/active_resource/connection.rb:159:in `handle_response': Failed.  Response code = 500.  Response message = Internal Server Error. (ActiveResource::ServerError)

I tried lowering the amount to 50 products but still no dice. Thoughts on why this is happening?

aminedhobb commented 3 years ago

Hi @denisatfn , does the error still occur when you launch the script ?

When Shopify responds with 500, it means there is a problem on their end and lowering the amount of products won't have an impact on it. What can be done is rescuing these errors but then some collections will be skipped and not be re-ordered.

ghost commented 3 years ago

@aminedhobb Yep still an issue. We'll report back once we figure out a better implementation for product syncs.