I cant publish any app

402 views
Skip to first unread message

Victor Calzado

unread,
Apr 28, 2018, 5:14:13 PM4/28/18
to shinyapps.io Users
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

Joshua Spiewak

unread,
Apr 29, 2018, 9:50:28 AM4/29/18
to shinyapps.io Users
This line is the problem:

setwd(dirname(rstudioapi::getActiveDocumentContext()$path))

b) the RStudio IDE is not running on shinyapps.io, so you cannot call rstudioapi

Victor Calzado

unread,
Apr 30, 2018, 7:12:37 AM4/30/18
to shinyapps.io Users
And there is another way to set the dir where the app is executed? Yo avoid innecesary execution time I created a var on first execution and save It and next times I load the file that its saved on the same path the script is. (not in this code, on the one I really want to publish)

Very thank you for your response. Ill check It when I can get a better conection than I am using right now.

Joshua Spiewak

unread,
Apr 30, 2018, 8:14:53 AM4/30/18
to shinyapps.io Users
You may not set the directory where the application is executed, but you may use relative paths to access files in your bundle.
There is currently no persistent storage for shinyapps.io (http://docs.rstudio.com/shinyapps.io/Storage.html), but it is something we will add in the future.

Arun Jayaraman

unread,
Aug 8, 2018, 1:28:35 PM8/8/18
to shinyapps.io Users
Hi Joshua,

I have been trying to deploy a Shiny App on Shinyapps.io but always I get the same error response as Victor - "An error has occurred. Check your logs or contact the app author for clarification". So i tried to run with a sample shiny code and tried to deploy it. See the code and the attached log info below. Please advise me on this issue. Thanks!

R Shiny code:

library(rsconnect)
library(shiny)

ui <- fluidPage(
  
  titlePanel("Test Data"),
  
  sidebarLayout(
    sidebarPanel(
      sliderInput("bins",
                  "Number of bins:",
                  min = 1,
                  max = 50,
                  value = 30)
    ),
    
    mainPanel(
      plotOutput("distPlot")
    )
  )
)

server <- function(input, output) {
  
  output$distPlot <- renderPlot({
    x    <- faithful[, 2] 
    bins <- seq(min(x), max(x), length.out = input$bins + 1)
        hist(x, breaks = bins, col = 'darkgray', border = 'white')
  })
}

#shinyApp(ui = ui, server = server)
deployApp(appDir = "../Users/ajayaraman/Desktop/R map/test", appName = 'test', appTitle = "test_wrk")


Logs from the website:

2018-08-07T18:06:08.104935+00:00 shinyapps[396579]:     10: tryCatchOne
2018-08-07T18:06:08.104936+00:00 shinyapps[396579]:      9: tryCatchList
2018-08-07T18:06:08.104936+00:00 shinyapps[396579]:      8: tryCatch
2018-08-07T18:06:08.104937+00:00 shinyapps[396579]:      7: connect$retry
2018-08-07T18:06:08.104937+00:00 shinyapps[396579]:      6: eval
2018-08-07T18:06:08.104938+00:00 shinyapps[396579]:      5: eval
2018-08-07T18:06:08.104940+00:00 shinyapps[396579]:      1: local
2018-08-07T18:06:08.105358+00:00 shinyapps[396579]: Error : An error has occurred. Check your logs or contact the app author for clarification.
2018-08-07T18:06:08.104938+00:00 shinyapps[396579]:      3: eval
2018-08-07T18:06:08.104939+00:00 shinyapps[396579]:      2: eval.parent
2018-08-07T18:06:08.104938+00:00 shinyapps[396579]:      4: eval
2018-08-08T16:01:37.080351+00:00 shinyapps[396579]: Server version: 1.6.6-2
2018-08-08T16:01:37.080352+00:00 shinyapps[396579]: LANG: en_US.UTF-8
2018-08-08T16:01:37.080394+00:00 shinyapps[396579]: shiny version: 1.0.3
2018-08-08T16:01:37.080395+00:00 shinyapps[396579]: rmarkdown version: NA
2018-08-08T16:01:37.080395+00:00 shinyapps[396579]: knitr version: NA
2018-08-08T16:01:37.080395+00:00 shinyapps[396579]: httpuv version: 1.3.3
2018-08-08T16:01:37.080396+00:00 shinyapps[396579]: jsonlite version: 1.5
2018-08-08T16:01:37.080406+00:00 shinyapps[396579]: htmltools version: 0.3.6
2018-08-08T16:01:37.080396+00:00 shinyapps[396579]: RJSONIO version: 1.3.0
2018-08-08T16:01:37.080510+00:00 shinyapps[396579]: Using pandoc at /opt/connect/ext/pandoc2
2018-08-08T16:01:37.080393+00:00 shinyapps[396579]: R version: 3.4.0
2018-08-08T16:01:37.286924+00:00 shinyapps[396579]: Using jsonlite for JSON processing
2018-08-08T16:01:37.388166+00:00 shinyapps[396579]: 
2018-08-08T16:01:37.388169+00:00 shinyapps[396579]: Starting R with process ID: '20'
2018-08-08T16:01:37.447067+00:00 shinyapps[396579]: 
2018-08-08T16:01:37.447071+00:00 shinyapps[396579]: Listening on http://127.0.0.1:41163
2018-08-08T16:01:38.532557+00:00 shinyapps[396579]: 
2018-08-08T16:01:38.532615+00:00 shinyapps[396579]: Attaching package: ‘rsconnect’
2018-08-08T16:01:38.532616+00:00 shinyapps[396579]: 
2018-08-08T16:01:38.533776+00:00 shinyapps[396579]: The following object is masked from ‘package:shiny’:
2018-08-08T16:01:38.533777+00:00 shinyapps[396579]: 
2018-08-08T16:01:38.533778+00:00 shinyapps[396579]:     serverInfo
2018-08-08T16:01:38.533779+00:00 shinyapps[396579]: 
2018-08-08T16:01:40.108733+00:00 shinyapps[396579]: Warning: Error in setwd: cannot change working directory
2018-08-08T16:01:40.112429+00:00 shinyapps[396579]:      6: eval
2018-08-08T16:01:40.112430+00:00 shinyapps[396579]:      5: eval
2018-08-08T16:01:40.112430+00:00 shinyapps[396579]:      4: eval
2018-08-08T16:01:40.112431+00:00 shinyapps[396579]:      3: eval
2018-08-08T16:01:40.112422+00:00 shinyapps[396579]: Stack trace (innermost first):
2018-08-08T16:01:40.112431+00:00 shinyapps[396579]:      2: eval.parent
2018-08-08T16:01:40.112424+00:00 shinyapps[396579]:     53: setwd
2018-08-08T16:01:40.112432+00:00 shinyapps[396579]:      1: local
2018-08-08T16:01:40.112426+00:00 shinyapps[396579]:     13: runApp
2018-08-08T16:01:40.112788+00:00 shinyapps[396579]: Error : An error has occurred. Check your logs or contact the app author for clarification.
2018-08-08T16:01:40.112426+00:00 shinyapps[396579]:     12: fn
2018-08-08T16:01:40.112427+00:00 shinyapps[396579]:     11: doTryCatch
2018-08-08T16:01:40.112428+00:00 shinyapps[396579]:     10: tryCatchOne
2018-08-08T16:01:40.112429+00:00 shinyapps[396579]:      7: connect$retry
2018-08-08T16:01:40.112428+00:00 shinyapps[396579]:      9: tryCatchList
2018-08-08T16:01:40.112428+00:00 shinyapps[396579]:      8: tryCatch

Any help on this would be greatly appreciated.

Thanks!

Joshua Spiewak

unread,
Aug 8, 2018, 1:36:30 PM8/8/18
to shinyapps.io Users
2018-08-08T16:01:40.108733+00:00 shinyapps[396579]: Warning: Error in setwd: cannot change working directory

See the Troubleshooting of the documentation.

Arun Jayaraman

unread,
Aug 8, 2018, 1:50:12 PM8/8/18
to shinyapps.io Users
I tried to use relative path instead of absolute paths, still its showing the setwd error. Also, i ran the code without using the setwd() function and yet it shows the same error. Is this due to some other issue?  Please let me know on this.
Thanks!
Reply all
Reply to author
Forward
0 new messages