简体   繁体   中英

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.

In the last couple of weeks, the applications started to fail loading plots with the error:

unable to start png() device.

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. 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). 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).

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. 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.

Your error message ... "unable to open file 'C:\Users\jgerla03\AppData\Local\Temp\Rtmp4QtNQ2\file91819b61552'" looks similar to what I experienced. 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..

Peter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM