Copy link to clipboard
Copied
It is a very simple scenario, and believe me it was working absolutely fine on CF11 Windows 7, but for some strange reason on CF11 Windows 10, deleting a file does not work, because I think the file is being locked by Coldfusion:
I have double checked the path and it is correct:
<cflock name="delete_globalsettingsimage" type="exclusive" timeout="40">
<cffile action="delete" file="#request.filepath#\#uploadfolder4#\#filenameassociation#" />
</cflock>
The <cffile...> part of the code is line 1360
And the error:
ColdFusion could not delete the file C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/cache/file/brand-logo-email/5E797506-84A6-C828-BCCF23F51DB922B1.png for an unknown reason.
The error occurred in C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 1360
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 1358
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 1349
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 1145
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 1144
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 949
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 4
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm: line 1
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm: line 215
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm: line 137
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm: line 4
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm: line 1
Called from C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/default/cms/settings/global-settings/index.cfm: line 7
1358 : <cfif FileExists("#request.filepath#\#uploadfolder4#\#filenameassociation#")>
1359 : <cflock name="delete_globalsettingsimage" type="exclusive" timeout="40">
1360 : <cffile action="delete" file="#request.filepath#\#uploadfolder4#\#filenameassociation#" />
1361 : </cflock>
1362 : <cfset destinationfilename = ListFirst(filenameassociation,".") & imagesuffixes4['top'] & "." & ListLast(filenameassociation,".")>
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Remote Address 0:0:0:0:0:0:0:1
Referrer http://localhost:850...
Date/Time 17-Nov-17 05:25 PM
Stack Trace
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor35(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:1360) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor36(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:1358) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor46(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:1349) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor109(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:1145) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor119(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:1144) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor141(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:949) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor151(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:4) at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409.runPage(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/content/cms-settings-global-settings-content.cfm:1) at cfcms2dpage2dtemplate2ecfm671025178._factor3(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm:215) at cfcms2dpage2dtemplate2ecfm671025178._factor7(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm:137) at cfcms2dpage2dtemplate2ecfm671025178._factor8(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm:4) at cfcms2dpage2dtemplate2ecfm671025178.runPage(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/includes/cms-page-template.cfm:1) at cfindex2ecfm757710257.runPage(C:/ColdFusion11/cfusion/wwwroot/establishmindfulness/default/cms/settings/global-settings/index.cfm:7)
coldfusion.tagext.io.FileUtils$CouldNotDeleteFileException: ColdFusion could not delete the file C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\cache\file\brand-logo-email\5E797506-84A6-C828-BCCF23F51DB922B1.png for an unknown reason.
at coldfusion.tagext.io.FileUtils.delete(FileUtils.java:1037)
at coldfusion.tagext.io.FileTag.delete(FileTag.java:550)
at coldfusion.tagext.io.FileTag.doStartTag(FileTag.java:355)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor35(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:1360)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor36(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:1358)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor46(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:1349)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor109(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:1145)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor119(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:1144)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor141(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:949)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409._factor151(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:4)
at cfcms2dsettings2dglobal2dsettings2dcontent2ecfm212604409.runPage(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\content\cms-settings-global-settings-content.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)
at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:736)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:572)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2986)
at cfcms2dpage2dtemplate2ecfm671025178._factor3(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\cms-page-template.cfm:215)
at cfcms2dpage2dtemplate2ecfm671025178._factor7(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\cms-page-template.cfm:137)
at cfcms2dpage2dtemplate2ecfm671025178._factor8(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\cms-page-template.cfm:4)
at cfcms2dpage2dtemplate2ecfm671025178.runPage(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\includes\cms-page-template.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)
at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:736)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:572)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2986)
at cfindex2ecfm757710257.runPage(C:\ColdFusion11\cfusion\wwwroot\establishmindfulness\default\cms\settings\global-settings\index.cfm:7)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:246)
at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:736)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:572)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:45)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:466)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:151)
at coldfusion.CfmServlet.service(CfmServlet.java:219)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:121)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Let me provide some context to this operation. Before I attempt to delete this file, I have uploaded a different file, but I cannot see how the error would be related, because the 2 files are unique.
If I then try and delete the file, manually, that is causing the error, Windows will not allow me to do so, stating that:
"The action cannot be completed because the file is open in ColdFusion.exe"
If I then restart ColdFusion, I am then able to manually delete the file.
If I try and delete the file, using a test page without the upload operation before hand, it successfully deletes the file, but only directly after I have restarted ColdFusion.
If I try and delete the file, using a test page without the upload operation before hand, but after having tried to delete it using the non test page [with the upload operation], it will not delete the file and throws the same exception.
I am totally baffled.
As I said, I have hundreds of file delete operations in my custom CMS, and all of these operations worked successfully, in CF11 Windows 7.
Environment:
Windows 10 64bit
CF11,0,3,292866 64bit
Java Version 1.8.0_25 64bit
Copy link to clipboard
Copied
OK. I have spent the day breaking this issue apart line by line.
It is definitely a bug that was patched in CF8. It is related to <cfimage> operations.
Whenever you carry out <cfimage> operations, the file is locked and so cannot be deleted.
In relation to the original issue, after I have uploaded my file, I carry out various image resizing & cropping operations.
The only solution I have come up, which is less than desirable, is to copy the uploaded file to a temp directory, carry out any <cfimage> operations and then copy back to the target directory. This allows us to delete the file later if we need to. The file in the temp directory is locked until the Coldfusion Server is restarted.
I am not sure whether a patch has been issued for CF11, but it is pretty annoying that an issue that was resolved 3 major version's ago, has now returned.
And I cannot update CF11 past update 3, because it causes even bigger problems.
Copy link to clipboard
Copied
Karma (Charles), you say this is a bug that was "fixed in CF8 and has returned in CF11", but you opened your first message saying that this worked in CF11 on Windows 7 and fails on Windows 10. So I don't see how the issue is "about cf11", per se. 🙂
We can only go on what you say. But maybe you will offer some clarification that addresses that.
Next, you say you have will not upgrade past update 3. Can you confirm whether the machine that had been running CF11 on Windows 7 may have been running more than update 3? What if this is simply a big fixed in a later version? Can you at least take a few minutes to implement update 12 (the latest CF11 update), and test this problem, to at least see if it goes away? If it does, then it's a bug that was fixed.
Then as for you not being able to go past update 3, you could perhaps bring up what is holding you back and maybe Adobe can address it, or someone here can help.(Also, are you sure that whatever doesn't work for you in update 3 hasn't been fixed by later updates? Update 3 is from Dec 2014, after all.
Finally, if you somehow DID find that even on update 12 it still failed, then you would really do yourself and everyone (Adobe and folks reading alone) if you were to put together a test case of self-contained code that demonstrated the problem, so that others (also on update 12) could confirm it for you.
Then again, someone (perhaps you) could confirm if the problem code runs on CF2016 (if not on CF11 update 12) then that too (updating to 2016) may be an option for you to consider. Let us know what you think of the above.
Copy link to clipboard
Copied
Charlie. I have filed a bug with Adobe and added a test '.cfm' file. I have spent days testing this problem. I think it maybe the same 'cfimage' bug that occurred in CF8, for which a hot fix was supplied. <cfimage> is locking files and not releasing them Not only can you not delete them, but you cannot apply any cffile operation or even manually carry out any file operation.
I have put together a test case of self-contained code that demonstrates the problem. I wanted to attach it here, but I cannot see an 'attach' link [using iOS10]. So, the code file can be found at Adobe's bug tracker.
The bug tracker number is:
Copy link to clipboard
Copied
I have gone through every update from 4 - 12 for CF11 & looked carefully at their bug fix lists, and there is no mention of this specific problem. So, I believe this is an issue that may not have been addressed?
Copy link to clipboard
Copied
Surely, it is possible that a different operating system will have an influence on the way it interacts with Coldfusion. Presumably this is why software companies often issue updates when a new operating system is released. In all honesty, I cannot say for sure whether this scenario worked correctly on Windows 7. But, I cannot remember it being a problem, which may imply that I never picked it up.
If this is a bug, it does not always become apparent, unless a file operation is carried out on a file that has had a cfimage operation applied to it previously. So, it maybe that I just never experienced this issue on Windows 7, athough it may have been present.