GraphQL API orders import error: INTERNAL_SERVER_ERROR

mellon_collie
Shopify Partner
12 0 2

Hi.

 

About a two weeks ago we started to receive complaints from our users.

 

As Shopify Partner we have developed two apps (https://apps.shopify.com/tableau-connector and https://apps.shopify.com/power-bi-connector-1) that used GraphQL API to export data from Shopify.

We tried to figure out the problem and found out that there is an error during orders export.

When we trying to run a query to import order's data with fields refunds and suggestedRefund:

{
  orders(first: 10) {
    edges {
      node {
        refunds {
          id
        }
        suggestedRefund {
          amountSet {
            shopMoney {
              amount
            }
          }
        }
      }
    }
  }
}

we got this error message:

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: c62488f4-82e0-4316-ab87-a10ab78444c1 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "c62488f4-82e0-4316-ab87-a10ab78444c1"
      }
    }
  ]
}

If we try to run GraphQL bulk operation with the same query, we received a message that contains this information:

"bulkOperationRunQuery":{
   "bulkOperation":{
      "id":"gid://shopify/BulkOperation/5900763232",
      "status":"CREATED"
   },
   "userErrors":[]
}

But couple of minutes later, when we checked bulk operation status we got this message:

"currentBulkOperation":{
   "completedAt":null,
   "createdAt":"2020-04-24T06:20:01Z",
   "errorCode":"INTERNAL_SERVER_ERROR",
   "fileSize":null,
   "id":"gid://shopify/BulkOperation/5900763232",
   "objectCount":"0",
   "query":"{\n  orders {\n    edges {\n      node {\n        refunds {\n          id\n        }\n        suggestedRefund {\n          amountSet {\n            shopMoney {\n              amount\n            }\n          }\n        }\n      }\n    }\n  }\n}\n    ",
   "url":null,
   "status":"FAILED"
}

What is causing this to happen? We were able to run a similar query before and it ran successfully.

0 Likes
_JB
Shopify Staff
Shopify Staff
822 97 178

Hey @mellon_collie,

 

Thanks for bringing this up, I've tested and have been able to replicate the issue on my end. The issue has been raised with our developers, and I'll post back here once I have an update on the fix.

JB | Developer 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

ValentinMercier
Tourist
10 1 0

Hello _JB,

Any update on this one ? I'm facing quite a similar one. 

My request : 

 

mutation {
  bulkOperationRunQuery(
   query: """
    {
      orders(query: "created_at:>='2020-10-13 00:00:00'") {
        edges {
          node {
            id
            name
          }
        }
      }
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

 

 

EDIT : It seems it's a scope/rights issue. I was trying this request in the graphql app, and (I don't know how to change that) this app seems not to have the rights to access orders collection. Am I right ?  

 

0 Likes
_JB
Shopify Staff
Shopify Staff
822 97 178

Hey @ValentinMercier,

We've made a number of changes over the past few months to improve the resiliency and performance of the bulk operations endpoint. That said it's still possible for a query to return an error, so if this happens we recommend making the query outside of a bulk operation to verify. 

If you're seeing a scope issue when using the GraphiQL app, updating the app's scopes should fix that. To update the scopes for the GraphiQL app, you first need to remove the app from your store, and then install it again (you can use this link to reinstall). During install the app will ask you to set the access scopes.

JB | Developer 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

0 Likes