Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Internal Server Error on Bulk publishing

Internal Server Error on Bulk publishing

DanubioBlu
Shopify Partner
13 0 6

Hi

i have to publish a product

gid://shopify/BulkOperation/3300162208050.

i have use this approch with two strategies:

 

1) Fields on Products create (deprecated)

 "productPublications": [{ "publicationId": str(publication_id) }],

2) or publishablePublish bulk mutation

 

in both cases with some data the result is always a

'id': 'gid://shopify/BulkOperation/3300162208050'
'type': 'MUTATION'
'status': 'FAILED'
'errorCode': 'INTERNAL_SERVER_ERROR'
'url': None
'rootObjectCount': '1'

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1453 239 535

Hi @DanubioBlu 👋

 

I would recommend trying the singleton mutation first to isolate any issues with the input variables, mutation format, access, etc. The error messaging from the a single mutation will provide more granular detail than the bulk operation failure. 

Below is an example mutation to publish a product:

mutation ($id: ID!, $input: [PublicationInput!]!) {
    publishablePublish(id: $id, input: $input) {
        publishable {
            ... on Product { id }
        }
        userErrors {
            field
            message
        }
    }
}

with variables:

{
    "id": "gid://shopify/Product/123",
    "input": {
        "publicationId": "gid://shopify/Publication/321"
    }
}


The bulk mutation JSONL file for the same mutation should be formatted like this:

{"id": "gid://shopify/Product/123", "input": {"publicationId": "gid://shopify/Publication/321"}}
{"id": "gid://shopify/Product/456", "input": {"publicationId": "gid://shopify/Publication/654"}}

 

Hope that helps!
 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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