Getting INTERNAL SERVER ERROR using Admin GraphiQL API

Amichay
Excursionist
31 0 2

Hello,

 

Shopify-Admin-API-GraphiQL version 2021-01 is used.


We are attempting to fetch data of orders for one of our clients and are experiencing difficulties. the request failed and the status is INTERNAL_SERVER_ERROR.
There is a lot of data for this client, and even when we tried to fetch the client data only for one day, we got the same error.

According to your suggestions, we minimized the query as much as we could and also added sortKey:'CREATED AT' to the query, as shown below, but we still get the same error.

 

Query:

mutation {
bulkOperationRunQuery(
query: """
{

orders(query:"(created_at:>'2021-09-25T07:00:00Z' created_at:<'2021-09-25T07:00:00Z') OR (updated_at:>'2021-09-25T07:00:00Z' updated_at:<'2021-09-25T07:00:00Z'),sortKey:'CREATED_AT'")
{
edges
{
node
{
id
createdAt

cartDiscountAmountSet
{
shopMoney
{
amount
}
}
totalDiscountsSet
{
shopMoney
{
amount
}
}
totalPriceSet
{
shopMoney
{
amount
}
}
totalShippingPriceSet
{
shopMoney
{
amount
}
}
totalTaxSet
{
shopMoney
{
amount
}
}

}
}
}

}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}

 

 

Replies 4 (4)
csam
Shopify Staff
154 24 25

Hi @Amichay 

Could you please provide the x-request-id header field value for a recent attempt at this bulk mutation? We can take a look in the logs as there may be more information about the error provided there.

Thanks!

 

CS | 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

Amichay
Excursionist
31 0 2

We attempted to retrieve the order data again using the query shown above, but we still received the INTERNAL SERVER ERROR.

 

x-request-id: 0b608ca7-a1f6-486f-b261-b2c173ec60e5

csam
Shopify Staff
154 24 25

Hi @Amichay 

From what I can see in the logs, it looks like your application already had a bulk operation progress when that call was made. However I believe the error message should be more specific. You can try polling the status of the currently running query with the process described here: https://shopify.dev/api/usage/bulk-operations/queries#option-b-poll-your-operation-s-status This will let you see any jobs which is still in progress. If it is complete it will provide a link to the results.

Regards,

 

CS | 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

Amichay
Excursionist
31 0 2

Hey,

 

The bulk operation you saw in progress is from a request that began after the request that received the internal server error message.

 

We've already polled the status of the currently running query, and it in RUNNING status, until the request encounters an internal error.

 

The following are the last request statuses:

reportStatus {
id: 'gid://shopify/BulkOperation/610237153347',
status: 'RUNNING',
errorCode: null,
createdAt: '2021-11-16T14:04:19Z',
completedAt: null,
objectCount: '0',
fileSize: null,
url: null,
partialDataUrl: null
}

 

{
node(id: "gid://shopify/BulkOperation/610237153347") {
... on BulkOperation {
id
status
errorCode
createdAt
completedAt
objectCount
fileSize
url
partialDataUrl
}
}
}


reportStatus {
id: 'gid://shopify/BulkOperation/610237153347',
status: 'FAILED',
errorCode: 'INTERNAL_SERVER_ERROR',
createdAt: '2021-11-16T14:04:19Z',
completedAt: null,
objectCount: '0',
fileSize: null,
url: null,
partialDataUrl: null
}