Internal Server Error on bulkOperationRunQuery when trying to get products

andreagiache
Visitor
2 0 0

Hi how are you? 

We are receiving an internal server error when trying to get all the products with the Bulk Operation. 

This is our request:

 

mutation {
    bulkOperationRunQuery(
        query: "" "" ""{
        products(query: "" status: ACTIVE, DRAFT "") {
            edges {
                node {
                    graphId: id
                    title
                    productId: legacyResourceId
                    featuredImage {
                        originalSrc
                    }
                    variants {
                        edges {
                            cursor
                            node {
                                graphId: id
                                product {
                                    graphId: id
                                    productId: legacyResourceId
                                }
                                image {
                                    originalSrc
                                }
                                title
                                sku
                                barcode
                                variantId: legacyResourceId
                                inventoryItem {
                                    graphId: id
                                    harmonizedSystemCode
                                    countryCodeOfOrigin
                                    inventoryItemId: legacyResourceId
                                }
                            }
                        }
                    }
                }
            }
        }
    }
        "" "" "") {
        bulkOperation {
            id
            status
        },
        userErrors {
            field
            message
        }
    }
}

 

 

And this is the response:

 

{
    "data": {
        "currentBulkOperation": {
            "id": "gid://shopify/BulkOperation/1434895024281",
            "status": "FAILED",
            "errorCode": "INTERNAL_SERVER_ERROR",
            "createdAt": "2022-06-06T19:43:36Z",
            "completedAt": null,
            "objectCount": "5332",
            "fileSize": null,
            "url": null,
            "partialDataUrl": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 1,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 999,
                "restoreRate": 50.0
            }
        }
    }
}

 

 

We are using the same query with all of our merchants and until now it is failing only with one. All others work fine. So I guess our query is all right.

 

Please help!

 

Regards!

 

Replies 4 (4)

KB77
Shopify Staff
59 6 11

Hi @andreagiache 

If the bulk operation has been cancelled by Shopify, this usually indicates the job is stalled and not progressing. In the event of an INTERNAL_SERVER_ERROR this likely indicates a DB performance issue. If you have a x-request-id from the error response you can share we can look for it in the logs and it may provide further insight. Or if you can replicate it elsewhere and share that x-request-id that is also helpful. 

KB77 | API Support @ 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

andreagiache
Visitor
2 0 0

Hi, we reproduced it again, the x-request-id 95ed5c6d-c1e4-47dc-80ce-01d292edb381

Thank you!

KB77
Shopify Staff
59 6 11

Hi @andreagiache , We took a look at the logs and it does show a Timeout error. It would be recommended to slowly simplify the request  until it returns the desired results or limit the request to return smaller subsets of the data to prevent it encountering a roadblock/timeout when it encounters abnormal data. e.g. use created_at to define a subset  products(query: "created_at:>=2020-01-01 AND created_at:<2020-05-01"). 

Or choose parameters from https://shopify.dev/api/admin-graphql/2022-04/queries/products#argument-products-query, to define subsets. 

KB77 | API Support @ 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

nickcaps
Shopify Partner
18 0 3

@KB77 could you look into the errors for the two bulk operation request id's below for me? I posted these before in a separate topic, but I never got a response there.

 

  • 29228100-699f-4085-97e8-7e154f1bedeb
  • ecd795bd-b5de-4bac-8338-8f304a391bf3
Shopify Specialist & App Developer