Elaborating error message when incorrect port number is specified in impala-shell.
I recently helped debug an issue where impala-shell was being given the hiveserver2 port rather than the beeswax port. I've updated the error message a little bit to indicate that this may be the issue. Here is the new message: $impala-shell.sh -i ....:21050 -q 'select 1' Starting Impala Shell without Kerberos authentication Error: Unable to communicate with impalad service. This service may not be an impalad instance. A common problem is that the port specified does not match the -beeswax_port flag on the underlying impalad. Check host:port and try again. Traceback (most recent call last): File "/home/philip/src/Impala/shell/impala_shell.py", line 1709, in <module> execute_queries_non_interactive_mode(options, query_options) File "/home/philip/src/Impala/shell/impala_shell.py", line 1565, in execute_queries_non_interactive_mode shell = ImpalaShell(options, query_options) File "/home/philip/src/Impala/shell/impala_shell.py", line 232, in __init__ self.do_connect(options.impalad) File "/home/philip/src/Impala/shell/impala_shell.py", line 798, in do_connect self._connect() File "/home/philip/src/Impala/shell/impala_shell.py", line 842, in _connect result = self.imp_client.connect() File "/home/philip/src/Impala/shell/impala_client.py", line 257, in connect result = self.ping_impala_service() File "/home/philip/src/Impala/shell/impala_client.py", line 262, in ping_impala_service return self.imp_service.PingImpalaService() File "/home/philip/src/Impala/shell/gen-py/ImpalaService/ImpalaService.py", line 229, in PingImpalaService return self.recv_PingImpalaService() File "/home/philip/src/Impala/shell/gen-py/ImpalaService/ImpalaService.py", line 245, in recv_PingImpalaService raise x thrift.Thrift.TApplicationException: Invalid method name: 'PingImpalaService' Change-Id: I14465e8f666c4a5f3968db8864dfdb1205641a33 Reviewed-on: http://gerrit.cloudera.org:8080/11368 Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/8e7818a2 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/8e7818a2 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/8e7818a2 Branch: refs/heads/master Commit: 8e7818a2df2abc74859921645f1976ba1cc5f470 Parents: 72ee4a4 Author: Philip Zeyliger <phi...@cloudera.com> Authored: Thu Aug 30 15:20:40 2018 -0700 Committer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Committed: Wed Sep 5 22:12:24 2018 +0000 ---------------------------------------------------------------------- shell/impala_shell.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/8e7818a2/shell/impala_shell.py ---------------------------------------------------------------------- diff --git a/shell/impala_shell.py b/shell/impala_shell.py index 268f229..2f7cc9a 100755 --- a/shell/impala_shell.py +++ b/shell/impala_shell.py @@ -845,8 +845,11 @@ class ImpalaShell(object, cmd.Cmd): except TApplicationException: # We get a TApplicationException if the transport is valid, # but the RPC does not exist. - print_to_stderr("Error: Unable to communicate with impalad service. This " - "service may not be an impalad instance. Check host:port and try again.") + print_to_stderr("\n".join(textwrap.wrap( + "Error: Unable to communicate with impalad service. This " + "service may not be an impalad instance. A common problem is " + "that the port specified does not match the -beeswax_port flag on " + "the underlying impalad. Check host:port and try again."))) self.imp_client.close_connection() raise except ImportError: