Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
ID | |||||||||||
0049374 | |||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||
design defect | [Openbravo ERP] A. Platform | minor | have not tried | 2022-05-23 10:32 | 2022-05-30 12:48 | ||||||
Reporter | alostale | View Status | public | ||||||||
Assigned To | Triage Platform Base | ||||||||||
Priority | normal | Resolution | open | Fixed in Version | |||||||
Status | acknowledged | Fix in branch | Fixed in SCM revision | ||||||||
Projection | none | ETA | none | Target Version | |||||||
OS | Any | Database | Any | Java version | |||||||
OS Version | Database version | Ant version | |||||||||
Product Version | SCM revision | ||||||||||
Review Assigned To | |||||||||||
Web browser | |||||||||||
Modules | Core | ||||||||||
Regression level | Production - Confirmed Stable | ||||||||||
Regression date | 2020-07-20 | ||||||||||
Regression introduced in release | PR20Q2.2 | ||||||||||
Regression introduced by commit | https://gitlab.com/openbravo/product/openbravo/-/commit/1cc1f00fa6db5780ba858122a87f1485d8d402e3 [^] | ||||||||||
Triggers an Emergency Pack | No | ||||||||||
Summary | 0049374: cannot upload a file to a location that already exists | ||||||||||
Description | It is not longer possible upload a file (using org.apache.commons.fileupload.disk.DiskFileItem) if the destination file already exists. The current commons-fileupload version (1.4) has a regression [1] that prevents it. This would occur, for example, in this piece of code: File tmpFile = File.createTempFile("myFile", "tmp"); fileItem.write(tmpFile); --- [1] https://issues.apache.org/jira/browse/FILEUPLOAD-293 [^] | ||||||||||
Steps To Reproduce | Execute this piece of code (where fileItem is some file uploaded by the user):File tmpFile = File.createTempFile("myFile", "tmp"); fileItem.write(tmpFile); ERROR: org.apache.commons.io.FileExistsException: Destination '/tmp/myFileES12761645902496824351tmp' already exists at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2825) ~[commons-io-2.4.jar:2.4] at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405) ~[commons-fileupload-1.4.jar:1.4] | ||||||||||
Proposed Solution | Although Apache Commons FileUpload project has fixed the issue in their code repositories [1], they have not published a new version including this fix. Furthermore, according with the discussions in the issue report [2], it seems they are not planning to do so in a foreseeable future. So, for now, the temporary workaround is to change the code invoking the affected method to ensure the file does not exist, similarly to what they are doing in their fix [3]: File tmpFile = File.createTempFile("myFile", "tmp"); tmpFile.delete(); fileItem.write(tmpFile); --- [1] https://github.com/apache/commons-fileupload/commit/5c2302bbf3859aabf3a719285237f6d0773612b2. [^] [2] https://issues.apache.org/jira/browse/FILEUPLOAD-293 [^] [3] https://github.com/apache/commons-fileupload/commit/5c2302bbf3859aabf3a719285237f6d0773612b2#diff-0b9a284d7c4709ab8da7e3de061e2019e68f3a9d597d972bd4b54f4dbd8c2e63R405-R407 [^] | ||||||||||
Tags | No tags attached. | ||||||||||
Attached Files | |||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||
|
Notes | |
(0137633) alostale (manager) 2022-05-23 14:27 |
Moved to design defect as it is depends on a new version of the Apache Commons FileUpload that is unlikely to be released in short |
Issue History | |||
Date Modified | Username | Field | Change |
2022-05-23 10:32 | alostale | New Issue | |
2022-05-23 10:32 | alostale | Assigned To | => Triage Platform Base |
2022-05-23 10:32 | alostale | Modules | => Core |
2022-05-23 10:32 | alostale | Triggers an Emergency Pack | => No |
2022-05-23 10:33 | alostale | Relationship added | caused by 0044937 |
2022-05-23 10:34 | alostale | Regression date | => 2020-07-20 |
2022-05-23 10:34 | alostale | Regression introduced in release | => PR20Q2.2 |
2022-05-23 10:34 | alostale | Regression introduced by commit | => https://gitlab.com/openbravo/product/openbravo/-/commit/1cc1f00fa6db5780ba858122a87f1485d8d402e3 [^] |
2022-05-23 10:34 | alostale | Regression level | => Production - Confirmed Stable |
2022-05-23 14:27 | alostale | Note Added: 0137633 | |
2022-05-23 14:27 | alostale | Type | defect => design defect |
2022-05-30 12:23 | AugustoMauch | Assigned To | Triage Platform Base => meriem_azaf |
2022-05-30 12:23 | AugustoMauch | Status | new => acknowledged |
2022-05-30 12:47 | AugustoMauch | Assigned To | meriem_azaf => Triage Platform Base |
2022-05-30 12:47 | AugustoMauch | Status | acknowledged => scheduled |
2022-05-30 12:48 | AugustoMauch | Status | scheduled => acknowledged |
Copyright © 2000 - 2009 MantisBT Group |