Skip to content

HIVE-28973: Metastore service in Docker fails to start unless --verbose is explicitly set #5830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2025

Conversation

kokila-19
Copy link
Contributor

…se is explicitly set

What changes were proposed in this pull request?

This commit avoids appending the --verbose flag when it's not explicitly set, preventing invalid arguments from being passed during metastore startup.

Why are the changes needed?

When VERBOSE is not set, an empty string argument ("") is passed to the startup command, which causes a parsing error.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Docker commands:
Without Verbose:
docker run -d -p 9083:9083 --env SERVICE_NAME=metastore --name metastore-standalone apache/hive:${HIVE_VERSION}
With Verbose:
docker run -d -p 9083:9083 --env SERVICE_NAME=metastore --env VERBOSE="true" --name metastore-standalone apache/hive:${HIVE_VERSION}

@okumin
Copy link
Contributor

okumin commented May 30, 2025

Probably, it's my fault that I didn't check HMS. Thanks for reporting the issue. I'm checking it...
#5797

@okumin
Copy link
Contributor

okumin commented May 30, 2025

I successfully reproduced the issue on the master branch.

% docker run --rm --env SERVICE_NAME=metastore --name metastore-standalone apache/hive:4.1.0-SNAPSHOT
...
This usage has been deprecated, consider using the new command line syntax (run with -h to see usage information)
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:592)
	at java.lang.Integer.parseInt(Integer.java:615)
	at org.apache.hadoop.hive.metastore.HiveMetastoreCli.parse(HiveMetastoreCli.java:59)
	at org.apache.hadoop.hive.metastore.HiveMetaStore.main(HiveMetaStore.java:241)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:330)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:245)

HiveServer2 is okay.

% docker run --rm --env SERVICE_NAME=hiveserver2 --name hiveserver2 apache/hive:4.1.0-SNAPSHOT

Next, I will test the patch.

@okumin
Copy link
Contributor

okumin commented May 30, 2025

With the patch, all commands are very successful.

% docker run --rm --env SERVICE_NAME=metastore --name metastore-standalone apache/hive:4.1.0-SNAPSHOT
% docker run --rm --env SERVICE_NAME=metastore --env VERBOSE="true" --name metastore-standalone apache/hive:4.1.0-SNAPSHOT
% docker run --rm --env SERVICE_NAME=hiveserver2 --name hiveserver2 apache/hive:4.1.0-SNAPSHOT

@okumin
Copy link
Contributor

okumin commented May 30, 2025

Shellcheck does not report issues about the changed part.

% docker run --rm -v "$PWD:/mnt" koalaman/shellcheck-alpine:v0.10.0 sh -c "shellcheck -x /mnt/packaging/src/docker/entrypoint.sh"

In /mnt/packaging/src/docker/entrypoint.sh line 37:
  if [ $? -eq 0 ]; then
       ^-- SC2181 (style): Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

For more information:
  https://www.shellcheck.net/wiki/SC2181 -- Check exit code directly with e.g...

Copy link
Contributor

@okumin okumin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…se is explicitly set

When VERBOSE is not set, an empty string argument ("") is passed to the startup
command, which causes a parsing error. This commit avoids appending the
--verbose flag when it's not explicitly set, preventing invalid arguments
from being passed during metastore startup.
Copy link

@okumin okumin changed the title HIVE-28973: Metastore service in Docker fails to start unless --verbo… HIVE-28973: Metastore service in Docker fails to start unless --verbose is explicitly set Jun 1, 2025
@okumin okumin merged commit 965a6a4 into apache:master Jun 1, 2025
6 checks passed
@okumin
Copy link
Contributor

okumin commented Jun 1, 2025

@kokila-19 Thanks for reporting and fixing the issue!

@kokila-19
Copy link
Contributor Author

Thank you @okumin for the review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants