# \[second set of eyes welcome. \] Rstudio - but really form, submit or script issue

**URL:** <https://discourse.openondemand.org/t/second-set-of-eyes-welcome-rstudio-but-really-form-submit-or-script-issue/4477>\
**Category:** Get Help\
**Created:** [August 21, 2025, 5:24am UTC](https://discourse.openondemand.org/t/second-set-of-eyes-welcome-rstudio-but-really-form-submit-or-script-issue/4477 "2025-08-21T05:24:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisPWelsh](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/chrispwelsh/32/2555_2.png) [@ChrisPWelsh](https://discourse.openondemand.org/u/ChrisPWelsh)\
**Post date:** [August 21, 2025, 5:24am UTC](https://discourse.openondemand.org/t/second-set-of-eyes-welcome-rstudio-but-really-form-submit-or-script-issue/4477/1 "2025-08-21T05:24:20Z")

</div>

Hi I’m missing something simple here as I am getting

 ![Screenshot 2025-08-21 at 3.13.07 pm](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/2/2c29d9c08d1ed10dca544eb5afa57e897975dd91.png)

Can you please help me spot the issue? And advise exactly the bit I need to add? Thx

**form.yml**

```auto
---
cluster: "meerkat"
attributes:
  bc_num_hours:
    min: 1
    max: 8
    step: 1
  Rserver:
    widget: select
    label: "RStudio Server Version"
    options:
      - ["rstudio-server/2025.05.1-513","rstudio-server/2025.05.1-513"]
  Rapp:
    widget: select
    label: "R Version"
    options:
      - ["4.4.1","r/4.4.1-wz5qfuk"]
      - ["4.3.2","r/4.3.2-pathdwe"]
      - ["4.2.2","r/4.2.2-43fxu7l"]
      - ["4.1.2","r/4.1.2-cq2nxyv"]
      - ["3.6.1","r/3.6.1-cxxra2y"]
      - ["3.4.4","r/3.4.4-b5beg4x"]
      - ["3.3.3","r/3.3.3-tasvtln"]

form:
  - Rserver
  - Rapp
  - bc_num_hours
  - bc_email_on_started

```

**Submit.yml.erb**

```auto
---
batch_connect:
  template: "basic"
  conn_params:
    - csrf_token

```

templates/script.sh.erb

```auto
>> cat script.sh.erb 
#!/usr/bin/env bash
module purge

# load RStudio Server
module load <%= context.Rserver %>
##module load rstudio-server/2025.05.1-513

# load R
module load <%= context.Rapp %>

#
# Start RStudio Server
#

# PAM auth helper used by RStudio
export RSTUDIO_AUTH="${PWD}/bin/auth"

# Generate an `rsession` wrapper script
export RSESSION_WRAPPER_FILE="${PWD}/rsession.sh"
(
umask 077
sed 's/^ \{2\}//' > "${RSESSION_WRAPPER_FILE}" << EOL
  #!/usr/bin/env bash

  # Log all output from this script
  export RSESSION_LOG_FILE="${PWD}/rsession.log"
  exec &>>"\${RSESSION_LOG_FILE}"

  # Launch the original command
  echo "Launching rsession..."
  set -x
  exec rsession --r-libs-user "${R_LIBS_USER}" "\${@}"
EOL
)
chmod 700 "${RSESSION_WRAPPER_FILE}"

# Generate a database.conf file
export DBCONF="${PWD}/database.conf"
(
umask 077
sed 's/^ \{2\}//' > "${DBCONF}" << EOL
  # set database location
  provider=sqlite
  directory=/tmp/${USER}/${SLURM_JOB_ID}/rstudio-server/db
EOL
)
chmod 700 "${DBCONF}"

# Set working directory to home directory
cd "${HOME}"

# Create a unique $TMPDIR for runtime files
# MCRI
export TMPDIR="$(mktemp -d)"

# these are needed to run the container as user
mkdir -p "$TMPDIR/var_run"
mkdir -p "$TMPDIR/var_lib_rstudio-server"
touch "$TMPDIR/var_lib_rstudio-server/rstudio-os.sqlite"

# Output debug info
module list

# Launch the RStudio Server
echo "Starting up rserver..."
set -x
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" \
  --database-config-file "${DBCONF}" \
  --server-user $(whoami)

```

---

<div class="post-metadata">

**Author:** ![ChrisPWelsh](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/chrispwelsh/32/2555_2.png) [@ChrisPWelsh](https://discourse.openondemand.org/u/ChrisPWelsh)\
**Post date:** [August 21, 2025, 6:52am UTC](https://discourse.openondemand.org/t/second-set-of-eyes-welcome-rstudio-but-really-form-submit-or-script-issue/4477/2 "2025-08-21T06:52:06Z")

</div>

Why is it that after 15 minutes of posting this I find an answer.

The answer was to switch there to lowercase (not sure why)

Rserver to rserver

Rapp to rapp

in scripts, and forms

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [August 21, 2025, 2:18pm UTC](https://discourse.openondemand.org/t/second-set-of-eyes-welcome-rstudio-but-really-form-submit-or-script-issue/4477/3 "2025-08-21T14:18:52Z")

</div>

Yes the system does not like mixed case variables.

What’s more is, if you have module information setup on your system you could use `auto_modules_r` to populate that list for you instead of hard coding it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [February 17, 2026, 2:19pm UTC](https://discourse.openondemand.org/t/second-set-of-eyes-welcome-rstudio-but-really-form-submit-or-script-issue/4477/4 "2026-02-17T14:19:41Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
