Skip to content

[joern-install] don't pass empty --dbversion to joern-scan - #6266

Merged
max-leuthaeuser merged 1 commit into
masterfrom
max/fix-joern-install-empty-dbversion
Sep 8, 2026
Merged

max-leuthaeuser merged 1 commit into
masterfrom
max/fix-joern-install-empty-dbversion

Conversation

@max-leuthaeuser

Copy link
Copy Markdown
Contributor

Problem

The scheduled Upload Container image workflow has been failing since the v4.0.620 release. The docker build (ci/Dockerfile.alma, ci/Dockerfile.alma8) runs ./joern-install.sh non-interactively without --version, so JOERN_VERSION is empty. The unquoted expansion in

./joern-scan --updatedb --dbversion $JOERN_VERSION

leaves a dangling --dbversion with no value, which scopt rejects (Missing value for option --dbversion). Until v4.0.620 this was invisible because joern-scan exited 0 for rejected argument lists; since da76236 (#6242) it exits 1, and set -eu then aborts the installer, failing the image build.

Side effect of the old lenient exit code: since #3032 (2023), the default querydb installation has been silently skipped in every non-interactive install that didn't pass --version — including the published container images.

Fix

Only pass --dbversion when a version was actually given, and quote the variable. With no --version, joern-scan's own default (latest) applies.

Testing

No automated coverage exists for the installer script (no CI job executes it — which is how this rotted unnoticed). Verified manually with a mock joern-scan reproducing the post-#6242 rejection behavior:

  • empty JOERN_VERSIONjoern-scan --updatedb → exit 0 (previously: rejected args, exit 1)
  • JOERN_VERSION=4.0.622joern-scan --updatedb --dbversion 4.0.622 → exit 0

sh -n joern-install.sh passes.

When no --version is given, JOERN_VERSION is empty and the unquoted
expansion left a dangling '--dbversion' with no value, which scopt
rejects. Until v4.0.620 this was invisible because joern-scan exited 0
for rejected argument lists; since da76236 (#6242) it exits 1, and
'set -eu' then aborts the installer, failing the container image
builds (ci/Dockerfile.alma, ci/Dockerfile.alma8).

Side effect of the old behavior: since #3032 the default querydb
installation was silently skipped in every non-interactive install
that did not pass --version.

Only pass --dbversion when a version was actually given, and quote it.
@max-leuthaeuser
max-leuthaeuser merged commit b0b102b into master Sep 8, 2026
15 of 16 checks passed
@max-leuthaeuser
max-leuthaeuser deleted the max/fix-joern-install-empty-dbversion branch September 8, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants