rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
131 stars 79 forks source link

Unable to redeploy Shiny app at shinyapp.io #945

Closed Shoshana02 closed 11 months ago

Shoshana02 commented 11 months ago

Sorry to trouble you Recently, I tried to redeploy a shiny app I had published (last update was 16/7/2023) with rsconnect version 1.0.0 and ran into the following error: ℹ Capturing R dependencies with renv Error in dirname(root) : a character vector argument expected

Then, I used traceback() it returned:

traceback() 29: dirname(root) 28: substring(string, 1, nchar(prefix)) 27: startswith(path, root) 26: renv_path_relative(path, dirname(root)) 25: renv_dependencies_find_dir_children(path, root, depth) 24: renv_dependencies_find_dir(path, root, depth) 23: FUN(X[[i]], ...) 22: lapply(x, f, ...) 21: map(children, renv_dependencies_find_impl, root = root, depth = depth) 20: renv_dependencies_find_dir(path, root, depth) 19: FUN(X[[i]], ...) 18: lapply(x, f, ...) 17: map(children, renv_dependencies_find_impl, root = root, depth = depth) 16: renv_dependencies_find_dir(path, root, depth) 15: FUN(X[[i]], ...) 14: lapply(x, f, ...) 13: map(children, renv_dependencies_find_impl, root = root, depth = depth) 12: renv_dependencies_find_dir(path, root, depth) 11: FUN(X[[i]], ...) 10: lapply(path, renv_dependencies_find_impl, root = root, depth = 0) 9: renv_dependencies_find(path, root) 8: renv_dependencies_impl(path = path, root = root, quiet = quiet, progress = progress, errors = errors, dev = dev, ...) 7: renv::dependencies(bundleDir) 6: snapshotRenvDependencies(bundleDir, extraPackages, verbose = verbose) 5: computePackageDependencies(bundleDir, extraPackages, quiet = quiet, verbose = verbose) 4: bundlePackages(bundleDir = appDir, extraPackages = extraPackages, verbose = verbose, quiet = quiet) 3: createAppManifest(appDir = bundleDir, appMetadata = appMetadata, users = users, pythonConfig = pythonConfig, retainPackratDirectory = TRUE, image = image, verbose = verbose, quiet = quiet) 2: bundleApp(appName = target$appName, appDir = appDir, appFiles = appFiles, appMetadata = appMetadata, quiet = quiet, verbose = verbose, pythonConfig = pythonConfig, image = image) 1: rsconnect::deployApp()

I have checked that all the file paths are relative paths and the working directory is also the file directory where shinyapp is located. I have tried to deploy a copy shinyapp with creating a new Rproj. and the app's files copied; however, I received the same error.

Please let me know if there is more information you need, this is my first time posting an issue. Thank you so much!

aronatkins commented 11 months ago

Would you mind trying with the development versions of renv and rsconnect to see if that helps?

remotes::install_github("rstudio/renv")
remotes::install_github("rstudio/rsconnect")
Shoshana02 commented 11 months ago

Would you mind trying with the development versions of renv and rsconnect to see if that helps?

remotes::install_github("rstudio/renv")
remotes::install_github("rstudio/rsconnect")

Thank you for your suggestion! I have updated the versions of renv and rsconnect. Unfortunately, I still received the same error.😭😭😭

aronatkins commented 11 months ago

Is it possible to share a project or more details about your project structure so we can recreate this problem?

In the meantime, you could use an older release of rsconnect:

remotes::install_version("rsconnect", "0.8.29")
Shoshana02 commented 11 months ago

Is it possible to share a project or more details about your project structure so we can recreate this problem?

In the meantime, you could use an older release of rsconnect:

remotes::install_version("rsconnect", "0.8.29")

It works!!! Thank you so much!!!

But, I wonder why it reported error with the latest version.... I still can not find the reason...

aronatkins commented 11 months ago

@kevinushey - any thoughts given the traceback seen here?

aronatkins commented 11 months ago

@Shoshana02 - Could you share more information about your project structure or how you are deploying? Are you using the RStudio IDE to push-button deploy, or are you calling rsconnect::deployApp from the R console?

Shoshana02 commented 11 months ago

@Shoshana02 - Could you share more information about your project structure or how you are deploying? Are you using the RStudio IDE to push-button deploy, or are you calling rsconnect::deployApp from the R console?

I am calling rsconnect::deployApp from the R console Thank you!

cjrace commented 11 months ago

@aronatkins just highlighting that I've been using this workaround of fixing the rsconnect package to version 0.8.29 too, though today that's now failing with an error saying the package is out of date.

image

We use a GitHub actions workflow for the deployments, todays deploy log can be found at https://github.com/dfe-analytical-services/childrens_social_services_offenders_dashboard/actions/runs/5936368104/job/16096633034

Let me know if any other information would be useful!

ntyndall commented 11 months ago

Hi @cjrace I actually just posted now https://github.com/rstudio/rsconnect/issues/970, I saw that the change was only made around 5 days ago and didn't think to go looking at this task but wanted to get a feeling for some other comments etc. I am reluctant to bump renv so high currently to what I am using as I have a suite of shiny applications that depend on it :(

aronatkins commented 11 months ago

The original problem reported by this issue is tracked by:

Folks can work around those "large directory" problems by setting the renv renv.config.dependencies.limit option to mirror the value used for rsconnect.max.bundle.files.

options(
    renv.config.dependencies.limit = getOption('rsconnect.max.bundle.files', 10000)
)

If you customize rsconnect.max.bundle.files, you will want to customize renv.config.dependencies.limit to have the same value.

options(rsconnect.max.bundle.files = 10000, renv.config.dependencies.limit = 10000)
aronatkins commented 11 months ago

@cjrace Unfortunately, shinyapps.io and posit.cloud now require newer versions of rsconnect. By association, that also means you will need a newer version of renv.

The announcement of this change: https://community.rstudio.com/t/notice-posit-cloud-shinyapps-io-dropping-support-for-rsconnect-1-0-1/172078

I have reached out to the folks running shinyapps.io and posit.cloud to see if they can relax that restriction. For now, the version requirement is going to remain.

aronatkins commented 11 months ago

Closing this issue as a duplicate of https://github.com/rstudio/rsconnect/issues/968, which is now resolved in the development version of rsconnect.

Please open an issue if you encounter additional problems.