Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0049374 | Openbravo ERP | A. Platform | public | 2022-05-23 10:32 | 2022-05-30 12:48 | |||||||
Reporter | alostale | |||||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | |||||||
Status | acknowledged | Resolution | open | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
OBNetwork customer | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | ||||||||||||
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 [^] | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
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 |
Notes | |||||
|
|||||
|
|