Custom APP_LOG paths containing spaces are split into separate Java arguments

Open Beginner friendly
#5,726 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, java, shell
Domain
backend, devops

Research direction

Start with apollo-adminservice/src/main/scripts/startup.sh, especially the JAVA_OPTS construction near line 56 and its expansion near lines 186–188. Reproduce the issue with the Java stub command in the report, then inspect the configservice and portal startup scripts for the same pattern. Done when an APP_LOG path containing spaces reaches Java as one complete logging property argument and the related scripts handle it consistently.

Written by the indexing model from the issue text.

Description

Hullo folks,

I'm doing some research for Tessl Code Review and we ran it against your repo. It flagged a potential issue, and I figured it made sense to share it with you:

Describe the bug

An APP_LOG path containing a space is split when the startup script invokes Java. For example, /tmp/apollo-argv/my app.log reaches Java as -Dlogging.file.name=/tmp/apollo-argv/my followed by a separate app.log argument.

The setting is appended to the string-valued JAVA_OPTS, which is later expanded unquoted. Java should receive the complete logging property as one argument. The separate non-option argument can instead be treated as a main-class name, preventing startup.

To reproduce

From the repository root, use an argument-printing Java stub to inspect the real startup script without starting a server:

repro_dir=$(mktemp -d)
mkdir -p "$repro_dir/jdk/bin"
cat > "$repro_dir/jdk/bin/java" <<'JAVA'
#!/bin/bash
if [[ "$1" == "-version" ]]; then
  echo 'openjdk version "17.0.1"' >&2
  exit 0
fi
printf '<%s>\n' "$@"
JAVA
chmod +x "$repro_dir/jdk/bin/java"
JAVA_HOME="$repro_dir/jdk" LOG_DIR="$repro_dir/logs" \
  APP_LOG="$repro_dir/my app.log" APOLLO_RUN_MODE=Docker JAVA_OPTS= \
  bash apollo-adminservice/src/main/scripts/startup.sh

The output contains two arguments:

<-Dlogging.file.name=.../my>
<app.log>

Changing only APP_LOG to $repro_dir/app.log produces one complete property argument.

Additional details and logs

Codex ran both cases against 69a2b1fc0ef43744f9357b07ad1912c54981b38c on macOS arm64 with Bash. This validates the argument construction, not a full Apollo/JVM deployment. The configservice and portal scripts have the same string expansion pattern by source inspection. I found no matching issue or open PR; this remains after #5682.

Full transparency: I work at Tessl, and we've spotted that using Tessl Code Review - using repository-level context and specific review lenses that improve over time through feedback. That’s how this finding surfaced.

We’re just getting started and want to offer the tool free to open-source projects. If this is useful, happy to give you access.

Baptiste

Dominant language
Java
Stars
29.8k
Forks
10.1k
Avg merge
4d 2h
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apolloconfig/apollo

All issues in apolloconfig/apollo

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.