Shiny App Deployment - Error (cannot change working directory) - r

I have been trying to deploy a shiny app using rsconnect: deployapp(appname = "myapp"). I get the following message at the command prompt:
Application successfully deployed to https://sitename.shinyapps.io/MyApp/
However, when I launch the app, I get the error message:
ERROR: cannot change working directory
Based on resolution to similar problem on both Stackoverflow and googleforum, I tried using both absolute and relative paths in setwd(). Following are the error messages with both absolute and relative paths to setwd():
Error in setwd("~/Data/Projects/MyApp"): cannot change working directory
Error in setwd("C:/Users/Documents/Data/Projects/MyApp"): cannot change working directory
Any suggestions to resolve the issue would be greatly appreciated. thanks in advance!

shinyapps.io is a virtualized container service running shiny apps.
It is most likely linux based. I do not have the time to write up a
shiny app to confirm that but like most virtualized containers let
us assume it is.
With 1 being say true. Paths like C:/ do not make sense in the linux world.
Again with 1 in mind the directory structure of ~/Data might not exist.
Work with relative paths ~/ Also put a checkguard with dir.exists() and dir.create
dirname <- '~/Data/Projects/MyApp'
if (!dir.exists(dirname))dir.create(dirname,recursive=TRUE)
FYI I don't really think your should be doing any setwd() for shinyapps. If the data file is is in ~/Data/Projects/Myapp/somedata.csv you can do a direct read in the app as read.csv('somedata.csv').
The server directory structure is in the form of /srv/shiny-server/MyShinyApp when you upload

Error in setwd("c:/nonexistent_directory_path") : cannot change working directory
This error message will be generated when a directory does not exist. Verify that directory does in fact exist (ie: check spelling, typos).

Related

Where to place my R scripts in serv/shiny-server

I have uploaded my app scripts into srv/shiny-server as dashboard_test. But i am not able to run it. While looking into the error log I am receiving this.
Error getting worker: Error: The application exited during initialization.
Also One thing I noticed, the scripts for sample app is placed on opt/shiny-server/samples/sample-apps/hello. I tried putting there but i don't have the permission for that.Do i need to put them there as well? while,
I am following this article where it says "Any Shiny app directory that you place under /srv/shiny-server/ will be served as a Shiny app " it should work. https://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/#user-libraries
I am trying to understand what is going wrong.
Please find the image here

Shiny app working locally but not deployed on shinyapps.io

I'm in a difficult situation to figure out how to publish shiny app online.
Can't find any solution in the older questions.
The app works locally perfect but its impossible to put it online.
when I run the log, show just this:
Error in serverInfo(server) : server named 'rpubs.com' does not exist
on the part
"Markers": Line 14 - Paths should be to files within the project
directory. Error in sheets_fun(path) : Evaluation error:
path[1]="database.xls".
The file *.xlsx is already in the same folder of the *rmd.
Could any one help me I have no idea how to solve this issue. I'm now in two weeks trying to solve this.
that is to grab a job, and I will appreciate a lot if anyone tell me how to make it works

ShinyApp : Connection Reset By Peer

The shinyapp I built earlier was running fine in my old laptop. Recently I got a new laptop with Windows10. After setting up everything, I tried to run the app but it the browser opens and closes immediately with the error :
Listening on http://127.0.0.1:5004
ERROR: [on_request_read] connection reset by peer
I have also set chrome as default browser....
I deployed this app in shinyapps.io it is working fine there.
I tried few more simple apps in Rstudio but the same issue coming. Looks like the issue is more related to some setting in Windows10. Can someone help me please.
Thanks in Advance.....
Without details on the specific code, I'd share my personal experience with the same error for your reference. In my case, I used RStudio to create a shiny app that save data to a local directory on my computer, while I told R to output files to directory "response", I hadn't created such directory under the working directory so came the error. Simply creating the sub directory named "response" solve this right away. Or for moving your project files to different places in the future, you can just check whether the folder exists, if not, create one shall save you a lot of time.

"qtCored4.dll was not found" when running the application outside console.what could be wrong?

when running the application from inside the mingw console, it executes without any issue. But when I try to execute the same exe file in the debug folder of windows explorer, it says QtCored4.dll was not found. I even added the bin folder location to the environment variables, but then that produces another error saying : The procedure entry point _Z5qFreePv could not be located in the dynamic link lib... .So, can anyone give me a hint on how to solve this problem? Thanks.
As nax83 pointed out above, the problem was the path variable ambiguity due to multiple version of qt installed on my system. I removed all other qt-related values from my path variable and then explicitly specified all the paths to one single version. Recompiled and built the application, and there was my application, running without any jerks and problems.

Can't Write Configuration File

I have been unsuccessful in getting Aptana 3.0.8 to start. I keep getting the error
The configuration area at 'C:\Users\Devon\.eclipse\com.aptana.rcp.product_3.0.8.201201201658_68819209\configuration' is not writable. Please choose a writable location using the '-configuration' command line option.
I have used the -configuration command within the target area of my shortcut to point to two different locations at two different times.
First I made a folder in the root of my drive and made sure that it was writable, but still got the same error, except it would say that the folder I specified was not writable instead of listing the folder in the above error.
I also tried to point it to write to a mapped network drive via my server and it still gave me the same error.
I have read other posts on this site and none of the resolutions solved my issue. I also went into my local appdata folder and changed the path of the default workspace location within the config.ini folder and changed it to a directory that does not have spaces in its name in hopes that would resolve the issue.
I really needed to work on my business website and thus have installed Aptana 2 in the mean time because that seems to be working without any issues. However I would really like to be able to get Aptana 3 working.
I am running Windows 7 Pro x64
Thanks in advance for any help provided here

Resources