Play apps with a bundled start script split JAVA_OPTS unquoted, breaking multi-word values
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Domínio
- cloud, devops, infrastructure
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 452
- Forks
- 2.5k
- Merge médio
- 1d 2h
- PRs com merge (30d)
- 23
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cloudfoundry/java-buildpack
-
v5.1.0 GA release planAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 68/100
cloudfoundry/java-buildpack#1423 ·
Mantenedores costumam responder em até 1 dia
-
Support configurable initial/minimum heap size relative to (/as a percentage of) calculated XmxAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
cloudfoundry/java-buildpack#1377 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 52/100
cloudfoundry/java-buildpack#1364 ·
Mantenedores costumam responder em até 1 dia
-
elastic-otel-java supportAberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
cloudfoundry/java-buildpack#1342 · 1 comentário · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
cloudfoundry/java-buildpack#1151 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de cloudfoundry/java-buildpack
Issues semelhantes
-
agent-research-recommend agent-review-finding chore
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
jordansmall/spindrift#4821 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:web
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
praetorianer777/GoTome#178 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
oracle/go-oracledb#105 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia