I am trying to deploy a shiny application to the server that has about 16,425 files mostly that are plots to display in an application. I currently have these two lines of code in the app.R file
options(rsconnect.max.bundle.size = 3000000000)
options(rsconnect.max.bundle.files = 16500)
The first line works as I was getting an error saying the size was too big but now that error goes away and I do have access to a standard account so I will be able to have a larger file size. The issue is with the second line that is not working because every time I try to deploy I am still getting Error in enforceBundleLimits()
:
! appDir
('R:/Bozeman/ProjectCode/APAS/2024/Apas2024Mapping') is too
large to be deployed.
The maximum number of files is 10000.
This directory contains at least 10001 files.
Remove some files or adjust the rsconnect.max.bundle.files option. that error. Is 10,000 files the hard cap that cannot be changed when deploying an application to shinyapps.io? Any help or idea would be appreciated.
Hi,
There is no limit to the number of bundle files you can upload, but bundles are limited to a maximum size of 1 GB for the Free and Starter plans, and up to 5 GB for the Basic, Standard and Professional plans. For the latter plans, note that the rsconnect
package has a default bundle size limit of 3 GB, independent of your shinyapps.io plan limit. If you plan to deploy application bundles larger than 3 GB in size, you can override the rsconnect
default by setting this option first:
options(rsconnect.max.bundle.size=...)
where the value is in bytes. Do not set the maximum size larger than the limit for your shinyapps.io plan, or application deployments will fail.
Hello,
I think I have the size set correctly and that part is not erroring out anymore, but the number of files is what is causing the deployment to fail. Unless the "The maximum number of files is 10000.
This directory contains at least 10001 files.
Remove some files or adjust the rsconnect.max.bundle.files option." error is just a catch all for any size issue in deployment. Is that the case or is the "options(rsconnect.max.bundle.files = 16500)" line not working correctly? Thank you again for the help.
It seems there is indeed a hard cap of 10,000 files in place. We will need to update our documentation to reflect that!
My suggestion for you, since you said most of the files are plots, is to put all your plots into a zip folder and upload the zip folder as part of the bundle. Then when your app starts have it unzip the folder to access all the plots. This should hopefully get you under the 10,000 files limit.
Perfect, sounds good, thank you so much for your help!
Help needed! Adjusting bundle size limits in my Shiny app, deployment errors due to a large number of plot files (16,425). Even after setting rsconnect.max.bundle.files to 16,500, I'm stuck with the error message indicating that the app directory is too large. Any tips or workarounds to overcome this hurdle? Thanks!
Hi @Anakinrsubjf,
See my other comment above about zipping all your plot files together and then unzipping them inside the app. Hope that works for you!
I have a similar problem but slightly different. My app pulls from a set of RDS files in a 'data' folder. I think the reason it isn't deploying is because of the 'data' folder. Each RDS file is less than the 1 GB limit, but collectively they are 17 GB.
I tried zipping the RDS files into separate folders outside of the 'data' folder, but I still get the following error message:
Error in enforceBundleLimits()
:
The maximum size is 3e+09 bytes.
This directory is at least 3233456007 bytes.
Remove some files or adjust the rsconnect.max.bundle.size option.
I need to figure out a way to compress the files in my application's folder so that it can be deployed but I am not sure how to proceed.
Any advice is greatly appreciated!
In case it helps anyone, I figured out a way to make my application work without loading many large data files to shinyapps.io. You can pull the data from a URL within the application, unzip the file, and run the application using that data table. This solves the data storage problem effectively.
The following post was really helpful: https://rshiny.blog/2023/04/05/load-data-to-shiny/
This topic was automatically closed 54 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.