Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets : Upload failed - Integrity constraint violation #3786

Closed
MichaelCaraccio opened this issue Feb 5, 2019 · 1 comment
Closed

Assets : Upload failed - Integrity constraint violation #3786

MichaelCaraccio opened this issue Feb 5, 2019 · 1 comment

Comments

@MichaelCaraccio
Copy link

Description

After deleting and re-uploading the same image (same name, not content) from the assets, I had the following errors.

Upload failed. The error message was: “SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'cuir.png-7' for key 'assets_filename_folderId_unq_idx'
The SQL being executed was: INSERT INTO `assets` (`id`, `filename`, `volumeId`, `folderId`, `kind`, `size`, `width`, `height`, `dateModified`, `focalPoint`, `dateCreated`, `uid`, `dateUpdated`) VALUES (162, 'cuir.png', 2, 7, 'image', '125654', 435, 435, '2019-02-05 12:37:45', NULL, '2019-02-05 12:37:45', 'c5d34f93-b74b-4b20-b0b8-a8e5b5bc4cc2', '2019-02-05 12:37:45')”

Steps to reproduce

  1. From backend, delete image from assets
  2. Clean assets cache
  3. From assets, upload the image with same name as the deleted one (same image name but minified).
  4. Upload failed

Additional info

  • Craft version: 3.1.7
  • PHP version: 7.1.22
  • Database driver & version: MySQL 5.7.23
  • Plugins & versions: CKEditor | 1.0.0-beta.2

It's not the same error as Issue #3773 because I did not have to choose between duplicate the image or replace it. Probably because I cleaned the cache ?

@andris-sevcenko
Copy link
Contributor

Fixed this literally minutes ago in 03bbc56

brandonkelly added a commit that referenced this issue Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants