Skip to content

Fixes #26930: Fix false positive in prerequisite check#26931

Open
oluies wants to merge 2 commits intoopen-metadata:mainfrom
oluies:issue-26930
Open

Fixes #26930: Fix false positive in prerequisite check#26931
oluies wants to merge 2 commits intoopen-metadata:mainfrom
oluies:issue-26930

Conversation

@oluies
Copy link
Copy Markdown

@oluies oluies commented Apr 1, 2026

Here is the completed PR description based on the fix we discussed. You can copy and paste this directly into your GitHub PR:

Describe your changes:

Fixes #26930

The check_prerequisites.sh script had a logic flaw where it used command substitution $(...) to call the check_command_existence function. In Bash, this spawns a subshell, meaning any updates to the global code variable (used to track failures) were lost once the subshell terminated. Consequently, the script would print errors for missing tools but still conclude with "✓ All prerequisites are met" and exit with a success code (0).

Changes made:

  • Refactored the main loop to call functions directly instead of using subshells, allowing the code variable to persist.
  • Updated check_version to use local variables correctly, preventing logic errors during version comparison.
  • Replaced the which command with the more portable command -v.
  • Fixed garbled character encoding for the terminal checkmarks/crosses.

How I tested these changes:

  • Purposely uninstalled java and antlr4 and ran ./scripts/check_prerequisites.sh.
  • Confirmed the script now correctly outputs ✗ ERROR: Some prerequisites are not met. at the end.
  • Verified the exit code is now 1 (or 2) instead of 0 when dependencies are missing.

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the [CONTRIBUTING](https://docs.open-metadata.org/developers/contribute) document.

  • My PR title is Fixes #<ISSUE_NUMBER>: Fix false positive in prerequisite check

  • I have commented on my code, particularly in hard-to-understand areas.

  • I have verified the fix by running the script in an environment with missing dependencies.

the script reported "All prerequisites are met" despite missing dependencies. The issue was caused by calling check functions 
within subshells, which prevented the global status variable from updating.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 2, 2026

Code Review ✅ Approved

Fixes false positive in prerequisite check that was incorrectly reporting all prerequisites as met. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

check_prerequisites.sh script incorrectly reports

1 participant