gatsbyjs/gatsby · error

bulkOperationFailed

bulkOperationFailed

Error message

${e.field ? `${e.field.join(`.`)}: ${e.message}` : e.message}

What it means

makeSourceFromOperation maps Shopify bulkOperationRunQuery userErrors into a panic. Each userError's field path and message are joined (field.path: message) so the rejected variable or query fragment is identifiable. It means Shopify refused to start the bulk operation, e.g. an unsupported query or invalid variable.

Solutions

  1. Check the logged field path and message to find the invalid data returned by the Shopify bulk operation.
  2. Verify your Shopify API version and store data; re-run sourcing after fixing the offending records.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-source-shopify/src/source-from-operation.ts:45 when the library encounters an invalid state.

Common situations: Occurs when a Shopify bulk operation returns field-level validation errors. Inspect the reported field and adjust the query or shop data accordingly.


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/de5df7a5a44d2c45. Report an issue: GitHub.

Appendix: source

Thrown at packages/gatsby-source-shopify/src/source-from-operation.ts:45

    const operationTimer = reporter.activityTimer(
      `source ${lastBuildTime ? `changed ` : ``}shopify ${op.name}`
    )

    operationTimer.start()

    try {
      if (isPriorityBuild(pluginOptions)) {
        await cancelOperationInProgress()
      } else {
        await finishLastOperation()
      }

      const {
        bulkOperationRunQuery: { userErrors, bulkOperation },
      } = await op.execute()

      if (userErrors.length) {
        reporter.panic(
          userErrors.map(e => {
            const msg = e.field
              ? `${e.field.join(`.`)}: ${e.message}`
              : e.message

            return {
              id: errorCodes.bulkOperationFailed,
              context: {
                sourceMessage: `Couldn't initiate bulk operation query`,
              },
              error: new Error(msg),
            }
          })
        )
      }

      const resp = await completedOperation(bulkOperation.id)

View on GitHub (pinned to 8b06340921)