0
votes

I have been trying to deploy a Shiny App on Shinyapps.io but always I have the same response:ERROR: An error has occurred. Check your logs or contact the app author for clarification. . At first, I tried it with my own app, but I give up and I though that my app had an error. Then I get a very simple app from internet that only have a few code lines and... surprise!, It didnt work. I don't know why, because I followed all the steps and I am seeing the app on my local window. So I checked relative paths, etc, and none were used. Logs neither help so I dont know what more to do. Please any advice could be useful. Many thanks

This is the R shiny code:

ui.R

library(shinydashboard)
library(rsconnect)


setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
deployApp()
ui <- dashboardPage(
  dashboardHeader(title = "Info boxes"),
  dashboardSidebar(),
  dashboardBody(
    # infoBoxes with fill=FALSE
    fluidRow(
      # A static infoBox
      infoBox("New Orders", 10 * 2, icon = icon("credit-card")),
      # Dynamic infoBoxes
      infoBoxOutput("progressBox"),
      infoBoxOutput("approvalBox")
    ),

    # infoBoxes with fill=TRUE
    fluidRow(
      infoBox("New Orders", 10 * 2, icon = icon("credit-card"), fill = TRUE),
      infoBoxOutput("progressBox2"),
      infoBoxOutput("approvalBox2")
    ),

    fluidRow(
      # Clicking this will increment the progress amount
      box(width = 4, actionButton("count", "Increment progress"))
    )
  )
)

server.R

server <- function(input, output) {
  output$progressBox <- renderInfoBox({
    infoBox(
      "Progress", paste0(25 + input$count, "%"), icon = icon("list"),
      color = "purple"
    )
  })
  output$approvalBox <- renderInfoBox({
    infoBox(
      "Approval", "80%", icon = icon("thumbs-up", lib = "glyphicon"),
      color = "yellow"
    )
  })

  # Same as above, but with fill=TRUE
  output$progressBox2 <- renderInfoBox({
    infoBox(
      "Progress", paste0(25 + input$count, "%"), icon = icon("list"),
      color = "purple", fill = TRUE
    )
  })
  output$approvalBox2 <- renderInfoBox({
    infoBox(
      "Approval", "80%", icon = icon("thumbs-up", lib = "glyphicon"),
      color = "yellow", fill = TRUE
    )
  })
}

Logs:

    2018-04-26T16:47:00.598156+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.608370+00:00 shinyapps[331049]: The following object is masked from ‘package:shiny’:
2018-04-26T16:47:00.608017+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.608371+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.608019+00:00 shinyapps[331049]: Attaching package: ‘rsconnect’
2018-04-26T16:47:00.608371+00:00 shinyapps[331049]:     serverInfo
2018-04-26T16:47:00.598159+00:00 shinyapps[331049]: Attaching package: ‘shinydashboard’
2018-04-26T16:47:00.608372+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.598161+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.612987+00:00 shinyapps[331049]: Warning: Error in : RStudio not running
2018-04-26T16:47:00.617053+00:00 shinyapps[331049]:     12: fn
2018-04-26T16:47:00.598930+00:00 shinyapps[331049]: The following object is masked from ‘package:graphics’:
2018-04-26T16:47:00.617046+00:00 shinyapps[331049]: Stack trace (innermost first):
2018-04-26T16:47:00.617054+00:00 shinyapps[331049]:     11: doTryCatch
2018-04-26T16:47:00.598932+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.617048+00:00 shinyapps[331049]:     58: verifyAvailable
2018-04-26T16:47:00.617054+00:00 shinyapps[331049]:     10: tryCatchOne
2018-04-26T16:47:00.598933+00:00 shinyapps[331049]:     box
2018-04-26T16:47:00.617048+00:00 shinyapps[331049]:     57: callFun
2018-04-26T16:47:00.617054+00:00 shinyapps[331049]:      9: tryCatchList
2018-04-26T16:47:00.617051+00:00 shinyapps[331049]:     55: rstudioapi::getActiveDocumentContext
2018-04-26T16:47:00.617055+00:00 shinyapps[331049]:      7: connect$retry
2018-04-26T16:47:00.617052+00:00 shinyapps[331049]:     54: dirname
2018-04-26T16:47:00.617056+00:00 shinyapps[331049]:      6: eval
2018-04-26T16:47:00.617052+00:00 shinyapps[331049]:     53: setwd
2018-04-26T16:47:00.617053+00:00 shinyapps[331049]:     13: runApp
2018-04-26T16:47:00.598934+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.617049+00:00 shinyapps[331049]:     56: getDocumentContext
2018-04-26T16:47:00.617055+00:00 shinyapps[331049]:      8: tryCatch
2018-04-26T16:47:00.608019+00:00 shinyapps[331049]: 
2018-04-26T16:47:00.617057+00:00 shinyapps[331049]:      4: eval
2018-04-26T16:47:00.617057+00:00 shinyapps[331049]:      3: eval
2018-04-26T16:47:00.617057+00:00 shinyapps[331049]:      2: eval.parent
2018-04-26T16:47:00.617058+00:00 shinyapps[331049]:      1: local
2018-04-26T16:47:00.617405+00:00 shinyapps[331049]: Error : An error has occurred. Check your logs or contact the app author for clarification.
2018-04-26T16:47:00.617056+00:00 shinyapps[331049]:      5: eval
1
Do you see a rsconnect folder in your app folder with a .dcf file?CPak
Yes. the .dcf file is in rsconnect/shinyapps.io/myuser/VCM

1 Answers

0
votes

Solved. I post here how I could do it to help anyone with the same problem. First of all, my main problem was to not understand well how the Dockerfile worked so after some documentation I saw I wasn't adding a package needed for Shiny Server.

This page: https://www.linode.com/docs/development/r/how-to-deploy-rshiny-server-on-ubuntu-and-debian/ help me a lot.

Also, I recommend use command "sudo R" and try first each R installation packages to see what is happening in every moment (I made the app in RStudio, so I didn't know which packages -like libssl-dev - were needed) . This way you can see all logs easily and be able to know what packages you did not include and have to be in the Dockerfile