I’m having trouble getting RStudio to work in my small OnDemand setup. I would appreciate any tips on debugging this, or even better, solutions.
RStudio is configured to run raw, without using singularity or apptainer. It appears to work, but when I attempt to connect to RStudio, I get a blank page, and then a popup with the following error (split for readablity):
Error: Download of https://cluster.example.com/rnode/ip-10-0-201-180/32096/rstudio/deferredjs/
D9E3EEE1809560C105426D6D6A627EF4/30.cache.js?autoRetry=3 failed with
status 404(Script Tag Failure - no status available)
The base system is Debian 13 (trixie) with a slurm based cluster. OnDemand itself appears to be working. It can launch jobs, read the queue and that kind of stuff.
On the node, I can run something like wcurl http://localhost:32096/rstudio/deferredjs/D9E3EEE1809560C105426D6D6A627EF4/30.cache.js and the file downloads correctly, so I don’t think it is a problem with rserver being unable to access the files.
From my browser I can go tohttps://cluster.example.com/rnode/ip-10-0-201-180/32096/rstudio/deferredjs/D9E3EEE1809560C105426D6D6A627EF4/test.htm and download a test file, but I get an error if I try to access any of the .js files. The browser debugger just gives a “Failed to load” error for the various javascript files RStudio tries to load.
It might be an authentication issue with RStudio, but that does appear to be working, or at least I get [rserver] DEBUG PAM login result: for username: jeff returns: authenticated in the log.
I don’t see anything that jumps out to me as a problem in the log files.
rserver.log
(Time stamps snipped for readability)
[rserver] INFO Reading rserver configuration from '/home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7/rserver.conf' with env: RSTUDIO_CONFIG_DIR=/home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7
[rserver] INFO Running as server user 'jeff' (without privilege)
[rserver] DEBUG (PID 13047): Initialized file locks (lock-type=linkbased, use-symlinks=false, timeout-interval=30s, refresh-rate=20s, log-file=)
[rserver] INFO Encryption versions set to max: 0, min: 0
[rserver] DEBUG Creating secure key file: "/tmp/tmp.zOxrS4PI0B/rstudio-server/secure-cookie-key" key hash: (A8FD22F9)
[rserver] INFO Finished reading configuration for sqlite database at /home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7/rstudio-os.sqlite
[rserver] DEBUG Applied database configuration from /home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7/database.conf with provider: sqlite
[rserver] INFO Creating database connection pool of size 2 (source: /home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7/database.conf)
[rserver] INFO Updating database schema version using migration path: /usr/lib/rstudio-server/db
[rserver] INFO Database schema has not been created yet. Creating database schema...
[rserver] INFO No environment variables found in RSTUDIO_CONFIG_DIR, expected at '/home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7/env-vars'
[rserver] INFO Running without privilege; using secure key at /home/jeff/.cache/rstudio/session-rpc-key
[rserver] DEBUG Using secure key file: /home/jeff/.cache/rstudio/session-rpc-key
[rserver] DEBUG Secure key hash: (D5BCE668)
[rserver] INFO Running without privilege; using secure key at /home/jeff/.cache/rstudio/session-rpc-key
[rserver] DEBUG Using secure key file: /home/jeff/.cache/rstudio/session-rpc-key
[rserver] DEBUG Secure key hash: (D5BCE668)
[rserver] DEBUG Found R version: 4.5.2 with: /usr/bin/R --vanilla -s -e 'cat(R.Version()$major,R.Version()$minor, sep=".")'
[rserver] DEBUG Caching auth userIdentifier: jeff for system username: jeff
[rserver] DEBUG PAM login start - running: /home/jeff/ondemand/data/sys/dashboard/batch_connect/dev/RStudio/output/ce2ba795-b0c8-4e7d-b9b7-1276d3b371c7/bin/auth jeff rstudio 1 <pw>
[rserver] DEBUG PAM login result: for username: jeff returns: authenticated
[rserver] DEBUG User db query start: jeff
[rserver] DEBUG No record found for user in db: jeff
[rserver] DEBUG Adding user to database: jeff
[rserver] DEBUG Begin update last signIn time
[rserver] DEBUG End update last signIn time
[rserver] DEBUG Created new UserSession for: jeff (total: 1)
[rserver] DEBUG User db query start: jeff
[rserver] DEBUG Found user in db: jeff
[rserver] DEBUG Adding session cookie: jeff|Fri%2C%2006%20Feb%202026%2022%3A23%3A09%20GMT|EPKN%2Bzi%2Fij9tJZ9lcYWTZiOKjrCjFneJyZpx7SqIbZE%3D for user: jeff
[rserver] DEBUG Sign in for user: jeff redirecting to: /
script.sh.erb
#!/usr/bin/env bash
# create server configuration
export WORKING_DIR=$HOME
export RSTUDIO_CONFIG_DIR=$PWD # system config
export RSTUDIO_DATA_HOME=$PWD # per-session storage
export RSTUDIO_AUTH="$PWD/bin/auth"
export TMPDIR="$(mktemp -d)"
export RS_SESSION_TMP_DIR=$TMPDIR
export PATH=/usr/lib/rstudio-server/bin:$PATH
mkdir -p "$TMPDIR/rstudio-server"
cat <<-EOF > $RSTUDIO_CONFIG_DIR/rserver.conf
server-user=$USER
www-port=$port
auth-none=0
auth-pam-helper-path=$RSTUDIO_AUTH
auth-encrypt-password=0
auth-timeout-minutes=0
database-config-file=$RSTUDIO_CONFIG_DIR/database.conf
server-data-dir=$TMPDIR/rstudio-server
server-app-armor-enabled=0
secure-cookie-key-file=$TMPDIR/rstudio-server/secure-cookie-key
EOF
cat <<-EOF > $RSTUDIO_CONFIG_DIR/rsession.conf
session-timeout-minutes=0
session-timeout-suspend=0
session-save-action-default=no
session-quit-child-processes-on-exit=1
r-restore-workspace=0
session-default-working-dir=$WORKING_DIR
EOF
cat <<-EOF > $RSTUDIO_CONFIG_DIR/logging.conf
log-level=debug
logger-type=file
log-dir=$RSTUDIO_CONFIG_DIR/sessions
EOF
cat <<-EOF > $RSTUDIO_CONFIG_DIR/database.conf
provider=sqlite
directory=$RSTUDIO_CONFIG_DIR
pool-size=$SLURM_CPUS_ON_NODE
EOF
mkdir $RSTUDIO_CONFIG_DIR/sessions
# start server
env
rserver 2>&1