Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Play apps with a bundled start script split JAVA_OPTS unquoted, breaking multi-word values

Abierto
#1,441 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
bash, go, java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
452
Forks
2.5k
Merge medio
1 d 2 h
PR fusionados (30 d)
23

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudfoundry/java-buildpack

Todos los issues de cloudfoundry/java-buildpack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.