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

Object cache_dir not found #93

Open
netique opened this issue Aug 11, 2021 · 2 comments
Open

Object cache_dir not found #93

netique opened this issue Aug 11, 2021 · 2 comments

Comments

@netique
Copy link

netique commented Aug 11, 2021

Hi, I've encountered an error using sass with bslib when running an app at shiny server:

Warning: Error in warning: object 'cache_dir' not found
  [No stack trace available]

Note this disappeared with options(sass.cache = FALSE).

I cannot find what could be the cause, I suspected some file permissions, but restricting write and/or read rights of the cache directory raised a different, expected error.

@cpsievert
Copy link
Contributor

Any chance you can provide us with a reproducible example?

@netique
Copy link
Author

netique commented Dec 9, 2021

The problem is that I have limited access to the server where shiny-server lives. But recently, I have been provided with this log, which may be helpful:

Warning in loadSupport(appDir, renv = sharedEnv, globalrenv = NULL) :
  Loading R/ subdirectory for Shiny application, but this directory appears to contain an R package. Sourcing files in R/ may cause unexpected behavior.
ℹ Loading edutest

Listening on http://127.0.0.1:38709
Warning: Error in warning: object 'cache_dir' not found
  87: warning
  86: value[[3L]]
  85: tryCatchOne
  84: tryCatchList
  83: tryCatch
  82: sass_cache_context_dir
  81: sass_cache_get
  79: sass::sass_partial
  78: bs_get_contrast
  77: navs_bar
  72: page_navbar
  69: ui [/opt/shiny/my_app/R/app_ui.R#8]

Thing is that I cannot reproduce this behaviour elsewhere. But from the traceback, the issue may lie somewhere in sass_cache_context_dir(). Hope this helps at least a bit.

EDIT:
I think I have found the issue. At

sass/R/sass_cache.R

Lines 192 to 193 in 8852117

cache_dir <<- tempfile("sass-")
dir.create(cache_dir)

a tempfile is created and on the server of concern, this may fail. The global assignment in turn cannot be made.

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

2 participants