[英]R Shiny unable to start png device after running a few hours
I have had various R Shiny applications running successfully (some for over a year) on a Windows PC serving a local intranet network.我已经在为本地 Intranet 网络服务的 Windows PC 上成功运行了各种 R Shiny 应用程序(有些运行了一年多)。
In the last couple of weeks, the applications started to fail loading plots with the error:在过去的几周里,应用程序开始无法加载绘图并出现以下错误:
unable to start png() device.无法启动 png() 设备。
Restarting the application would fix the problem, but only for a few hours when it would error again.重新启动应用程序可以解决问题,但仅在几个小时内它会再次出错。
At the time I had not changed anything in R, although since the isuue started I have updated everything hoping it would fix the problem.当时我没有在 R 中进行任何更改,尽管自从 isuue 开始以来,我已经更新了所有内容,希望它能解决问题。 There was no change after the updates.更新后没有任何变化。
When I load an app that is freshly restarted there are no warnings.当我加载一个刚刚重新启动的应用程序时,没有任何警告。 When there are errors, the console prints the following:出现错误时,控制台会打印以下内容:
unable to open file 'C:\Users\jgerla03\AppData\Local\Temp\Rtmp4QtNQ2\file91819b61552' for writing
Warning in dev_fun(file = tempfile(), width = width %||% 640, height = height %||% :
opening device failed
Warning: Error in dev_fun: unable to start png() device
107: dev_fun
106: gg2list
105: ggplotly.ggplot
102: plotly_build.gg
98: getFromNamespace("prepareWidget", "plotly")
97: shinyRenderWidget
96: func
83: renderFunc
82: output$fmc_summary_plot
1: shiny::runApp
Warning in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:\Users\jgerla03\AppData\Local\Temp\Rtmp4QtNQ2": The system cannot find the file specified
The shiny apps are run from an admin account with highest privileges (run from Windows 10 Task Scheduler or commandline).闪亮的应用程序从具有最高权限的管理员帐户运行(从 Windows 10 任务计划程序或命令行运行)。 The appdata temp folder specified in the error message gives all users permission to read/write/everything, but the toggle saying "read only" is on everytime I open the "properties" window for the folder (despite me unclicking it and applying each time).错误消息中指定的 appdata 临时文件夹授予所有用户读/写/所有内容的权限,但是每次我打开文件夹的“属性”窗口时,都会显示“只读”的切换开关(尽管我每次都取消单击它并应用)。
I am so confused because everything works perfectly for the first few hours after a restart which makes this issue more difficult to test.我很困惑,因为在重新启动后的前几个小时内一切正常,这使得这个问题更难测试。
This seems similar to Error: unable to start png() device in R Shiny Dashboard , which never received a response.这似乎类似于Error: unable to start png() device in R Shiny Dashboard ,它从未收到响应。 I hope the extra detail I provided will help someone to suggest a solution.我希望我提供的额外细节将帮助某人提出解决方案。
I have seen similar behaviour using a ubuntu shiny server and it was traced back to running out of system resources (disk space in my case) which ment that temporary files could not be created.我在使用 ubuntu 闪亮服务器时看到过类似的行为,它可以追溯到系统资源不足(在我的情况下是磁盘空间),这意味着无法创建临时文件。
Your error message ... "unable to open file 'C:\Users\jgerla03\AppData\Local\Temp\Rtmp4QtNQ2\file91819b61552'" looks similar to what I experienced.您的错误消息... “无法打开文件 'C:\Users\jgerla03\AppData\Local\Temp\Rtmp4QtNQ2\file91819b61552'”看起来与我的经历相似。 I'm not familiar with Windows OS but would suggest you look into the possibility that you are running out of disk or memory space..我不熟悉 Windows 操作系统,但建议您调查一下磁盘或内存空间不足的可能性。
Peter彼得
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.