[joern-install] don't pass empty --dbversion to joern-scan - #6266
Merged
Merged
Conversation
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.
maltek
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shnon-interactively without--version, soJOERN_VERSIONis empty. The unquoted expansion in./joern-scan --updatedb --dbversion $JOERN_VERSIONleaves a dangling
--dbversionwith 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, andset -euthen 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
--dbversionwhen 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-scanreproducing the post-#6242 rejection behavior:JOERN_VERSION→joern-scan --updatedb→ exit 0 (previously: rejected args, exit 1)JOERN_VERSION=4.0.622→joern-scan --updatedb --dbversion 4.0.622→ exit 0sh -n joern-install.shpasses.