Accessing googlesheets on deployed Shinyapp crashes the server

64 views
Skip to first unread message

Uni A

unread,
Jul 11, 2016, 12:20:59 PM7/11/16
to ShinyApps Users
Hi, 

My app is basically a form which asks users for information. Then when user presses submit button, it stores that information to a "published" google sheet. The app works fine locally. All data is captured, saved etc. But when I try to run the deployed version, as soon as user presses submit after entering the data, the app "disconnects from server". Here is the link to the app: https://dssg-pathways.shinyapps.io/ExperimentingWithForms/

Please advise
Thanks

Tareef Kawaf

unread,
Jul 11, 2016, 12:23:06 PM7/11/16
to Uni A, ShinyApps Users
Do you see any errors when you look at rsconnect::showLogs() or if you look at the logs for the application in the shinyapps.io dashboard?

--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/58918c24-9e69-46ee-b0a9-692dba55700a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Uni A

unread,
Jul 11, 2016, 12:40:52 PM7/11/16
to ShinyApps Users, unaiza...@gmail.com
I've attached the log file here. As far as I can see, there is this line here: 

Warning: Error in : 'text' is not an exported object from 'namespace:shinyjs'

which may be causing the problem. However I don't know why. 

I also have no errors when I run it locally. 

Thanks
logs.txt

Joshua Spiewak

unread,
Jul 11, 2016, 12:50:04 PM7/11/16
to ShinyApps Users, unaiza...@gmail.com
What code is on line 178 of app.R?

2016-07-11T16:37:58.965789+00:00 shinyapps[113422]: Stack trace (innermost first):
2016-07-11T16:37:58.965791+00:00 shinyapps[113422]:     81: getExportedValue
2016-07-11T16:37:58.965793+00:00 shinyapps[113422]:     80: ::
2016-07-11T16:37:58.965794+00:00 shinyapps[113422]:     79: value[[3L]] [/srv/connect/apps/ExperimentingWithForms/app.R#178]
2016-07-11T16:37:58.965795+00:00 shinyapps[113422]:     78: tryCatchOne
2016-07-11T16:37:58.965796+00:00 shinyapps[113422]:     77: tryCatchList
2016-07-11T16:37:58.965797+00:00 shinyapps[113422]:     76: tryCatch
2016-07-11T16:37:58.965799+00:00 shinyapps[113422]:     75: observeEventHandler [/srv/connect/apps/ExperimentingWithForms/app.R#171]
2016-07-11T16:37:58.965803+00:00 shinyapps[113422]:     10: tryCatchOne
2016-07-11T16:37:58.965804+00:00 shinyapps[113422]:      9: tryCatchList
2016-07-11T16:37:58.965805+00:00 shinyapps[113422]:      8: tryCatch
2016-07-11T16:37:58.965806+00:00 shinyapps[113422]:      7: connect$retry
2016-07-11T16:37:58.965807+00:00 shinyapps[113422]:      6: eval
2016-07-11T16:37:58.965808+00:00 shinyapps[113422]:      5: eval
2016-07-11T16:37:58.965800+00:00 shinyapps[113422]:     12: fn
2016-07-11T16:37:58.965802+00:00 shinyapps[113422]:     11: doTryCatch
2016-07-11T16:37:58.965812+00:00 shinyapps[113422]:      1: local
2016-07-11T16:37:58.965800+00:00 shinyapps[113422]:     13: runApp
2016-07-11T16:37:58.965808+00:00 shinyapps[113422]:      4: eval
2016-07-11T16:37:58.965810+00:00 shinyapps[113422]:      3: eval
2016-07-11T16:37:58.965811+00:00 shinyapps[113422]:      2: eval.parent

Uni A

unread,
Jul 11, 2016, 1:02:39 PM7/11/16
to ShinyApps Users, unaiza...@gmail.com
This is the code snippet from app.R

error = function(err) {
          shinyjs::text("error_msg", err$message) # line 178
          shinyjs::show(id = "error", anim = TRUE, animType = "fade")

I've commented which line is 178. 

Thanks

Joshua Spiewak

unread,
Jul 11, 2016, 2:45:47 PM7/11/16
to ShinyApps Users, unaiza...@gmail.com
What version of shinyjs do you have installed? Where did you install it from? The one on CRAN does not appear to have either a "text" or a "show" function.

What is the output of "devtools::session_info()" and "rsconnect::appDependencies()"?

Uni A

unread,
Jul 11, 2016, 4:04:54 PM7/11/16
to ShinyApps Users, unaiza...@gmail.com
I commented those lines out..

That's when I discovered the error:

oauth_listener() needs an interactive environment


So it is something to do with authentication.. !

Tareef Kawaf

unread,
Jul 11, 2016, 4:11:36 PM7/11/16
to Uni A, ShinyApps Users
Right, you will need t get an oauth token with your application, unfortunately there is a bug in the IDE today that i won't upload files with '.' to start with, but the rsconnect::deployApp() should handle it properly.


Uni A

unread,
Jul 11, 2016, 4:27:07 PM7/11/16
to ShinyApps Users, unaiza...@gmail.com
I just found that out.. deployed the app via the rsconnect command.. and the error got resolved. However, I again ran into a server crash and now the log looks like this:

2016-07-11T20:24:02.390753+00:00 shinyapps[113422]: Starting R with process ID: '18'
2016-07-11T20:24:02.408180+00:00 shinyapps[113422]: 
2016-07-11T20:24:02.408185+00:00 shinyapps[113422]: Listening on http://0.0.0.0:58062
2016-07-11T20:24:02.867304+00:00 shinyapps[113422]: Loading required package: ggplot2
2016-07-11T20:24:41.881359+00:00 shinyapps[113422]: Sheet-identifying info appears to be a browser URL.
2016-07-11T20:24:41.881362+00:00 shinyapps[113422]: googlesheets will attempt to extract sheet key from the URL.
2016-07-11T20:24:41.886157+00:00 shinyapps[113422]: Putative key: 1IrpR8SMU_LMM6RHuF2AuwX-bg3JUudRvNr6Wnt858dc
2016-07-11T20:24:42.226047+00:00 shinyapps[113422]: Auto-refreshing stale OAuth token.
2016-07-11T20:24:43.953955+00:00 shinyapps[113422]: Sheet successfully identified: "Apartment Updates - Responses - NAP"
2016-07-11T20:24:44.548231+00:00 shinyapps[113422]: Row successfully appended.
2016-07-11T20:24:48.322866+00:00 shinyapps[113422]: Sheet-identifying info appears to be a browser URL.
2016-07-11T20:24:48.322869+00:00 shinyapps[113422]: googlesheets will attempt to extract sheet key from the URL.
2016-07-11T20:24:48.324270+00:00 shinyapps[113422]: Putative key: 1IrpR8SMU_LMM6RHuF2AuwX-bg3JUudRvNr6Wnt858dc
2016-07-11T20:24:49.329989+00:00 shinyapps[113422]: Sheet successfully identified: "Apartment Updates - Responses - NAP"
2016-07-11T20:24:49.497475+00:00 shinyapps[113422]: Accessing worksheet titled 'Sheet1'.
2016-07-11T20:24:49.832885+00:00 shinyapps[113422]: No encoding supplied: defaulting to UTF-8.
2016-07-11T20:24:49.957149+00:00 shinyapps[113422]: Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=1122%20State%20Street%20NW%20Atlanta%20GA%2030318&sensor=false
Reply all
Reply to author
Forward
0 new messages