开发者

Unable to read/write to Coldfusion 8.01 tmpCache directory on server restart

开发者 https://www.devze.com 2023-03-16 07:22 出处:网络
I\'m having an odd issue with an installation of CF8.01. I recently updated the coldfusion image hotfix (kb403411) & discovered that suddenly CF started needing use of a new directory for some ima

I'm having an odd issue with an installation of CF8.01. I recently updated the coldfusion image hotfix (kb403411) & discovered that suddenly CF started needing use of a new directory for some image manipulation functions [imageresize()]

{coldfusionh_home}/tmpCache & it subdirectories /CFFileServlet/_cf_image/. Initially tmpCache did not exist & had to be created, it's subdirs were created automatically. However there are 3 problems here:

  1. Coldfusion does not appear to be deleting temporary files from the subdirs
  2. An error is thrown on the first attempt to write something to these dirs ONLY after the FIRST restart of coldfusion. Subsequent read/write attempts are fine. [trace posted below]
  3. A directory entry has to be added to the sandbox settings to allow access to this directory [actually this is more of a PIA than an issue - it is correct behavior for sandboxes]

so I have several questions:

  1. How do I test/ensure that CF is deleting these files when no longer needed
  2. what is the possible cause of the startup error & how to fix?
  3. the sandbox thing is a pain, can CF be told to use /tmp or /var/tmp or something instead

I've tried several different owner/permission combinations on the directory structure & Am convinced it is not permissions.

Any thoughts/ideas?

Here is the error trace:

image rezise
500

ROOT CAUSE: 
java.security.AccessCont开发者_运维技巧rolException: access denied (java.io.FilePermission /opt/coldfusion8/tmpCache read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.File.exists(File.java:731)
at coldfusion.runtime.RuntimeServiceImpl.getTempCacheDirectory(RuntimeServiceImpl.java:2038)
at coldfusion.tagext.io.ImageTag.getTempImageFile(ImageTag.java:637)
at coldfusion.tagext.io.ImageTag.writeImageToBrowser(ImageTag.java:571)
at coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:459)
at cftest2ecfm1941538635.runPage(/var/www/vhosts/bigblock.ca/subdomains/propaganda/httpdocs/filetest/test.cfm:29)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:288)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:198)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

javax.servlet.ServletException: ROOT CAUSE: 
java.security.AccessControlException: access denied (java.io.FilePermission /opt/coldfusion8/tmpCache read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.File.exists(File.java:731)
at coldfusion.runtime.RuntimeServiceImpl.getTempCacheDirectory(RuntimeServiceImpl.java:2038)
at coldfusion.tagext.io.ImageTag.getTempImageFile(ImageTag.java:637)
at coldfusion.tagext.io.ImageTag.writeImageToBrowser(ImageTag.java:571)
at coldfusion.tagext.io.ImageTag.doStartTag(ImageTag.java:459)
at cftest2ecfm1941538635.runPage(/var/www/vhosts/bigblock.ca/subdomains/propaganda/httpdocs/filetest/test.cfm:29)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:483)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:288)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:74)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:198)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)


ok, I see no one else couldn't help so I'll try to give you a hint from my personal experience.

If you have for example, some file i/o operation during your page execution, e.g. file upload, and you're using java native classes for file manipulation, and exception is thrown before you call File close() method, all files get locked and can't be open/deleted without higher permissions and/or server restart. Happened to me dozens of times so I can assume it could happen to be your problem.

Cheers, z.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号