Error deploying shiny app

leaflet
rstudio
shiny-server

#1

Hi there,
I cannot figure out why my app deploys to the server, but does not appear on the page. Instead I get a blank page with: "Error : An error has occurred. Check your logs or contact the app author for clarification."

The app works fine when I run it locally.

I have stripped it to the bare leaflet bones, and it still does not run.

Here are my log files. Any help is much appreciated!
Note: There definitely is a file called "take_action.md" in that location, and it works locally.

2018-03-22T00:26:23.802597+00:00 shinyapps[304597]: Server version: 1.5.14-6
2018-03-22T00:26:23.802622+00:00 shinyapps[304597]: LANG: en_US.UTF-8
2018-03-22T00:26:24.034215+00:00 shinyapps[304597]:
2018-03-22T00:26:24.034217+00:00 shinyapps[304597]: Starting R with process ID: '17'
2018-03-22T00:26:23.936823+00:00 shinyapps[304597]: Using jsonlite for JSON processing
2018-03-22T00:26:23.802624+00:00 shinyapps[304597]: R version: 3.4.3
2018-03-22T00:26:23.802626+00:00 shinyapps[304597]: shiny version: 1.0.5
2018-03-22T00:26:23.802626+00:00 shinyapps[304597]: rmarkdown version: NA
2018-03-22T00:26:23.802627+00:00 shinyapps[304597]: knitr version: NA
2018-03-22T00:26:23.802627+00:00 shinyapps[304597]: jsonlite version: 1.5
2018-03-22T00:26:23.802640+00:00 shinyapps[304597]: RJSONIO version: NA
2018-03-22T00:26:23.802640+00:00 shinyapps[304597]: htmltools version: 0.3.6
2018-03-22T00:26:24.067790+00:00 shinyapps[304597]:
2018-03-22T00:26:24.067792+00:00 shinyapps[304597]: Listening on http://127.0.0.1:44976
2018-03-22T00:26:38.246237+00:00 shinyapps[304597]:
2018-03-22T00:26:38.246241+00:00 shinyapps[304597]: Attaching package: ‘shinydashboard’
2018-03-22T00:26:38.246242+00:00 shinyapps[304597]:
2018-03-22T00:26:38.247057+00:00 shinyapps[304597]: The following object is masked from ‘package:graphics’:
2018-03-22T00:26:38.308246+00:00 shinyapps[304597]: 70: markdown::markdownToHTML
2018-03-22T00:26:38.247060+00:00 shinyapps[304597]: box
2018-03-22T00:26:38.308244+00:00 shinyapps[304597]: 72: tryCatch
2018-03-22T00:26:38.247060+00:00 shinyapps[304597]:
2018-03-22T00:26:38.308245+00:00 shinyapps[304597]: 71: renderMarkdown
2018-03-22T00:26:38.308244+00:00 shinyapps[304597]: 73: tryCatchList
2018-03-22T00:26:38.308249+00:00 shinyapps[304597]: 65: tabPanel
2018-03-22T00:26:38.308249+00:00 shinyapps[304597]: 64: shiny::tabsetPanel
2018-03-22T00:26:38.308250+00:00 shinyapps[304597]: 63: tabBox
2018-03-22T00:26:38.247059+00:00 shinyapps[304597]:
2018-03-22T00:26:38.308246+00:00 shinyapps[304597]: 69: includeMarkdown
2018-03-22T00:26:38.308242+00:00 shinyapps[304597]: Stack trace (innermost first):
2018-03-22T00:26:38.308247+00:00 shinyapps[304597]: 68: tag
2018-03-22T00:26:38.308250+00:00 shinyapps[304597]: 62: tag
2018-03-22T00:26:38.303115+00:00 shinyapps[304597]: cannot open file '../docs/take_action.md': No such file or directory
2018-03-22T00:26:38.308248+00:00 shinyapps[304597]: 67: tags$div
2018-03-22T00:26:38.308243+00:00 shinyapps[304597]: 74: readLines
2018-03-22T00:26:38.308248+00:00 shinyapps[304597]: 66: div
2018-03-22T00:26:38.303112+00:00 shinyapps[304597]: Warning in readLines(con) :
2018-03-22T00:26:38.308252+00:00 shinyapps[304597]: 59: fluidRow
2018-03-22T00:26:38.303657+00:00 shinyapps[304597]: Warning: Error in readLines: cannot open the connection
2018-03-22T00:26:38.308252+00:00 shinyapps[304597]: 58: tag
2018-03-22T00:26:38.308251+00:00 shinyapps[304597]: 61: tags$div
2018-03-22T00:26:38.308251+00:00 shinyapps[304597]: 60: div
2018-03-22T00:26:38.308252+00:00 shinyapps[304597]: 57: tags$section
2018-03-22T00:26:38.308253+00:00 shinyapps[304597]: 56: tag
2018-03-22T00:26:38.308253+00:00 shinyapps[304597]: 55: tags$div
2018-03-22T00:26:38.308254+00:00 shinyapps[304597]: 54: div
2018-03-22T00:26:38.308254+00:00 shinyapps[304597]: 53: dashboardBody
2018-03-22T00:26:38.308254+00:00 shinyapps[304597]: 13: runApp
2018-03-22T00:26:38.308255+00:00 shinyapps[304597]: 12: fn
2018-03-22T00:26:38.308255+00:00 shinyapps[304597]: 11: doTryCatch
2018-03-22T00:26:38.308256+00:00 shinyapps[304597]: 10: tryCatchOne
2018-03-22T00:26:38.308256+00:00 shinyapps[304597]: 9: tryCatchList
2018-03-22T00:26:38.308257+00:00 shinyapps[304597]: 8: tryCatch
2018-03-22T00:26:38.308257+00:00 shinyapps[304597]: 7: connect$retry
2018-03-22T00:26:38.308257+00:00 shinyapps[304597]: 6: eval
2018-03-22T00:26:38.308258+00:00 shinyapps[304597]: 4: eval
2018-03-22T00:26:38.308258+00:00 shinyapps[304597]: 5: eval
2018-03-22T00:26:38.308258+00:00 shinyapps[304597]: 3: eval
2018-03-22T00:26:38.308259+00:00 shinyapps[304597]: 2: eval.parent
2018-03-22T00:26:38.308633+00:00 shinyapps[304597]: Error : An error has occurred. Check your logs or contact the app author for clarification.
2018-03-22T00:26:38.308259+00:00 shinyapps[304597]: 1: local


#2

Are you sure that the .md document you are referencing is being published to ShinyApps.io with your application? The error is that the markdown file cannot be found on shinyapps.io. This has no bearing on whether the file exists locally on your computer. It needs to be uploaded in the application bundle when publishing.

Specifically, I expect that the following elements are worth focusing on:

2018-03-22T00:26:38.303115+00:00 shinyapps[304597]: cannot open file '../docs/take_action.md': No such file or directory
2018-03-22T00:26:38.303112+00:00 shinyapps[304597]: Warning in readLines(con) :
2018-03-22T00:26:38.303657+00:00 shinyapps[304597]: Warning: Error in readLines: cannot open the connection
2018-03-22T00:26:38.308633+00:00 shinyapps[304597]: Error : An error has occurred. Check your logs or contact the app author for clarification.

Usually, dependent files are published in "subdirectories" of the app folder along with the application. i.e. referencing "../docs/take_action.md" means that the markdown file is not in a subdirectory, since ../ moves up the parent folder. Try moving the .md to a subdirectory, changing the relative path to point to its new location, and publishing the .md file along with the application.

Some more information on troubleshooting deployments can be found here:


#3

Thanks @cole. I didn't realize all the files and data had to be stored in the same folder as the webapp. Makes sense!