currentBulkOperation stuck on "EXPIRED"

Topic summary

A developer encountered an issue where currentBulkOperation with type MUTATION consistently returned a status of “EXPIRED” from September 8th, regardless of which mutation was running. The operation showed:

  • Status: EXPIRED
  • Object count: 0
  • Completed almost immediately (within 5 seconds)
  • No file size, URL, or partial data URL

Key observations:

  • stagedUploadsCreate and the form POST to Google Cloud Storage both worked correctly
  • Querying currentBulkOperation with type QUERY worked fine
  • The issue occurred only on some client accounts, not the developer’s own account

Resolution: The developer identified a coding error where they had mistakenly switched the polling routine with the upload routine, causing the system to wait for the last upload event from September 8th instead of the current operation.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

Hi,

I’m currently experiencing an unusual behaviour from the Shopify GraphQL API. I’m trying to upload a few hundred products using the bulk import API. In particular,

However, once I start polling the upload status with the currentBulkOperation and the following query,

query {
 currentBulkOperation(type: MUTATION) {
    id
    status
    errorCode
    createdAt
    completedAt
    objectCount
    fileSize
    url
    partialDataUrl
 }
}

I keep receiving this response:

{
    "data": {
        "currentBulkOperation": {
            "id": "gid://shopify/BulkOperation/3439961145630",
            "status": "EXPIRED",
            "errorCode": null,
            "createdAt": "2023-09-08T13:05:35Z",
            "completedAt": "2023-09-08T13:05:40Z",
            "objectCount": "0",
            "fileSize": null,
            "url": null,
            "partialDataUrl": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 1,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 999,
                "restoreRate": 50.0
            }
        }
    }
}

which seems to be the actual status of more than a week ago. I don’t know why, but the MUTATION status seems to be stuck on the 8th of september no matter which mutation I’m running. On the other hand, if I run a currentBulkOperation on type “QUERY”, it works fine:

{
    "data": {
        "currentBulkOperation": {
            "id": "gid://shopify/BulkOperation/3464387232030",
            "status": "COMPLETED",
            "errorCode": null,
            "createdAt": "2023-09-20T07:29:04Z",
            "completedAt": "2023-09-20T07:29:22Z",
            "objectCount": "5149",
            "fileSize": "657664",
            "url": "<long url>,
            "partialDataUrl": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 1,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 999,
                "restoreRate": 50.0
            }
        }
    }
}

This behavior doesn’t occur on my account, but on the accounts of some of our clients, so it’s even harder to debug.

Thank you very much for your time.

Nevermind, my bad. I mistakenly switched the polling routine with the upload routing in my code. Thus, I was actually waiting for the last upload event which happened, indeed, on the 8th of september. This thread can be marked as solved.