Tychobra / polished

Authentication and Administration for Shiny apps
https://polished.tech
Other
234 stars 36 forks source link

polished::deploy_app() fails with uninformative message if app is too large #177

Closed chris31415926535 closed 2 years ago

chris31415926535 commented 2 years ago

Hi,

I'm using Polished hosting (which is great!) and today, after adding a new large raw dataset to the folder data-raw my call to polished::deploy_app() failed with an error code that didn't give much direction: "API did not return json." I figured this out with some digging around (details below), but my suggestions would be either 1. exclude data-raw folders from app deployment, or 2. make the error response a bit more informative so people can move their big raw data out of the package directory completely before deploying.

I'm using golem so I make the following call:

polished::deploy_app(
  app_name = "(my app name, not important here)",
  golem_package_name = golem::get_golem_name() 
)

And received the following message at the console:

Creating app bundle... Done
Deploying App.  Hang tight.  This may take a while...
Your Shiny app will open in your default web browser once deployment is complete.
Deployment status can be found at https://dashboard.polished.tech
Error: API did not return json

Digging through polished::deploy_app() led me to discover that it was zipping the entire folder, including not only my processed data in data but also some very large raw files in data-raw. This led to a huge .tar.gz file that was rejected by the server with the following:

413 Request Entity Too Large
Error: Request Entity Too Large
Your client issued a request that was too large.

But that information isn't passed on to anyone who calls polished::deploy_app(), so what you get is a mystery failure.

Thanks for all your work on Polished, which as I said is really great so far.

phoward38 commented 2 years ago

Hey @chris31415926535,

Glad you're enjoying polished so far! Thanks for bringing this issue to our attention; that error message definitely needs to be fixed. I'll let you know once we've addressed this issue. I'm not as familiar with building shiny apps using the golem package (although this data-raw issue isn't specific to golem), so if you have any other suggestions or run into any other issues while deploying your golem app(s), feel free to let us know.

Thanks for the detailed issue & for using polished & Polished Hosting!

FWIW: We plan to add an additional option for deploy_apps ram_gb argument, which will allow app sizes up to 16 GB fairly soon