You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "William L. Cunningham" <wc...@mcr-group.com> on 2023/04/13 20:40:48 UTC

Tomcat 8.5.85 and above - Issue with file uploads

Environment:  Windows 2019 Standard with latest JDK 17 and Apache Tomcat 8.5.87.

When trying to upload a file to the application running off Tomcat (custom software), we are getting the following error since 8.5.85 (works fine on 8.5.84).

ERROR [2023-04-13 15:20:20]: com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
java.lang.IllegalStateException: Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
     at org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFileItem.java:428) ~[tomcat-coyote.jar:8.5.87]

This same procedure works perfectly fine in 8.5.84.  It was something introduced with 8.5.85.  It also works fine on a Linux hosted version (Centos) for 8.5.84 and above.  So it appears to be Windows centric.

When I watch the procedure in the Catalina\localhost\company folder on 8.5.84, I see the tmp file generated and then immediately deleted (it's a small upload).  On 8.5.85 and above, it's locked and can't be deleted.  Thus causing the error.

Anyone have any thoughts?

Thanks for any help.

William

Re: Tomcat 8.5.85 and above - Issue with file uploads

Posted by Olaf Kock <to...@olafkock.de>.
On 13.04.23 22:40, William L. Cunningham wrote:
> Environment:  Windows 2019 Standard with latest JDK 17 and Apache Tomcat 8.5.87.
>
> When trying to upload a file to the application running off Tomcat (custom software), we are getting the following error since 8.5.85 (works fine on 8.5.84).
>
> ERROR [2023-04-13 15:20:20]: com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
> java.lang.IllegalStateException: Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>       at org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFileItem.java:428) ~[tomcat-coyote.jar:8.5.87]
>
> This same procedure works perfectly fine in 8.5.84.  It was something introduced with 8.5.85.  It also works fine on a Linux hosted version (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
>
> When I watch the procedure in the Catalina\localhost\company folder on 8.5.84, I see the tmp file generated and then immediately deleted (it's a small upload).  On 8.5.85 and above, it's locked and can't be deleted.  Thus causing the error.


You should not install Tomcat in "C:\Program Files", or at least not run 
it there (e.g. run it with CATALINA_BASE != CATALINA_HOME): Windows 
protects the content of "C:\Program Files\*" in some ways that I can't 
detail - it might very well interfere in the way that you describe. 
Maybe you had installed/run it from another directory earlier, and that 
was changed with the upgrade?

Olaf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8.5.85 and above - Issue with file uploads

Posted by Christopher Schultz <ch...@christopherschultz.net>.
William,

On 4/20/23 13:56, William L. Cunningham wrote:
> Unfortunately, I'm not privy to the developer side of things.  I'm
> infrastructure trying to help the development side.  So I'm not sure
> how to provide what you're asking for.  I'll see if I can get some
> assistance on that though.
Point your development team to this mailing-list thread. You can find 
all public mailing lists including archives at lists.apache.org.

> Just for the sake of curiosity, I just installed the 8.5.88 in a directory outside program files a little bit ago and tried it again.  Still the same error.  So I don't believe it's related to the install directory being in program files on windows.
> ________________________________
> From: Mark Thomas <ma...@apache.org>
> Sent: Monday, April 17, 2023 1:54 PM
> To: users@tomcat.apache.org <us...@tomcat.apache.org>
> Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads
> 
> On 17/04/2023 19:51, Mark Thomas wrote:
>> Hi,
>>
>> I have tried but am unable to recreate this.
>>
>> Please provide the simplest possible web application (it should be
>> possible to do this in a single Servlet) that demonstrates the issue.
> 
> To give you an idea of what I mean by a single servlet, here is the test
> case I was using:
> 
> https://github.com/markt-asf/tomcat-bugs/blob/main/src/main/java/org/apache/markt/MultiPartUpload2.java
> 
> (it is the 11.0.x version of the test but the code for upload should be
> the same across Tomcat versions)
> 
> Mark
> 
>>
>> Please make sure you provide the source code for the web application.
>>
>> Thanks,
>>
>> Mark
>>
>>
>> On 14/04/2023 19:40, William L. Cunningham wrote:
>>> Thanks, yes it happens with any file upload.
>>>
>>> -----Original Message-----
>>> From: Mark Thomas <ma...@apache.org>
>>> Sent: Friday, April 14, 2023 9:36 AM
>>> To: users@tomcat.apache.org
>>> Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads
>>>
>>> WARNING: This email originated from an external source. Please be
>>> careful when clicking on any links in external emails.
>>>
>>> On 13/04/2023 21:40, William L. Cunningham wrote:
>>>> Environment:  Windows 2019 Standard with latest JDK 17 and Apache
>>>> Tomcat 8.5.87.
>>>>
>>>> When trying to upload a file to the application running off Tomcat
>>>> (custom software), we are getting the following error since 8.5.85
>>>> (works fine on 8.5.84).
>>>>
>>>> ERROR [2023-04-13 15:20:20]:
>>>> com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete
>>>> C:\Program Files\Apache Software Foundation\Tomcat
>>>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_4
>>>> 4d3_aee6_28d1d7989727_00000000.tmp
>>>> java.lang.IllegalStateException: Cannot delete C:\Program
>>>> Files\Apache Software Foundation\Tomcat
>>>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>>>>         at
>>>> org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFi
>>>> leItem.java:428) ~[tomcat-coyote.jar:8.5.87]
>>>>
>>>> This same procedure works perfectly fine in 8.5.84.  It was something
>>>> introduced with 8.5.85.  It also works fine on a Linux hosted version
>>>> (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
>>>>
>>>> When I watch the procedure in the Catalina\localhost\company folder
>>>> on 8.5.84, I see the tmp file generated and then immediately deleted
>>>> (it's a small upload).  On 8.5.85 and above, it's locked and can't be
>>>> deleted.  Thus causing the error.
>>>>
>>>> Anyone have any thoughts?
>>>
>>> Tomcat 8.5.85 includes an updated version of the Commons FileUpload
>>> code that throws an ISE if the temporary file can't be deleted.
>>>
>>> https://github.com/apache/tomcat/commit/8d21b9ef4ae30f6f6474f00a72887338a5b745ac
>>>
>>> It looks like this may have exposed an underlying Commons IO bug:
>>>
>>> https://issues.apache.org/jira/browse/IO-788
>>>
>>> Do you see this problem every time you try to upload a file?
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8.5.85 and above - Issue with file uploads

Posted by "William L. Cunningham" <wc...@mcr-group.com>.
Unfortunately, I'm not privy to the developer side of things.  I'm infrastructure trying to help the development side.  So I'm not sure how to provide what you're asking for.  I'll see if I can get some assistance on that though.

Just for the sake of curiosity, I just installed the 8.5.88 in a directory outside program files a little bit ago and tried it again.  Still the same error.  So I don't believe it's related to the install directory being in program files on windows.
________________________________
From: Mark Thomas <ma...@apache.org>
Sent: Monday, April 17, 2023 1:54 PM
To: users@tomcat.apache.org <us...@tomcat.apache.org>
Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads

On 17/04/2023 19:51, Mark Thomas wrote:
> Hi,
>
> I have tried but am unable to recreate this.
>
> Please provide the simplest possible web application (it should be
> possible to do this in a single Servlet) that demonstrates the issue.

To give you an idea of what I mean by a single servlet, here is the test
case I was using:

https://github.com/markt-asf/tomcat-bugs/blob/main/src/main/java/org/apache/markt/MultiPartUpload2.java

(it is the 11.0.x version of the test but the code for upload should be
the same across Tomcat versions)

Mark

>
> Please make sure you provide the source code for the web application.
>
> Thanks,
>
> Mark
>
>
> On 14/04/2023 19:40, William L. Cunningham wrote:
>> Thanks, yes it happens with any file upload.
>>
>> -----Original Message-----
>> From: Mark Thomas <ma...@apache.org>
>> Sent: Friday, April 14, 2023 9:36 AM
>> To: users@tomcat.apache.org
>> Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads
>>
>> WARNING: This email originated from an external source. Please be
>> careful when clicking on any links in external emails.
>>
>> On 13/04/2023 21:40, William L. Cunningham wrote:
>>> Environment:  Windows 2019 Standard with latest JDK 17 and Apache
>>> Tomcat 8.5.87.
>>>
>>> When trying to upload a file to the application running off Tomcat
>>> (custom software), we are getting the following error since 8.5.85
>>> (works fine on 8.5.84).
>>>
>>> ERROR [2023-04-13 15:20:20]:
>>> com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete
>>> C:\Program Files\Apache Software Foundation\Tomcat
>>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_4
>>> 4d3_aee6_28d1d7989727_00000000.tmp
>>> java.lang.IllegalStateException: Cannot delete C:\Program
>>> Files\Apache Software Foundation\Tomcat
>>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>>>        at
>>> org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFi
>>> leItem.java:428) ~[tomcat-coyote.jar:8.5.87]
>>>
>>> This same procedure works perfectly fine in 8.5.84.  It was something
>>> introduced with 8.5.85.  It also works fine on a Linux hosted version
>>> (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
>>>
>>> When I watch the procedure in the Catalina\localhost\company folder
>>> on 8.5.84, I see the tmp file generated and then immediately deleted
>>> (it's a small upload).  On 8.5.85 and above, it's locked and can't be
>>> deleted.  Thus causing the error.
>>>
>>> Anyone have any thoughts?
>>
>> Tomcat 8.5.85 includes an updated version of the Commons FileUpload
>> code that throws an ISE if the temporary file can't be deleted.
>>
>> https://github.com/apache/tomcat/commit/8d21b9ef4ae30f6f6474f00a72887338a5b745ac
>>
>> It looks like this may have exposed an underlying Commons IO bug:
>>
>> https://issues.apache.org/jira/browse/IO-788
>>
>> Do you see this problem every time you try to upload a file?
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8.5.85 and above - Issue with file uploads

Posted by Mark Thomas <ma...@apache.org>.
On 17/04/2023 19:51, Mark Thomas wrote:
> Hi,
> 
> I have tried but am unable to recreate this.
> 
> Please provide the simplest possible web application (it should be 
> possible to do this in a single Servlet) that demonstrates the issue.

To give you an idea of what I mean by a single servlet, here is the test 
case I was using:

https://github.com/markt-asf/tomcat-bugs/blob/main/src/main/java/org/apache/markt/MultiPartUpload2.java

(it is the 11.0.x version of the test but the code for upload should be 
the same across Tomcat versions)

Mark

> 
> Please make sure you provide the source code for the web application.
> 
> Thanks,
> 
> Mark
> 
> 
> On 14/04/2023 19:40, William L. Cunningham wrote:
>> Thanks, yes it happens with any file upload.
>>
>> -----Original Message-----
>> From: Mark Thomas <ma...@apache.org>
>> Sent: Friday, April 14, 2023 9:36 AM
>> To: users@tomcat.apache.org
>> Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads
>>
>> WARNING: This email originated from an external source. Please be 
>> careful when clicking on any links in external emails.
>>
>> On 13/04/2023 21:40, William L. Cunningham wrote:
>>> Environment:  Windows 2019 Standard with latest JDK 17 and Apache 
>>> Tomcat 8.5.87.
>>>
>>> When trying to upload a file to the application running off Tomcat 
>>> (custom software), we are getting the following error since 8.5.85 
>>> (works fine on 8.5.84).
>>>
>>> ERROR [2023-04-13 15:20:20]:
>>> com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete
>>> C:\Program Files\Apache Software Foundation\Tomcat
>>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_4
>>> 4d3_aee6_28d1d7989727_00000000.tmp
>>> java.lang.IllegalStateException: Cannot delete C:\Program 
>>> Files\Apache Software Foundation\Tomcat 
>>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>>>        at
>>> org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFi
>>> leItem.java:428) ~[tomcat-coyote.jar:8.5.87]
>>>
>>> This same procedure works perfectly fine in 8.5.84.  It was something 
>>> introduced with 8.5.85.  It also works fine on a Linux hosted version 
>>> (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
>>>
>>> When I watch the procedure in the Catalina\localhost\company folder 
>>> on 8.5.84, I see the tmp file generated and then immediately deleted 
>>> (it's a small upload).  On 8.5.85 and above, it's locked and can't be 
>>> deleted.  Thus causing the error.
>>>
>>> Anyone have any thoughts?
>>
>> Tomcat 8.5.85 includes an updated version of the Commons FileUpload 
>> code that throws an ISE if the temporary file can't be deleted.
>>
>> https://github.com/apache/tomcat/commit/8d21b9ef4ae30f6f6474f00a72887338a5b745ac
>>
>> It looks like this may have exposed an underlying Commons IO bug:
>>
>> https://issues.apache.org/jira/browse/IO-788
>>
>> Do you see this problem every time you try to upload a file?
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8.5.85 and above - Issue with file uploads

Posted by Mark Thomas <ma...@apache.org>.
Hi,

I have tried but am unable to recreate this.

Please provide the simplest possible web application (it should be 
possible to do this in a single Servlet) that demonstrates the issue.

Please make sure you provide the source code for the web application.

Thanks,

Mark


On 14/04/2023 19:40, William L. Cunningham wrote:
> Thanks, yes it happens with any file upload.
> 
> -----Original Message-----
> From: Mark Thomas <ma...@apache.org>
> Sent: Friday, April 14, 2023 9:36 AM
> To: users@tomcat.apache.org
> Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads
> 
> WARNING: This email originated from an external source. Please be careful when clicking on any links in external emails.
> 
> On 13/04/2023 21:40, William L. Cunningham wrote:
>> Environment:  Windows 2019 Standard with latest JDK 17 and Apache Tomcat 8.5.87.
>>
>> When trying to upload a file to the application running off Tomcat (custom software), we are getting the following error since 8.5.85 (works fine on 8.5.84).
>>
>> ERROR [2023-04-13 15:20:20]:
>> com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete
>> C:\Program Files\Apache Software Foundation\Tomcat
>> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_4
>> 4d3_aee6_28d1d7989727_00000000.tmp
>> java.lang.IllegalStateException: Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>>        at
>> org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFi
>> leItem.java:428) ~[tomcat-coyote.jar:8.5.87]
>>
>> This same procedure works perfectly fine in 8.5.84.  It was something introduced with 8.5.85.  It also works fine on a Linux hosted version (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
>>
>> When I watch the procedure in the Catalina\localhost\company folder on 8.5.84, I see the tmp file generated and then immediately deleted (it's a small upload).  On 8.5.85 and above, it's locked and can't be deleted.  Thus causing the error.
>>
>> Anyone have any thoughts?
> 
> Tomcat 8.5.85 includes an updated version of the Commons FileUpload code that throws an ISE if the temporary file can't be deleted.
> 
> https://github.com/apache/tomcat/commit/8d21b9ef4ae30f6f6474f00a72887338a5b745ac
> 
> It looks like this may have exposed an underlying Commons IO bug:
> 
> https://issues.apache.org/jira/browse/IO-788
> 
> Do you see this problem every time you try to upload a file?
> 
> Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 8.5.85 and above - Issue with file uploads

Posted by "William L. Cunningham" <wc...@mcr-group.com>.
Thanks, yes it happens with any file upload.

-----Original Message-----
From: Mark Thomas <ma...@apache.org> 
Sent: Friday, April 14, 2023 9:36 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat 8.5.85 and above - Issue with file uploads

WARNING: This email originated from an external source. Please be careful when clicking on any links in external emails.

On 13/04/2023 21:40, William L. Cunningham wrote:
> Environment:  Windows 2019 Standard with latest JDK 17 and Apache Tomcat 8.5.87.
>
> When trying to upload a file to the application running off Tomcat (custom software), we are getting the following error since 8.5.85 (works fine on 8.5.84).
>
> ERROR [2023-04-13 15:20:20]: 
> com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete 
> C:\Program Files\Apache Software Foundation\Tomcat 
> 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_4
> 4d3_aee6_28d1d7989727_00000000.tmp
> java.lang.IllegalStateException: Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>       at 
> org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFi
> leItem.java:428) ~[tomcat-coyote.jar:8.5.87]
>
> This same procedure works perfectly fine in 8.5.84.  It was something introduced with 8.5.85.  It also works fine on a Linux hosted version (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
>
> When I watch the procedure in the Catalina\localhost\company folder on 8.5.84, I see the tmp file generated and then immediately deleted (it's a small upload).  On 8.5.85 and above, it's locked and can't be deleted.  Thus causing the error.
>
> Anyone have any thoughts?

Tomcat 8.5.85 includes an updated version of the Commons FileUpload code that throws an ISE if the temporary file can't be deleted.

https://github.com/apache/tomcat/commit/8d21b9ef4ae30f6f6474f00a72887338a5b745ac

It looks like this may have exposed an underlying Commons IO bug:

https://issues.apache.org/jira/browse/IO-788

Do you see this problem every time you try to upload a file?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8.5.85 and above - Issue with file uploads

Posted by Mark Thomas <ma...@apache.org>.
On 13/04/2023 21:40, William L. Cunningham wrote:
> Environment:  Windows 2019 Standard with latest JDK 17 and Apache Tomcat 8.5.87.
> 
> When trying to upload a file to the application running off Tomcat (custom software), we are getting the following error since 8.5.85 (works fine on 8.5.84).
> 
> ERROR [2023-04-13 15:20:20]: com.company.dataimporter.servlet.FileUpload::doPost::85 Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
> java.lang.IllegalStateException: Cannot delete C:\Program Files\Apache Software Foundation\Tomcat 8.5_Tomcat_Prod\work\Catalina\localhost\company\upload_1da07be9_7508_44d3_aee6_28d1d7989727_00000000.tmp
>       at org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.delete(DiskFileItem.java:428) ~[tomcat-coyote.jar:8.5.87]
> 
> This same procedure works perfectly fine in 8.5.84.  It was something introduced with 8.5.85.  It also works fine on a Linux hosted version (Centos) for 8.5.84 and above.  So it appears to be Windows centric.
> 
> When I watch the procedure in the Catalina\localhost\company folder on 8.5.84, I see the tmp file generated and then immediately deleted (it's a small upload).  On 8.5.85 and above, it's locked and can't be deleted.  Thus causing the error.
> 
> Anyone have any thoughts?

Tomcat 8.5.85 includes an updated version of the Commons FileUpload code 
that throws an ISE if the temporary file can't be deleted.

https://github.com/apache/tomcat/commit/8d21b9ef4ae30f6f6474f00a72887338a5b745ac

It looks like this may have exposed an underlying Commons IO bug:

https://issues.apache.org/jira/browse/IO-788

Do you see this problem every time you try to upload a file?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org