{"section":"known-issues","requestedLocale":"en","requestedSlug":"sku-insert-file-api-may-generate-duplicate-images-if-it-fails","locale":"en","slug":"sku-insert-file-api-may-generate-duplicate-images-if-it-fails","path":"docs/en/known-issues/Catalog/sku-insert-file-api-may-generate-duplicate-images-if-it-fails.md","branch":"main","content":"## Summary\n\nCurrently, the INSERT SKU FILE api is used to either insert or associate an image to an sku.\n\nThis API, if it fails during the process due to a timeout error, may actually isnert the image with a wrong error feedback.\n\nThe image should not be inserted in such cases and this can mislead systems/automations to add the same file twice.\n\n## Simulation\n\nThe issue is hard to simulate, so the following is a \"most probable\" scenario on how to replicate it - keeping in mind that timeouts are not normally replicable in test situations\n\n1 - Using the insert sku file API https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/stockkeepingunit/-skuId-/file try adding a large file to an sku (largeto increase the leikelyhood of the issue happening)\n\n2 - Also, if you have a slower connection, it is more likely to occur. Furthermore, simultaneous API use also contributes.\n\n3 - If the 500 timeout response is created, check the sku in the catalog UI --> the image will be there, despite the error response\n\n4 - the image should have not been added or deleted after the partial process error.\n\n## Workaround\n\nAdd the files via UI/sheet OR check the conditions that cause a timeout and try to avoid them )i.e. use smaller files, space out the API requests more, use a GET after the INSERT in API automations to check if the file was not indeed created, etc..)"}