-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
Probably, it's my fault that I didn't check HMS. Thanks for reporting the issue. I'm checking it... |
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. |
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 |
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... |
There was a problem hiding this 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.
b47ef89
to
ed83df3
Compare
|
@kokila-19 Thanks for reporting and fixing the issue! |
Thank you @okumin for the review and merge. |
…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}