Shiny, tmp file error

I just opened my shiny app, and all I see is:

ERROR: cannot open the connection

In the log file I see this:

01-21 08:41:59: Warning in file(open = "w+") :
  cannot open file '/tmp/Rtmp59oXbx/Rf6d491630fdb4': No such file or directory
01-21 08:41:59: Warning: Error in file: cannot open the connection
01-21 08:41:59:   [No stack trace available]

My questions:

  • any idea why this happens, and how I could avoid it?
  • alternatively, it would be enough that the application, upon this error, dies instead of keeping running (so that a new one is started automatically). Can this be accomplished?
1 Like

We are going to need more information to help you. Where are you deploying your app? Does your app run locally? What is the code of your app? Do you have checked you have proper permissions in your apps folder?

Hey, thanks for getting back :slight_smile:

The app is running on an AWS instance with Amazon Linux, and it's standalone (no shiny server: I just run Rscript -e "shiny::runApp()" and manage the instances via pm2).
Then it's served through an haproxy instance (in this case, there's only one server in the backend).

The code is quite large, so I'm not sure what to tell you, but if you have questions in particular I'll be happy to specify.

As for permissions, yes, all seems in order (besides, the error is for a file in /tmp, which should not have any problems of that kind).

I found a reference in some Stack Exchange question, saying that the temporary file (created directly by Shiny) was deleted for some reason, but I don't see how it could happen in my case.

I think the problem happens when the app has been idling for a while (in this case, the latest log entry before the ones I posted above are from about 24 hours earlier). Does that help?

1 Like

@andresrcs does that give you any useful hint?

I'm not sure, since I'm not familiar with the deployment approach you are using, I just use shiny-server for deployment. (Also in a EC2 AWS instance but with Ubuntu because it's officially supported by shiny server).

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.