cancel
Showing results for 
Search instead for 
Did you mean: 

Error when using database for media storage

Error when using database for media storage

Hi,

 

I'm experiencing issues when updating product images if I set Magento 2 to use the database for media storage. If I upload an image with the same filename as a previously uploaded image, I get the following error when I try to save the product:

 

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'httpsindian-ocean-6030.lovebonito.com83216image123_3.jpg-356' for key 'MEDIA_STORAGE_FILE_STORAGE_FILENAME_DIRECTORY_ID', query was: UPDATE `media_storage_file_storage` SET `filename` = ?, `directory` = ? WHERE (filename = 'httpsindian-ocean-6030.lovebonito.com83216image123.jpg') AND (directory = 'tmp/catalog/product/h/t')

 

Does anyone have experience with this issue?