簡體   English   中英

閃亮服務器無法打開與任何閃亮應用程序的連接

[英]Shiny Server unable to open connection to any shiny application

當我嘗試連接到Web服務器上的任何閃亮應用程序時,都會收到以下錯誤消息:

   ERROR: cannot open the connection

我當前將應用程序存儲在服務器上的/ srv / shiny-server文件夾中,並且該文件夾當前具有正確的讀/寫權限。 早些時候,當我上傳我的應用程序時,它沒有問題,但是做了一些更改,並且當我更新文件時,突然開始出現此錯誤。 我嘗試回滾所有更改,但錯誤仍然存​​在,因此最終我嘗試從Shiny網站上載示例應用程序,並且也收到相同的錯誤。

這是我當前正在嘗試工作的示例應用程序的代碼,但我認為這不是問題所在:

ui.R

    library(shiny)

bootstrapPage(

  selectInput(inputId = "n_breaks",
              label = "Number of bins in histogram (approximate):",
              choices = c(10, 20, 35, 50),
              selected = 20),

  checkboxInput(inputId = "individual_obs",
                label = strong("Show individual observations"),
                value = FALSE),

  checkboxInput(inputId = "density",
                label = strong("Show density estimate"),
                value = FALSE),

  plotOutput(outputId = "main_plot", height = "300px"),

  # Display this only if the density is shown
  conditionalPanel(condition = "input.density == true",
                   sliderInput(inputId = "bw_adjust",
                               label = "Bandwidth adjustment:",
                               min = 0.2, max = 2, value = 1, step = 0.2))
  )

server.R

library(shiny)


function(input, output) {

  output$main_plot <- renderPlot({

    hist(faithful$eruptions,
         probability = TRUE,
         breaks = as.numeric(input$n_breaks),
         xlab = "Duration (minutes)",
         main = "Geyser eruption duration")

    if (input$individual_obs) {
      rug(faithful$eruptions)
    }

    if (input$density) {
      dens <- density(faithful$eruptions,
                      adjust = input$bw_adjust)
      lines(dens, col = "blue")
    }

  })
}

我打開了位於/ var / log / shiny-server中的應用程序的日志,結果是該文件夾的權限被拒絕。 谷歌搜索問題后,我發現了這個問題 ,可以幫助我解決問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM