Workbench Job template produces invalid YAML for long working directories containing spaces
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #970 by @bcpierson-lilly — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- yaml
- Domain
- build-system
Research direction
Start with the Workbench Job template’s workingDir rendering expression and compare it with the similar indent and trimPrefix pattern referenced in commit 1986ad36. Render the template using the long synthetic path with spaces from the issue, then check that the output parses as YAML and preserves the exact directory string.
Written by the indexing model from the issue text.
Description
Description
The Workbench Job template renders workingDir with toYaml but does not indent continuation lines. When serialization wraps a long path at spaces, the generated YAML is invalid and Kubernetes rejects the Job before execution. I reproduced this with rstudio-workbench chart 0.21.5, template version 2.5.0, and Workbench 2026.07.1-ubuntu-24.04. The current upstream template also contains the affected expression.
Reproduction details
Submit an audited job using /usr/bin/true and this synthetic working directory:
/home/example/a long directory with enough spaces to exercise wrapping at the serializer line width - continuation looks like a YAML list
The directory doesn't need to exist to actually reproduce the YAML rejection, the error occurs before container startup.
Observed results:
- A short working directory and a 154-character path without spaces both launched successfully.
- A long path containing spaces returned HTTP 500 with Kubernetes API failure.
- Launcher logs showed Kubernetes HTTP 400 with a YAML parsing error. The reported line number varies with the rendered document.
Suggested correction
gotemplate
workingDir: {{ toYaml .Job.workingDirectory | indent 12 | trimPrefix (repeat 12 " ") }}
Local rendering tests with this correction produced valid YAML and preserved the exact directory string. A similar fix with the same indent / trimPrefix pattern was applied to other fields in commit 1986ad36.
- Dominant language
- Markdown
- Stars
- 46
- Forks
- 39
- Avg merge
- 16h 27m
- Merged PRs (30d)
- 7
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rstudio/helm
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug team: workbench
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug team: launcher team: workbench
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rstudio/helm#907 · 1 comment ·
Maintainers usually reply within 1 day
-
team: connect
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
suppressStdinAnnotation has no effect — job.tpl checks limitStdinAnnotation insteadMay be free again A pull request for this issue was closed without being merged. Openteam: launcher team: workbench
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Font inlining cache is not created or reusedPossibly taken @nagahara-naoki claimed this today. Openarea: @angular/build
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
angular/angular-cli#34719 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
osaurus-ai/osaurus#3422 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
foundation/foundation-emails#2127 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mw00/project-maya#983 · 1 comment ·
Maintainers usually reply within 2 days