Can't upload large ish RDS files

Hi,

I'm trying to deploy a shiny app from RStudio. Along with the "ui.r" and "server.r" files, I have 3 .RDS files (50kb, 15mb and 18mb), which I read in server.r file, and they work fine locally. When I commence upload, it fails giving the following error:

Preparing to deploy application...DONE Uploading bundle for application: 794264...Error in force(code) : Could not upload file. Calls: <Anonymous> -> withStatus -> force Execution halted

I tried selecting on the 50kb and 15mb file, that worked. When I select the 18 mb on its own it works, but when I select all the three of them, it doesn't seem to work. I increased the file size to approx. 500 mb (which was most likely downsizing the bundle size) using the following:

options(rsconnect.max.bundle.files = 500000000)

As I read it takes the value in bytes.

That was fruitless.

I deployed using the console:

deployApp(appDir="Documents/GitHub/DataScience_JH_Coursera_Assignments/10.Capstone/shinyapp/PredictionText/",logLevel="verbose",lint=TRUE)

To no avail, but I'm managed to zero in to the problematic line and I got the following log:

----- Deployment error -----
Error in force(code) : Could not upload file.
 
----- Error stack trace -----
4: stop("Could not upload file.")
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 <- md5sum(bundlePath)
           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: deployApp(appDir = "Documents/GitHub/DataScience_JH_Coursera_Assignments/10.Capstone/shinyapp/PredictionText/", 
       logLevel = "verbose", lint = TRUE)

So it's failing here, I'm assuming:

if (!uploadBundle(bundle, bundleSize, bundlePath)) {

FYI my bundle size is set to approx 3gb, if I did the conversion right when I got the following:

getOption("rsconnect.max.bundle.size")
[1] 3145728000

I've been stuck on this for 5 days now. I read all the forums I can read, tried uploading the files individually only to find that shiny/rsconnect seems to delete the instance before that, hence not being able to upload files one-by-one. I even try to mess with .dcf rsconnect file and nothing there too. Any help/insight would be much appreciated.

1 Like

I've managed to solve the problem, as it turns out I had the *.RDS files in the same folder as the server.r and ui.r files. I just needed to create a folder called "data" in the same folder as *.r files and dump the *.RDS files there and the upload work.

The logs could've been a bit more clear.

Also, not related, but it did help, to "flush the cache", navigate into the rsconnect and all subsequent folders till you reach your [appname].dcf file and delete that file.

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.