Afternoon all - odd issue where created some new asset folders and adding new files is timing out. If I view the folder in question (on the server) I can see the file has been successfully uploaded but this isn’t reflected in the back-end. Craft 2.4. Console Log is returning a POST /admin/actions/assets/uploadFile 500 (Internal Server Error) response.

Checking the craft logs it is throwing a Duplicate entry '3996' for key 'PRIMARY' error in the craft_assetfiles table. It looks like somewhere between builds/deployments the craft_assetfiles table has got out of sync. I've tried updating the Asset and Search indexes but with no success.

Any thoughts on debugging or resolving?

1 Answer 1


Okay - have managed to resolve this. Needed to reset the auto increment value in the craft_elements to greater than the max(id) for the craft_assetfiles - not sure how those got out of synch but that seems to have resolved it. Hallelujah!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.