mutation {
bulkOperationRunQuery(
query:
"""
{
draftOrder(id: "gid://shopify/DraftOrder/${########}") { //####### = draft order id
lineItems() {
edges {
node {
product {
id
collections() {
edges {
node {
id
}
}
}
tags
}
id
}
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
We are having the same issue. Here is an example bulk operation that is just stuck running for a very long time:
"currentBulkOperation": {
"id": "gid://shopify/BulkOperation/48480682046",
"status": "RUNNING",
"errorCode": null,
"createdAt": "2020-07-27T14:49:53Z",
"completedAt": null,
"objectCount": "0",
"fileSize": null,
"url": null,
"partialDataUrl": null
}
Hey @Matt_Goodwin
Can you give us a more recent example of this happening (preferably this week if possible)? A request ID or even the bulk query ID would work.
Kevin_A | 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
Hey, this is happening for me today, I have used several times the same query to test and was okay, but after some time the query did returned anything, and even cancelling the current query and querying again none Bulk operation works right now.
Here is the operation: info:
results: #<OpenStruct data=#<OpenStruct bulkOperationRunQuery=#<OpenStruct bulkOperation=#<OpenStruct id="gid://shopify/BulkOperation/66034466891", status="CREATED">, userErrors=[]>>, extensions=#<OpenStruct cost=#<OpenStruct requestedQueryCost=10, actualQueryCost=10, throttleStatus=#<OpenStruct maximumAvailable=1000.0, currentlyAvailable=990, restoreRate=50.0>>>>
And this it the query:
mutation {
bulkOperationRunQuery(
query: """
{
products {
edges {
node {
id
title
publishedAt
handle
featuredImage {
transformedSrc(maxWidth: 200, maxHeight: 200)
}
images {
edges {
node {
id
transformedSrc(maxWidth: 200, maxHeight: 200)
}
}
}
options {
id
name
position
values
}
variants {
edges {
node {
id
title
price
position
inventoryPolicy
compareAtPrice
image {
id
transformedSrc(maxWidth: 200, maxHeight: 200)
}
inventoryItem {
tracked
inventoryLevels {
edges {
node {
available
}
}
}
}
}
}
}
}
}
}
}
"""
) {
bulkOperation {
id
status
}
userErrors {
field
message
}
}
}
Hey @Groon
I can see that the bulk operation linked is currently still showing a status of "RUNNING":
gid://shopify/BulkOperation/66034466891
Based on the logs it looks like you tried to recreate the bulk operation a few times and got throttle errors that there was already a bulk operation running. I just polled the status of that bulk operation and successfully got a response:
{
node(id: "gid://shopify/BulkOperation/66034466891") {
... on BulkOperation {
id
status
errorCode
createdAt
completedAt
objectCount
fileSize
url
partialDataUrl
}
}
}
{
"data": {
"node": {
"id": "gid://shopify/BulkOperation/66034466891",
"status": "RUNNING",
"errorCode": null,
"createdAt": "2020-09-09T13:56:02Z",
"completedAt": null,
"objectCount": "0",
"fileSize": null,
"url": null,
"partialDataUrl": null
}
},
"extensions": {
"cost": {
"requestedQueryCost": 1,
"actualQueryCost": 1
}
}
}
I would suggest waiting till this operation is complete before attempting to run another one. You should be able to successfully query its status using the query above.
Kevin_A | 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
Thanks for the answer, but it seems like a BIG problem that the operation is still running after almost 1 hour and I can't create another one o.O
My app depends on this operation to work fine, it needs to just work, if it takes 1 minute it's too long but is acceptable, but as it is right now is not reliable.
@Kevin_Asorry for the delay. Here are some recent x-request-ids:
- c0d698d6-8a7b-4aec-ba6b-f2979dd1ea44
- c5a1d9c1-74fd-40a6-8df4-fa6de2306a59
- cd16ff16-991b-4227-897d-d06a78ec60ce
Just as a note our app cancels bulk requests after a certain timeout period, so ultimately these requests might have been cancelled after a few minutes of no response. This is something we added in after the problem first occurred since we wanted to try the request again. Hopefully that doesn't get in the way of your debugging.
Thanks!
Hey @Matt_Goodwin
Thanks for the request IDs you provided. Based on what you provided everything appears to be functioning correctly. In regards to bulk operations, it is possible to experience a varying completion time because of how exponentially the data can grow from connections. In cases where an operation automatically cancels itself, it could be related to an error completing the operation but we would need a request ID within our logs retention period to investigate further.
Kevin_A | 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
User | Count |
---|---|
12 | |
11 | |
10 | |
8 | |
8 |