Play apps with a bundled start script split JAVA_OPTS unquoted, breaking multi-word values
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- cloud, devops, infrastructure
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 452
- Fork
- 2.5k
- Merge medio
- 1g 2h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudfoundry/java-buildpack
-
v5.1.0 GA release planAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
cloudfoundry/java-buildpack#1423 ·
I maintainer di solito rispondono entro 1 giorno
-
Support configurable initial/minimum heap size relative to (/as a percentage of) calculated XmxAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
cloudfoundry/java-buildpack#1377 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
cloudfoundry/java-buildpack#1364 ·
I maintainer di solito rispondono entro 1 giorno
-
elastic-otel-java supportAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
cloudfoundry/java-buildpack#1342 · 1 commento · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
cloudfoundry/java-buildpack#1151 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di cloudfoundry/java-buildpack
Issue simili
-
kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 4 giorni
-
bug needs-acceptance
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
vllm-project/semantic-router#4744 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jaegertracing/jaeger#9794 ·
I maintainer di solito rispondono entro 1 giorno
-
ScalingModifiers formula fails with "formula returned non-float result" when expression evaluates to an integerForse già presa @Sarthak-Pandey l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
kedacore/keda#8270 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno