shinyFilesButton, in R shiny, does not appear work properly on Ubuntu 18

I have developed an R shiny app that has a file explorer to select files. I developed this code with R (3.4.4) in Ubuntu 16.04 on a Latitude E6430. I have of course tested it and it works on the original system. The goal is to have this app be portable and be run on another another computer and be set up and used quickly and easily. So i moved the files onto an intel NUC and installed R and Rstudio (using command line;see installation instructions below). On the NUC, the code breaks. Specifically, the app runs, but when I click on the file explorer (made with function "shinyFilesButton"), the app and Rstudio immediately and quietly crash with no apparent error log. I have no idea what is going on aside from finding SIGABRT error was raised.

Installation instructions:

# install R,Rsudio,Rmarkdown and other Related packages
sudo apt-get install libopenblas-base r-base r-recommended

	
# 64 bit
sudo apt-get install gdebi
sudo wget https://download1.rstudio.org/rstudio-xenial-1.1.419-amd64.deb
sudo gdebi rstudio-xenial-1.1.419-amd64.deb
Rscript -e 'install.packages(c("rmarkdown","shiny","shinyFiles","glue","stringr","reticulate"))'

#####strippedexample.Rmd

#---
#title: "Generate Report"
#runtime: shiny
#output: html_notebook
#---

knitr::opts_chunk$set(echo=TRUE)
library(reticulate) # <- only needed to run python
library(shinyFiles)
library(glue)
library(stringr)

ui <- fluidPage(
   sidebarLayout(
    sidebarPanel(
  shinyFilesButton("Btn_GetFile", "Choose forward fastq" ,
                   title = "Please select a file:", multiple = TRUE,
                   buttonType = "default"),
  br(),br(),br(),selectInput("Selected_Panel", "Select Panel", choices = c("ba","bu","ye")),
  br(),br(),actionButton("Start", "Begin Analysis")
  ),
  mainPanel(
      br(),textOutput("fwdftext"),
      br(),textOutput("revftext"),
      br(),br(),textOutput("paneltext")
    ))
)

rvs <- reactiveValues() #renamed to rvs
server <- function(input,output,session){
  volumes = getVolumes()
  observe({  
    shinyFileChoose(input, "Btn_GetFile", roots = volumes, session = session)

    req(input$Btn_GetFile)
    req(input$Selected_Panel)
    req(input$Start)
    
    fwd_selected <- parseFilePaths(volumes, input$Btn_GetFile)
    rvs$fwdfastq <- as.character(fwd_selected$datapath)
    if (str_detect(rvs$fwdfastq,"R1")){rvs$revfastq <- str_replace(rvs$fwdfastq,"R1","R2")}
    if (str_detect(rvs$fwdfastq,"R2")){rvs$revfastq <- str_replace(rvs$fwdfastq,"R2","R1")}
    rvs$panopt <- as.character(input$Selected_Panel)
    rvs$start <- input$Start
    output$fwdftext <- renderText({paste("Entered Forward File:", rvs$fwdfastq)})
    output$revftext <- renderText({paste("Matched Reverse File:", rvs$revfastq)})
    output$paneltext <- renderText({paste("Entered Panel:", rvs$panopt)})

  })
  observeEvent(input$Start, {
        print(input$Start)
        if(input$Start>1)({
          print("start something else")
                  })
  })
  
}
observe({
  req(rvs$fwdfastq)
  req(rvs$revfastq)
  req(rvs$panopt)
  req(rvs$start)
})

shinyApp(ui = ui, server = server)

Can anyone figure out why the code is breaking on Ubuntu 18 but not on Ubuntu 16? I am unsure how to trace the issue any further since I cant seem to find error logs after the crash.

Edit: So I installed Ubuntu 16 on a NUC and have found that my shiny app works up to the point of the file explorer being usable and the submit job button working. however the app just hangs there and does nothing, might someone have an insight as to why a shiny app might hang like that?

welcome @ags_biofx_sci, I am wondering if you are running the shiny app in your browser ("Run external") or in RStudio itself? If you are running the app inside the browser, did you look for error messages in the browser console? It might be something to do with javascript or outdated packages.

you might want to have a look at the shinyFiles github repository, I noted an issue on Ubuntu 14

I am running Ubuntu 19.04 and I have no problems executing the app

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.