Search code examples
shinyshiny-serverrstudio-server

Rstudio Server is Having Issues Deploying an APP


I have some r code and I am having some issues with automatic authentication to access the spreadsheets in a shiny dashboard.

I have set up the servers on a VM and have been able to make r-studio server and shiny-server work. Problem now lies within app deployment. Currently I have been able to do this in a user session. But the problem is not that I am getting redirected to google authentication and it is not allowing me to do that on the server side so the execution halts.

 This is shared with all googleAnalyticsR users. 
 If making a lot of API calls, please: 
 visit: XXXXXXXXXXXXX
 for instructions on setting your own Google Project 
2019-05-05 02:55:52> Set API cache
2019-05-05 02:55:52> No environment argument found, looked in 
GA_AUTH_FILE
2019-05-05 02:55:52> No httr_oauth_cache file found at sc.httr- 
oauth - creating new file.
Error in value[[3L]](cond) : 
  Authentication options didn't match existing session token and 
not interactive session
           so unable to manually reauthenticate
 Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> 
<Anonymous>
Execution halted

The expected results would not showcase an Execution Halted. Furthermore on the server itself it is not really allowing me to actually allow for such extensions. So I am curious if someone had any suggestions. I can also offer the code if needed for the actual app.R.


Solution

  • You need to upload the sc.httr-oauth (or whatever you have called it) authentication token that is generated locally to the script's working directory on the server, so the authentication can find it. You should also make sure the permissions for the file lets Shiny update it.

    You are seeing an error where its looking for the file but it not being present, it then attempts to re-authenticate by launching a browser but as its not a interactive R session it will fail (you can't log in for the OAuth2 flow)

    You can specify the authentication token location in your script via ga_auth("file_location")