Play apps with a bundled start script split JAVA_OPTS unquoted, breaking multi-word values
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- cloud, devops, infrastructure
调研方向
This is the start-script launch path for Play apps (bin/<name> from sbt-native-packager), not the buildpack javaexec path used when no start script exists. Trace how JAVA_OPTS is passed into that script versus the no-start-script branch (play.core.server.NettyServer). Done means multi-word JAVA_OPTS (e.g. a quoted cron -D) survive as tokens, likely via -J<flag> as the issue suggests, without relying on unquoted ${java_opts[@]}. Related context is cloudfoundry/java-buildpack#1435.
由索引模型根据 Issue 内容生成。
描述
Play apps packaged with a start script (bin/<name>, generated by sbt-native-packager, used whenever the app ships one — staged and dist Play 2.x builds) are launched directly via that script, not via the buildpack's shell-free javaexec launcher. javaexec is only used when no start script is present.
sbt-native-packager's own script template does:
if [[ "$JAVA_OPTS" != "" ]]; then
java_opts="${JAVA_OPTS}"
fi
execRunner "$java_cmd" ${java_opts[@]} ...
${java_opts[@]} is unquoted, so $JAVA_OPTS is word-split on whitespace (and glob-expanded). A value containing embedded spaces, e.g. a quoted cron expression (-DcronExpr="0 */7 * * * *"), splits into separate bare words; a bare word like */7 with no leading - can be misread as the main class by java, causing Could not find or load main class *.7 and a crash loop.
Command substitution in the value cannot occur here (it's plain variable expansion, not re-parsed source) — this is a launch-correctness issue, pre-existing and independent of #1432/#1435's javaexec fix, which only covers the no-start-script branch (play.core.server.NettyServer invocation).
Possible fix: route the start-script branch through a safe tokenizer too, passing JAVA_OPTS tokens as -J<flag> arguments (the convention sbt-native-packager scripts already support for exactly this purpose) instead of relying on the script reading $JAVA_OPTS directly.
Found while investigating cloudfoundry/java-buildpack#1435.
- 主要语言
- Go
- 星标
- 452
- 派生
- 2.5k
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 23
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudfoundry/java-buildpack 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 68/100
cloudfoundry/java-buildpack#1423 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
cloudfoundry/java-buildpack#1377 · 5 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 52/100
cloudfoundry/java-buildpack#1364 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
cloudfoundry/java-buildpack#1342 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
cloudfoundry/java-buildpack#1151 · 2 条评论 ·
维护者通常 1 天内回复
查看 cloudfoundry/java-buildpack 的全部 Issue
相似的 Issue
-
bug from-studio
难度 2/5 1-3 小时 新手友好度 63/100
esengine/DeepSeek-Reasonix#12355 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
gke-labs/kube-agents#2612 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
bluesky-social/indigo#1496 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
Gentleman-Programming/gentle-ai#5371 ·
维护者通常 1 天内回复