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

Cannot use relative path for site_dir parameter in shiny-server.conf #571

Open
heckelson opened this issue Jun 20, 2024 · 0 comments
Open

Comments

@heckelson
Copy link

my setup

I am using shiny-server with a config file located at the base of my repository (./shiny-server.conf). Installed through the Arch Linux AUR.

Like this: $ shiny-server shiny-server.conf.

I have put my app under ./shiny-app/apps/hello such that the dir structure is now:

./shiny-app/apps/hello/
├── filtered_samples.csv
├── norm_count_mtx.csv
├── results.csv
├── server.R
└── ui.R

My shiny-server.conf looks like this:

run_as alex;

server {
  listen 8888;

  location / {
    site_dir ./shiny-app/apps;
    log_dir ./shiny-app/logs;
    bookmark_state_dir ./shiny-app/bookmarks;

    directory_index on;
  }
}

the problem

While shiny-server seems to be able to handle log_dir and bookmark_state_dir being relative, it logs the following once I visit localhost:8888/hello/ (it logs it inside the log_dir):

Error in `shinyAppDir()`:
! No Shiny application exists at the path "shiny-app/apps/hello"
Backtrace:
    ▆
 1. └─shiny::runApp(Sys.getenv("SHINY_APP"), port = port, launch.browser = FALSE)
 2.   ├─shiny::as.shiny.appobj(appDir)
 3.   └─shiny:::as.shiny.appobj.character(appDir)
 4.     └─shiny::shinyAppDir(x)
 5.       └─rlang::abort(...)
Ausführung angehalten (this is German for "stopped execution")

HOWEVER, once I replace site_dir with the absolute path, i.e. /home/alex/repos/my_repo/shiny-app/apps, it can find the app just fine.

In other words, the line now looks like this:

    ...
    location / {
        site_dir /home/alex/repos/my_repo/shiny-app/apps;
    ...

I don't think this is intended behavior, which is why I'm reporting this.

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

1 participant