We're getting some strange behaviour with FME Server 2022.2.4 running on Windows Server, wondering if anybody else has come across this or has any ideas of how to resolve.
We have a workspace which accepts an input text file and then does some processing on it. When running the workspace through the REST API, or through the FME Server interface, the file is first uploaded and then the workspace processes it. We are finding that the uploaded file does not get overwritten. i.e. First we upload file A - all works fine the first time. Then we rerun the workspace, uploading file B. File A does not get overwritten and the workspaces processes file A instead of file B.
In this log file: C:\ProgramData\Safe Software\FME Server\resources\logs\tomcat\<machinename>\catalina.2023-06-19.log
We see the error below:
19-Jun-2023 11:28:21.685 WARNING mhttp-nio-0.0.0.0-80-exec-8] COM.safe.web.upload.StoreManager$FileDesc.<init> null
org.apache.commons.io.FileExistsException: File element in parameter 'null' already exists: 'C:\ProgramData\Safe Software\FME Server\resources\system\temp\upload\<myRepository>\test.fmw\admin\testA.txt'
at org.apache.commons.io.FileUtils.requireAbsent(FileUtils.java:2587)
at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2305)
at org.apache.commons.io.FileUtils.moveFile(FileUtils.java:2283)
at org.apache.commons.fileupload.disk.DiskFileItem.write(DiskFileItem.java:405)
at COM.safe.web.upload.StoreManager$FileDesc.<init>(StoreManager.java:160)
at COM.safe.web.upload.StoreManager.createFileDesc(StoreManager.java:431)
at COM.safe.web.upload.StoreManager.createFrom(StoreManager.java:307)
at COM.safe.web.upload.StoreManager.populate(StoreManager.java:261)
at COM.safe.webservices.upload.VolatileUploadServlet.doPost(VolatileUploadServlet.java:252)
The really strange thing is that we tried this test with really small files and then it does work fine. The uploaded file does get overwritten. 10kb seems to be the cut off - below that they are overwritten as expected, above it they are not.
We can reproduce the issue using a simple workspace with a text_line reader, logging the contents so we can tell if FME Server is processing the correct uploaded file.