Trying to publish a shiny app (directory problems)

Hello,

I am trying to publish a Shiny app using rsconnect but I get this error message:

----- Deployment error -----
Error in file(con, "w") : cannot open the connection
Calls: <Anonymous> ... snapshotDependencies -> addPackratSnapshot -> writeLines -> file
 
----- Error stack trace -----
9: file(con, "w")
8: writeLines(extraPkgDeps, tempDependencyFile)
7: addPackratSnapshot(appDir, implicit_dependencies)
6: snapshotDependencies(appDir, inferDependencies(appMode, hasParameters))
5: createAppManifest(bundleDir, appMode, contentCategory, hasParameters, 
       appPrimaryDoc, assetTypeName, users)
4: bundleApp(target$appName, appDir, appFiles, appPrimaryDoc, assetTypeName, 
       contentCategory, verbose)
3: force(code)
2: withStatus(paste0("Uploading bundle for ", assetTypeName, ": ", 
       application$id), {
       bundlePath <- bundleApp(target$appName, appDir, appFiles, 
           appPrimaryDoc, assetTypeName, contentCategory, verbose)
       if (isShinyapps(accountDetails)) {
           bundleSize <- file.info(bundlePath)$size
           checkSum <- digest::digest(bundlePath, "md5", file = TRUE)
           bundle <- client$createBundle(application$id, "application/x-tar", 
               bundleSize, checkSum)
           if (verbose) 
               timestampedLog("Starting upload now")
           if (!uploadBundle(bundle, bundleSize, bundlePath)) {
               stop("Could not upload file.")
           }
           if (verbose) 
               timestampedLog("Upload complete")
           response <- client$updateBundleStatus(bundle$id, status = "ready")
           bundle <- client$getBundle(bundle$id)
       }
       else {
           bundle <- client$uploadApplication(application$id, bundlePath)
       }
   })
1: rsconnect::deployApp(appDir = "Z:/Pipelines/PruebasLaura/Prova_connexio", 
       appFileManifest = "C:/Users/lmuinos/AppData/Local/Temp/3b96-c17e-5a05-7ecf", 
       account = "vhiogen", server = "shinyapps.io", appName = "Prova_connexio", 
       appTitle = "Prova_connexio", launch.browser = function(url) {
           message("Deployment completed: ", url)
       }, lint = FALSE, metadata = list(asMultiple = FALSE, asStatic = FALSE), 
       logLevel = "verbose")
Error in file(con, "w") : cannot open the connection
Calls: <Anonymous> ... snapshotDependencies -> addPackratSnapshot -> writeLines -> file
Adem�s: Warning messages:
1: In dir.create(bundleDir, recursive = TRUE) :
  cannot create dir 'C:\', reason 'Permission denied'
2: In dir.create(dirname(to), recursive = TRUE) :
  cannot create dir 'C:\', reason 'Permission denied'
3: In file.create(to[okay]) :
  cannot create file 'C://Users//lmuinos//Tool_informes//Informes\Rtmp8YfuY2\file22ec502922ea/app.R', reason 'No such file or directory'
4: In file(con, "w") :
  no fue posible abrir el archivo ###this means "it wasn't possible to open the file"
'C://Users//lmuinos//Tool_informes//Informes\Rtmp8YfuY2\file22ec502922ea/__rsconnect_deps.R': No such file or directory
Ejecuci�n interrumpida ###this means "interrupted execution"

I think that the main problem here is this directory: 'C://Users//lmuinos//Tool_informes//Informes\Rtmp8YfuY2\file22ec502922ea/__rsconnect_deps.R' because it doesn't exist and I don't know where it comes from.
I would like to know if you think that changing this directory could solve the problem and how to do it.

Thank you so much in advance :slight_smile:

@lauramuvi - Are you trying to read any file within the application - like .xlsx / .xls or .csv ? If so, you can create a /data folder within the app's root folder and access it using ~/data/xyz.csv (example).

Let me know if doing this helps!

Thanks!
Heramb

Hi @heramb, it didn't work but I tried to upload the app using Linux instead of Windows and it worked.

Thank you anyway! :slight_smile:

1 Like