Shopify Bulk Query Internal Server Error ( When trying to fetch zip in customer addresses)

If I run the following query

mutation {
  bulkOperationRunQuery(
    query:"""
{
    customers(reverse:true) {
        edges {
            node 
            {
                id
                firstName
                lastName
                email
                phone
                amountSpent {
                    amount
                    currencyCode
                }
                averageOrderAmountV2 {
                    amount
                    currencyCode
                }
                addresses(first: 3) {
                    phone
                    firstName
                    lastName
                    province
                    provinceCode
                    zip
                    city
                    countryCodeV2
                }
                createdAt
                updatedAt
                numberOfOrders
                tags
                displayName
                validEmailAddress
                verifiedEmail
                locale
            }
        }
    }
}
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

X-Request-Id of above is 8171846e-09a6-4d36-ae54-ec7fbf1aab50

It fails with

{
    "data": {
        "node": {
            "url": null,
            "status": "FAILED",
            "id": "gid://shopify/BulkOperation/2585703612734",
            "partialDataUrl": null,
            "errorCode": "INTERNAL_SERVER_ERROR",
            "createdAt": "2022-11-22T14:28:07Z",
            "objectCount": "0",
            "fileSize": null
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 1,
            "actualQueryCost": 1,
            "throttleStatus": {
                "maximumAvailable": 1000.0,
                "currentlyAvailable": 999,
                "restoreRate": 50.0
            }
        }
    }
}

The X-Request-Id is 2ad4fafd-d05f-45c4-aa32-7b8ce3c3cd0f

The error goes away if I remove zip from addresses(). This error happens if I add zip, address1 or address2 to the addresses() of customer

Hope I’ve provided enough info to debug!

Hi @rohanrajpal :waving_hand:

Thanks for including the request ID, it was really helpful to determine the cause here! Public apps using version 2022-10 are subject to the protected customer data requirements. I’d recommend checking whether your app has been granted the scopes to access customer addresses.

Hope that helps!

It is! I can fetch the addresses in normal requests, its just the bulk query that is failing

If it werent the case I guess the error would have been “protected something error” instead of “internal server error,” as usually internal server error means error wasnt handled properly by the server

The logs from the X-Request-ID in your post, there are indications that this may be an access issue. If you would kindly contact us here with your authenticated partner account, we would be happy to share more details.

Just checked, it is indeed because of protected access to address fields. For address field it says “Your access to this field isn’t approved at this time. Check your email for more information”

But on checking my email all I have is one email saying my access was approved ?

Either shopify folks forgot to send me the reason or there is a bug. Screenshots attached