# Problems using single quotes in \`submit.yml.erb\`

**URL:** <https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806>\
**Category:** Get Help\
**Tags:** question\
**Created:** [March 19, 2026, 3:12pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806 "2026-03-19T15:12:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ronrahaman/32/1031_2.png) [@RonRahaman](https://discourse.openondemand.org/u/RonRahaman)\
**Post date:** [March 19, 2026, 3:12pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/1 "2026-03-19T15:12:58Z")

</div>

_Edit: The cause of my problem was single-quotes, not the boolean operators as I first assumed. After knowing the cause, I changed this post’s title to make it more searchable for folks with the same problem_

In `submit.yml.erb`, I’m attempting to set a `--constraint` with some boolean operators. Something like this:

```auto
script:
  native: 
    <%- if node_type == "a100" -%>
    - "--constraint='[A100-40GB|A100-80GB]'"
    # ... etc ...

```

I’ve verified that this exact `--constraint` works for us in normal `sbatch` and `salloc`. But in OOD, the job submission fails with: " Failed to submit session with the following error: sbatch: error: Batch job submission failed: Invalid feature specification".

In my troubleshooting, it _seems_ like the `|` character might not be passed correctly, but I am still not sure. Do any of you know if `|` needs special handling in an .erb file?

Thanks,  
Ron

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [March 19, 2026, 5:34pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/2 "2026-03-19T17:34:21Z")

</div>

Could you post what OOD submitted with the `job_scirpt_options.json` file in the session data?

My guess is those single quotes are throwing things off.

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ronrahaman/32/1031_2.png) [@RonRahaman](https://discourse.openondemand.org/u/RonRahaman)\
**Post date:** [March 19, 2026, 5:50pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/3 "2026-03-19T17:50:15Z")

</div>

Sure thing, here it is:

```auto
{
  "job_name": "sys/dashboard/dev/bc_jupyter_rh9",
  "workdir": "/storage/home/hcodaman1/rrahaman6/ondemand/data/sys/dashboard/batch_connect/dev/bc_jupyter_rh9/output/65fa2626-8888-4401-ad81-1c388446a25a",
  "output_path": "/storage/home/hcodaman1/rrahaman6/ondemand/data/sys/dashboard/batch_connect/dev/bc_jupyter_rh9/output/65fa2626-8888-4401-ad81-1c388446a25a/output.log",
  "shell_path": "/bin/bash",
  "native": [
    "--nodes=1",
    "--ntasks-per-node=1",
    "--gpus-per-node=1",
    "--constraint='[A100-40GB|A100-80GB]'"
  ],
  "wall_time": 3600,
  "email_on_started": false
}

```

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [March 19, 2026, 6:58pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/4 "2026-03-19T18:58:50Z")

</div>

Yeah I can see the issue with those single quotes. That file shows you exactly what is being handed to SLURM to run and it’s going to fall over when it hits those.

Thinking on this, I’ve seen this issue previously in many forms and I think I understand why now after searching the OOD code. Simply put, people fill that out as if a shell will be issuing a command from that String, but this is not true. Instead, OOD will use `ruby` to call `exec()` for `sbatch`.

This is fundamentally different than if we were using a shell and just calling `sbatch` as then we would need those single quotes to prevent the shell from interpreting `|` as a pipe operator. However, when we call `exec()` that’s _not_ the case, instead we get an Array of arguments being passed (which you can see in what you posted under `native`) so, no shell is ever processing that and removing those quotes. They literally get passed and SLURM doesn’t understand what the single quote is and returns the “…Invalid feature specification” because SLURM has no such specification for single quotes.

That’s a lot, but i am trying to capture _why_ this happens for future users to see as well.

The point is this: _If using `native` then do NOT use shell quotes_

For your particular problem just remove the single quotes:

```auto
script:
  native: 
    <%- if node_type == "a100" -%>
    - "--constraint=[A100-40GB|A100-80GB]"
    # ... etc ...

```

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ronrahaman/32/1031_2.png) [@RonRahaman](https://discourse.openondemand.org/u/RonRahaman)\
**Post date:** [March 31, 2026, 1:21pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/5 "2026-03-31T13:21:26Z")

</div>

Thanks, you were spot on. Removing the single quotes resolved the issue for me.

---

<div class="post-metadata">

**Author:** ![RonRahaman](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/ronrahaman/32/1031_2.png) [@RonRahaman](https://discourse.openondemand.org/u/RonRahaman)\
**Post date:** [March 31, 2026, 1:28pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/6 "2026-03-31T13:28:43Z")

</div>

BTW I changed the title of the post to make it more easily searchable for people with the same problem.

---

<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:** [September 27, 2026, 1:29pm UTC](https://discourse.openondemand.org/t/problems-using-single-quotes-in-submit-yml-erb/4806/7 "2026-09-27T13:29:41Z")

</div>

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