View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029144 | mantisbt | attachments | public | 2021-10-06 08:01 | 2022-04-13 12:10 |
Reporter | jensberke | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.24.2 | ||||
Target Version | 2.25.3 | Fixed in Version | 2.25.3 | ||
Summary | 0029144: Adding an attachment with a long filename causes "Data too long for column 'filename'" application error | ||||
Description | 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: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901.txt Upload the file and click "Add note": the error appears. | ||||
Additional Information | 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. |
|
MantisBT: master-2.25 b507ceae 2021-10-15 08:40 Details Diff |
Fix "Data too long for column 'filename'" error Column "filename" in "mantis_bug_file_table" has a limit of 250 chars. Uploading a file with a name longer than this limit results in APPLICATION ERROR 401: Database query failed. Error received from database was #1406: Data too long for column 'filename'. Adding error handling: - set 'maxsize' attribute to input text fields - the javascript that validates adding files to dropzone, now provides the user with a meaningful error message before they submit the issue - in the back-end scripts, throwing a ClientException should allow plugins to catch the error and recover - a new ERROR_FILE_NAME_TOO_LONG error constant and corresponding error string provides a user-friendly message instead of a generic database error Fixes 0029144 |
Affected Issues 0029144 |
|
mod - core/commands/IssueAddCommand.php | Diff File | ||
mod - core/constant_inc.php | Diff File | ||
mod - core/file_api.php | Diff File | ||
mod - core/print_api.php | Diff File | ||
mod - js/common.js | Diff File | ||
mod - lang/strings_english.txt | Diff File | ||
mod - manage_proj_create_page.php | Diff File | ||
mod - manage_proj_edit_page.php | Diff File | ||
mod - proj_doc_update.php | Diff File |