Random Image Error Upload - GraphQL - DNS

fedeb
Excursionist
18 1 5

Hi, I get random errors on creating Collections or Products with the GraphQL API:

 

Errors: 

 

1) Create collection : "Image upload failed. Image https://images.schoolstore.jostens.com/1465339-FULL.png failed to download."

The Image has correct format.

2) Product creation some variants are created with No Image and not error throw.

 

It is random because I can detect in my logs that it failed, but then I run the same mutation and works with Postman for example.

 

1) I'm creating like 20 collections at the same time, and maybe 1-5 are failing with this random error.

 

2) Recently I move the development environment to a new environment for Production, the domain name of the host that this images are saved is new "images.schoolstore.jostens.com" , could be that you have some delay and it takes days to have in your system propagated this host domain?

 

3) In my old environment with host "xxxxxx.cloudfront" was working fine with no errors. (same configuration that this new host).

 

Can you help me please.

 

 

Complete Error:

 {                        "extensions":Extensions{cost = 'Cost{throttleStatus = 'ThrottleStatus{restoreRate = '100.0',currentlyAvailable = '1990',maximumAvailable = '2000.0'}',requestedQueryCost = '10',actualQueryCost = '10'}'},                         "data":Data{collectionCreate = 'CollectionCreate{userErrors = '[{field=null, message=Image upload failed. Image https://images.schoolstore.jostens.com/1465339-FULL.png failed to download.}]',collection = 'null'}'},                         "errors":null}

Mutation Collection:

mutation collectionCreate($input: CollectionInput =
{
    descriptionHtml: "<div class=\"heading-divider heading-divider--long\"></div>\n<div>  </div>\n<div class=\"container\">\n<div class=\"one-third column text-center first\"><img src=\"https://images.schoolstore.jostens.com/1465339-FULL.png\" width=\"200px\" /></div>\n<div class=\"two-thirds column text-center second\"><center>\n<h1>West Grove Pennsylvania Red Devils </h1>\n<br /><br /> Avon Grove Charter  apparel is now available! Select from the various styles and colors of the finest in school Spiritwear. Top brands and quality printing or embroidery... You will look great on the field or in the stands. <br /><br /></center></div>\n<div style=\"display:[collection-list-display];\">[collection-list]</div></div>\n<br /><br />\n<div class=\"heading-divider heading-divider--long\"></div>",
    title: "West Grove Pennsylvania Red Devils",
    handle: "West Grove Pennsylvania Red Devils-1579801875676",
    products: [],
    image: {
        src: "https://images.schoolstore.jostens.com/1465339-FULL.png",
        altText: "logo-school",
    }

}) {
    collectionCreate(input: $input) {
        collection {
            id
            title
            handle
            descriptionHtml
        }
        userErrors {
            field
            message
        }
    }
}

 

Replies 4 (4)

hassain
Shopify Staff (Retired)
624 104 187

Hey @fedeb ,

 

In order to best help investigate this issue for you, could you provide the value of the X-Request-ID header from the API error response from Shopify? This will help 

 

A common reason why image uploading might fail is if Shopify times out when downloading the image from its hosted server. This could be because the image file size is too big, or because the server it is hosted on is too slow to retrieve the file. You can try re-running the mutation or making the file faster to download and see if that helps resolve the error

 

To learn more visit the Shopify Help Center or the Community Blog.

fedeb
Excursionist
18 1 5

@hassain wrote:

Hey @fedeb ,

 

In order to best help investigate this issue for you, could you provide the value of the X-Request-ID header from the API error response from Shopify? This will help 

 

A common reason why image uploading might fail is if Shopify times out when downloading the image from its hosted server. This could be because the image file size is too big, or because the server it is hosted on is too slow to retrieve the file. You can try re-running the mutation or making the file faster to download and see if that helps resolve the error

 


Hi @hassain,

I already got a response with support (Scott) by email.

 

The only question I have left is what happens if I got this time-out issue with "productCreate" mutation? because is not throwing an error to know that I must re-run again, is running fine, later when I check in shopify it has no images attached.

 

hassain
Shopify Staff (Retired)
624 104 187

Hey @fedeb ,

 

That's great Scott was able to help you.

 

Regarding your later problem, I would probably recommend splitting your mutation into two separate mutations - "productCreate" to just create new product in your Shopify store, and then "productCreateMedia" to upload a Media file for your product. You should have more control and better error handling by breaking these off with separate mutations

 

To learn more visit the Shopify Help Center or the Community Blog.

fedeb
Excursionist
18 1 5

@hassain wrote:

Hey @fedeb ,

 

That's great Scott was able to help you.

 

Regarding your later problem, I would probably recommend splitting your mutation into two separate mutations - "productCreate" to just create new product in your Shopify store, and then "productCreateMedia" to upload a Media file for your product. You should have more control and better error handling by breaking these off with separate mutations

 


But "productCreateMedia" https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/productcreatemedia?api[version]...

Can't set each variant to attach the image....

 

With "productCreate" I was creating a Product with 6 Variants and each variant a different image, all this in 1 query mutation.