Skip to content

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

Merged
okumin merged 1 commit into
apache:masterfrom
kokila-19:docker_verbose_bug
Jun 1, 2025
Merged

HIVE-28973: Metastore service in Docker fails to start unless --verbose is explicitly set#5830
okumin merged 1 commit into
apache:masterfrom
kokila-19:docker_verbose_bug

Conversation

@kokila-19

Copy link
Copy Markdown
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

okumin commented May 30, 2025

Copy link
Copy Markdown
Contributor

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

@okumin

okumin commented May 30, 2025

Copy link
Copy Markdown
Contributor

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

okumin commented May 30, 2025

Copy link
Copy Markdown
Contributor

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

okumin commented May 30, 2025

Copy link
Copy Markdown
Contributor

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...

@okumin okumin left a comment

Copy link
Copy Markdown
Contributor

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.
@sonarqubecloud

Copy link
Copy Markdown

@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

okumin commented Jun 1, 2025

Copy link
Copy Markdown
Contributor

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

@kokila-19

Copy link
Copy Markdown
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