I have set up a very basic shiny app and put it into /opt/shiny-server/samples/shiny/
.
Shiny server tries and fails to write to my user directory.
Where does it come from?
It uses that wrong directory even when I set the workingDir explicitly with Sys.setenv(R_USER = "/opt/shiny-server/samples/shiny")
or shiny::shinyOptions(workingDir = '/opt/shiny-server/samples/shiny')
.
My app.R:
library(shiny)
library(bslib)
ui <- navbarPage(
theme = bs_theme(version = 5, bootswatch = 'cyborg'),
title = "Shiny",
id = "main-menu",
tabPanel(
"First tab",
h1("First tab"),
titlePanel("OFGD"),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
plotOutput("distPlot")
)
)
),
tabPanel(
"Second tab :-)",
h1("Second tab")
)
)
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',
xlab = 'Waiting time to next eruption (in mins)',
main = 'Histogram of waiting times')
})
}
shinyApp(ui = ui, server = server)
Last lines in /var/log/shiny-server/shiny-shiny-20240902-083926-46831.log
:
Warning in dir.create(cache_dir, recursive = TRUE) :
cannot create dir '/share/rstudio-home/david/shiny/app_cache', reason 'Permission denied'
Warning in value[[3L]](cond) :
Error using cache directory at '/share/rstudio-home/david/shiny/app_cache/sass'. Using temp dir instead.
This directory seems not to be set anywhere and still overrides every setting I try to give in the shiny app.
Also, I don't understand, where the sass comes from. I am not explicitly calling it in my code.
Can anyone help?