After for further tweaking, I managed to get RStudio Server to start. When I click the “Connect to RStudio” button, the RStudio login page comes up with the following error:
Error: Temporary server error. Please try again.
My script is below:
#!/usr/bin/env bash
<%-
session_dir = session.staged_root
%>
#
# Start RStudio Server
#
# PAM auth helper used by RStudio
cd $HOME
export WORKING_DIR=${HOME}/r_working
export RSTUDIO_AUTH="$/home/brad.traver/ondemand/dev/rstudio/template/bin/auth"
# Generate an `rsession` wrapper script
export RSESSION_WRAPPER_FILE="${WORKING_DIR}/rsession.sh"
mkdir r_working
cd $WORKING_DIR
echo $RSESSION_WRAPPER_FILE
(
umask 077
sed 's/^ \{2\}//' > "$RSESSION_WRAPPER_FILE" << EOL
#!/usr/bin/env bash
# Log all output from this script
export RSESSION_LOG_FILE="${WORKING_DIR}/rsession.log"
exec &>>"\${RSESSION_LOG_FILE}"
set -x
# rsession.sh doesn't share the same env as the outside script, so these
# need to be set explicitly
export R_LIBS_SITE="${R_LIBS_SITE}"
export TZ="US/Eastern"
env
# Launch the original command
echo "Launching rsession..."
rsession --r-libs-user "${R_LIBS_USER}" "\${@}"
EOL
)
chmod 700 "${WORKING_DIR}/rsession.sh"
# Output debug info
hostname
# rstudio runtime stuff
export TMPDIR="$(mktemp -d)"
# server log directory in this job's working directory
mkdir -p "${WORKING_DIR}/logs"
set -x
# Launch the RStudio Server
echo "Starting up rserver... at $(date)"
rserver --www-port "${port}" --auth-none 0 --auth-pam-helper-path "${RSTUDIO_AUTH}" --auth-encrypt-password 0 --rsession-path "${RSESSION_WRAPPER_FILE}" --server-data-dir="${TMPDIR}" --secure-cookie-key-file "${TMPDIR}/rstudio-server/secure-cookie-key" --server-user=$(whoami) --database-config-file "/home/brad.traver/ondemand/dev/rstudio/template/etc/database.conf"
I think my issues might be caused by lack of configuration in the rsession and database config files. The database config file does have one line of configuration in it.