View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0029144||mantisbt||attachments||public||2021-10-06 08:01||2021-10-15 12:55|
|Summary||0029144: Adding an attachment with a long filename causes "Data too long for column 'filename'" application error|
Column "filename" in "mantis_bug_file_table" has, as some other columns in this table, a limit of 250 characters. Uploading a file a file name longer than this limit results in the following error:
APPLICATION ERROR 0000401
Database query failed. Error received from database was #1406: Data too long for column 'filename' at row 1 for the query: INSERT INTO mantis_bug_file_table
|Steps To Reproduce|
Create a file with the following file name, which has 255 characters, and add some arbitrary content to the file:
Upload the file and click "Add note": the error appears.
Filenames with such a length are probably not very widespread if the files are created manually, but here's a use case where it can happen "semi-automatically": when you use the EmailReporting plugin in Mantis:
I receive an email from someone with a subject containing more than 250 characters.
In this use case, there's also a consequential error: the ticket was created (without the attachment), but the imported email will stay on the mail server because of the error. EmailReporting will fetch the email again next time, and the same circle starts again, endlessly. But that's probably something for the EmailReporting plugin to fix.
|Tags||No tags attached.|
Bug is confirmed.
Indeed, nothing we can do about that. If you have not done so already, you should report the issue with them.
I would also suggest, that they use a different naming strategy for the attachment name - it does not really make sense IMO to generate such long file names.
Ok thanks. I reported the consequential error in the EmailReporting project as 0029148
@dregad. EmailReporting is not the one generating the filenames. It's the filenames of the attachments in the email and EmailReporting is using that as a base. We are going to trim the filenames as necessary.