Title: [BUG / BLOCKING] &#8220;database error&#8221;
Last modified: October 8, 2021

---

# [BUG / BLOCKING] “database error”

 *  [jbonlinea](https://wordpress.org/support/users/jbonlinea/)
 * (@jbonlinea)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/bug-blocking/)
 * Hi there,
 * thank you for this great plug-in that solve many issue at once.
 * I’m facing a bug, or rather a blocking situation.
    In some cases, the file upload
   fails, in the media library, on the right, insted of the media detail there is
   an error message saying “impossible to insert the attachement into the database”(
   my wp is in french so I translated the error message)
 * I assume this might be due to file name lenght, as using post title plus file
   name might create long names.
 * I thus have added a value to truncate names, but the issue persist.
 * if I disable your plug-in I can successfully upload my file.
 * Do you have any clues what may cause that ?
    is there a recomended setting for
   file name lenght to truncate ?
 * for admin, it’s anoying, but one might disable the plug-in for the time of upload,
   but for editors it is totally blocking, and thus a huge issue
 * Any help would be greatly appreciated.
 * Regards
    -  This topic was modified 4 years, 8 months ago by [jbonlinea](https://wordpress.org/support/users/jbonlinea/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Pablo Pacheco](https://wordpress.org/support/users/karzin/)
 * (@karzin)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/bug-blocking/#post-14964153)
 * Hi [@jbonlinea](https://wordpress.org/support/users/jbonlinea/) ,
 * Thanks 🙂
 * Can you please tell me exactly what is your **filename structure** option?
    And
   can you also tell me what is the filename that fails on upload?
 *  Thread Starter [jbonlinea](https://wordpress.org/support/users/jbonlinea/)
 * (@jbonlinea)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/bug-blocking/#post-14969561)
 * Hi,
 * I think it was `{siteurl}{posttitle}{filename}`, with `-` as separator.
    I then
   changed it to `{posttitle}{filename}` but I don’t think it has solved the issue
   with a specific file…
 * Speaking of file… which one was it ? hum
    I just tried again with this one and
   it failed : “politique-de-la-terre-et-de-lappartenance-droits-fonciers-et-citoyennete-
   dans-les-societes-du-sud.jpg”
 * on a post named
    “Politique de la terre et de l’appartenance. Droits fonciers
   et citoyenneté locale dans les sociétés du Sud”
 * I know it failed a couple of times but could only dificultly retrive each of 
   them
 * regards
 *  Plugin Author [Pablo Pacheco](https://wordpress.org/support/users/karzin/)
 * (@karzin)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/bug-blocking/#post-14971755)
 * It seems that there is a limit indeed. I wasn’t aware of that.
    I was able to
   reproduce the issue here when I tried to upload a file following your example.
 * I realized there is a limit on WordPress for the `post_name` in the `posts` table.
   The max length is 200. If you try to upload a filename longer than that it fails.
 * I created a new option for you:
    **Filename structure > Max length**
 * It will be set as 200 by default. It will truncate the filename at this limit.
   Any characters longer than that will be wiped out. I believe you don’t need to
   change anything
 * Please update the plugin to version 1.3.2, try again and let me know if it works
   for you 😉
    -  This reply was modified 4 years, 8 months ago by [Pablo Pacheco](https://wordpress.org/support/users/karzin/).
 *  Plugin Author [Pablo Pacheco](https://wordpress.org/support/users/karzin/)
 * (@karzin)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/bug-blocking/#post-14974566)
 * Actually the correct version would be 2.4.8.
    1.3.2 is from Pro version 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[BUG / BLOCKING] “database error”’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/file-renaming-on-upload_c2e0f1.svg)
 * [Rename Media Files: Improve Your WordPress SEO](https://wordpress.org/plugins/file-renaming-on-upload/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/file-renaming-on-upload/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/file-renaming-on-upload/)
 * [Active Topics](https://wordpress.org/support/plugin/file-renaming-on-upload/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/file-renaming-on-upload/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/file-renaming-on-upload/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Pablo Pacheco](https://wordpress.org/support/users/karzin/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/bug-blocking/#post-14974566)
 * Status: not resolved