Shiny App 在没有日志文件的情况下无法在 Shiny Server 上运行
Shiny App not working on Shiny Server with no log file present
我有一个在本地 R 服务器(端口 8787)上运行的应用程序。当我将它移动到闪亮服务器(端口 3838)时,我收到消息
ERROR: An error has occurred. Check your logs or contact the app author for clarification.
并且 /var/log/shiny-server.log
中没有日志文件
这是我的配置文件:
# Instruct Shiny Server to run applications as local user
run_as : HOME_USER:;
# Define a server that listens on port 3838
server {
listen 3838;
#preserve_logs true;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
preserve_logs true;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}
有人可以检查我的配置文件吗?谢谢
显然,我的配置默认清理错误消息为真。
添加
options(shiny.sanitize.errors = FALSE)
到您的应用。
在配置文件中,放置
sanitize_errors false;
preserve_logs true;
在服务器内永久解析。
Shiny 还会在控制台上转储错误和消息。
您可以在 chrome 或 Opera 浏览器中按 Ctrl + Shift + J 来访问它。
我遇到了同样的问题。在我的 server.R
中,我使用了另一个 R 文件:一旦我将其重命名为 "global.R"
一切正常。
我开始收到有关丢失包裹的有意义的日志。需要使用 install.package("x", lib = "/usr/local/lib/R/site-library")
.
安装软件包
确保 "shiny"
用户或您在 /etc/shiny-server/shiny-server.conf
中指定的任何用户有权访问 /usr/local/lib/R/site-library
.
我有一个在本地 R 服务器(端口 8787)上运行的应用程序。当我将它移动到闪亮服务器(端口 3838)时,我收到消息
ERROR: An error has occurred. Check your logs or contact the app author for clarification.
并且 /var/log/shiny-server.log
这是我的配置文件:
# Instruct Shiny Server to run applications as local user
run_as : HOME_USER:;
# Define a server that listens on port 3838
server {
listen 3838;
#preserve_logs true;
# Define a location at the base URL
location / {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
# Log all Shiny output to files in this directory
log_dir /var/log/shiny-server;
preserve_logs true;
# When a user visits the base URL rather than a particular application,
# an index of the applications available in this directory will be shown.
directory_index on;
}
}
有人可以检查我的配置文件吗?谢谢
显然,我的配置默认清理错误消息为真。
添加
options(shiny.sanitize.errors = FALSE)
到您的应用。
在配置文件中,放置
sanitize_errors false;
preserve_logs true;
在服务器内永久解析。
Shiny 还会在控制台上转储错误和消息。 您可以在 chrome 或 Opera 浏览器中按 Ctrl + Shift + J 来访问它。
我遇到了同样的问题。在我的 server.R
中,我使用了另一个 R 文件:一旦我将其重命名为 "global.R"
一切正常。
我开始收到有关丢失包裹的有意义的日志。需要使用 install.package("x", lib = "/usr/local/lib/R/site-library")
.
安装软件包
确保 "shiny"
用户或您在 /etc/shiny-server/shiny-server.conf
中指定的任何用户有权访问 /usr/local/lib/R/site-library
.