You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "Oleg Tarassov (Jira)" <ji...@apache.org> on 2019/12/06 02:53:00 UTC

[jira] [Commented] (PHOENIX-5598) Python phoenixdb unable to connect with Phoenix 5.x on HDP 3.1

    [ https://issues.apache.org/jira/browse/PHOENIX-5598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16989345#comment-16989345 ] 

Oleg Tarassov commented on PHOENIX-5598:
----------------------------------------

Hi [~elserj],

 

I did and thats why i filled a bug because the URL somehow has an appended port 2181 at the end of the concatenated string.

 

Here is the python code that i control, the rest comes from either phoenix server or the code:
...
 query = module.params["query"].replace(";", "")# select DISTINCT TABLE_NAME from SYSTEM.CATALOG
 host = module.params["host"].strip("http://") # bpl-cookie-hdp-master-00.devops.guavus.mtl port = module.params["port"] # 8765
...
 database_url = "http://\{0}:\{1}/".format(host, port) database_conn = phoenixdb.connect(database_url, autocommit=True)
 cursor = database_conn.cursor(cursor_factory=phoenixdb.cursor.DictCursor)
 

From HBASE configuration:
 
{code:java}
<name>yarn.resourcemanager.zk-address</name>
<value>
bpl-cookie-hdp-infra-00.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-01.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-02.devops.guavus.mtl:2181
</value>
<name>hbase.zookeeper.quorum</name>
<value>bpl-cookie-hdp-infra-00.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-01.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-02.devops.guavus.mtl:2181
</value>
<name>ha.zookeeper.quorum</name>
<value>bpl-cookie-hdp-infra-00.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-01.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-02.devops.guavus.mtl:2181
</value>
<name>hadoop.registry.zk.quorum</name>
<value>bpl-cookie-hdp-infra-00.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-01.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-02.devops.guavus.mtl:2181
</value>{code}
 
 

Attached screenshot from hbase master:

!Screen Shot 2019-12-05 at 21.48.28.png!

 

 

d

SSo yes, I did read the error and willing to dig further to understand why python phoenix library does this magic append of port for an HA cluster when to my recollection our other Java code does not show such signs.

 

 

TThank you in advance for your help

 

SOleg

 

> Python phoenixdb unable to connect with Phoenix 5.x on HDP 3.1
> --------------------------------------------------------------
>
>                 Key: PHOENIX-5598
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5598
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Oleg Tarassov
>            Priority: Major
>         Attachments: Screen Shot 2019-12-05 at 21.42.12.png, Screen Shot 2019-12-05 at 21.48.28.png
>
>
> Currently developing an ansible module *phoenix_query* that uses python library phoenixdb to establish connection onto Phoenix Query Server and pass its query.
> h3. Environment versions:
> Python: 3.7.4
> phoenixdb: 0.7
> h3. It work for the following versions:
> Phoenix: 4.7
> HDP: 2.6
> h3. It fails for the following version:
> Phoenix: 5.0
> HDP: 3.1
> h3. Issue:
> The URL appends an extra zookeeper port(2181) and makes the URL invalid.
> h3. Command Used:
> {code:java}
> ...
>  query = module.params["query"].replace(";", "")# select DISTINCT TABLE_NAME from SYSTEM.CATALOG
>  host = module.params["host"].strip("http://") # bpl-cookie-hdp-master-00.devops.guavus.mtl
>  port = module.params["port"] # 8765
> ...
>  database_url = "http://{0}:{1}/".format(host, port)
>  database_conn = phoenixdb.connect(database_url, autocommit=True)
>  cursor = database_conn.cursor(cursor_factory=phoenixdb.cursor.DictCursor)
> {code}
>  
> h3. Trace error:
> {code:java}
> An exception occurred during task execution. To see the full traceback, use -vvv. The error was: phoenixdb.errors.OperationalError: ('Malformed connection url. :bpl-cookie-hdp-infra-00.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-01.devops .guavus.mtl:2181,bpl-cookie-hdp-infra-02.devops.guavus.mtl:2181:2181:/hbase-unsecure;', 102, '08001', None) fatal: [localhost]: FAILED! => { "changed": false, "rc": 1 }MSG:MODULE FAILURE See stdout/stderr for the exact error MODULE_STDERR:Traceback (most recent call last): File "/Users/oleg/.ansible/tmp/ansible-tmp-1575127117.741261-241194887276054/AnsiballZ_phoenix_query.py", line 102, in <module> _ansiballz_main() File "/Users/oleg/.ansible/tmp/ansible-tmp-1575127117.741261-241194887276054/AnsiballZ_phoenix_query.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/Users/oleg/.ansible/tmp/ansible-tmp-1575127117.741261-241194887276054/AnsiballZ_phoenix_query.py", line 40, in invoke_module runpy.run_module(mod_name='ansible.modules.phoenix_query', init_globals=None, run_name='__main__', alter_sys=True) File "/Users/oleg/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 205, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "/Users/oleg/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "/Users/oleg/.pyenv/versions/3.7.4/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/var/folders/p9/jgzk_ry55875dsfrh5p0gx_c0000gn/T/ansible_phoenix_query_payload_0o9jhail/ansible_phoenix_query_payload.zip/ansible/modules/phoenix_query.py", line 155, in <module> File "/var/folders/p9/jgzk_ry55875dsfrh5p0gx_c0000gn/T/ansible_phoenix_query_payload_0o9jhail/ansible_phoenix_query_payload.zip/ansible/modules/phoenix_query.py", line 151, in main File "/var/folders/p9/jgzk_ry55875dsfrh5p0gx_c0000gn/T/ansible_phoenix_query_payload_0o9jhail/ansible_phoenix_query_payload.zip/ansible/modules/phoenix_query.py", line 123, in run_module File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/__init__.py", line 67, in connect return Connection(client, **kwargs) File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/connection.py", line 56, in __init__ self.open() File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/connection.py", line 73, in open self._client.open_connection(self._id, info=self._connection_args) File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/avatica.py", line 329, in open_connection response_data = self._apply(request) File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/avatica.py", line 216, in _apply parse_error_protobuf(response_body) File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/avatica.py", line 127, in parse_error_protobuf parse_and_raise_sql_error(err.error_message) File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/avatica.py", line 108, in parse_and_raise_sql_error raise_sql_error(int(code), sqlstate, message) File "/Users/oleg/.local/share/virtualenvs/ansible-collection-alarm_iq-qR_XbeGf/lib/python3.7/site-packages/phoenixdb/avatica.py", line 101, in raise_sql_error raise error_class(message, code, sqlstate) phoenixdb.errors.OperationalError: ('Malformed connection url. :bpl-cookie-hdp-infra-00.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-01.devops.guavus.mtl:2181,bpl-cookie-hdp-infra-02.devops.guavus.mtl:2181:2181:/hbase-unsecure;', 102, '080 01', None){code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)