Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to redeploy Shiny app at shinyapp.io #945

Closed
Shoshana02 opened this issue Aug 9, 2023 · 12 comments
Closed

Unable to redeploy Shiny app at shinyapp.io #945

Shoshana02 opened this issue Aug 9, 2023 · 12 comments

Comments

@Shoshana02
Copy link

Shoshana02 commented Aug 9, 2023

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

@kevinushey - any thoughts given the traceback seen here?

@aronatkins
Copy link
Contributor

@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
Copy link
Author

@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
Copy link

cjrace commented Aug 22, 2023

@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
Copy link

Hi @cjrace I actually just posted now #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
Copy link
Contributor

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
Copy link
Contributor

@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
Copy link
Contributor

Closing this issue as a duplicate of #968, which is now resolved in the development version of rsconnect.

Please open an issue if you encounter additional problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants