HIVE-28973: Metastore service in Docker fails to start unless --verbose is explicitly set#5830
Merged
Merged
Conversation
Contributor
|
Probably, it's my fault that I didn't check HMS. Thanks for reporting the issue. I'm checking it... |
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-SNAPSHOTNext, I will test the patch. |
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 |
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... |
…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.
b47ef89 to
ed83df3
Compare
|
Contributor
|
@kokila-19 Thanks for reporting and fixing the issue! |
Contributor
Author
|
Thank you @okumin for the review and merge. |
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.



…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}