Support Questions

Find answers, ask questions, and share your expertise

Cannot connect to Phoenix using Phoenix Query Server sqlline-thin.py

avatar
Explorer

Hi folks,

trying to build a local data engineering environment based around HBase and Phoenix. I've manually downloaded and configured all the packages and I'm trying to connect using to Phoenix via the PQS. The PQS is running but when I try and connect I'm getting the following error:

 

[hduser@dataengineering ~]$ sqlline-thin.py
Picked up _JAVA_OPTIONS: -Xmx4096m
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect -p driver org.apache.phoenix.queryserver.client.Driver -p user "none" -p password "none" "jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF"
Connecting to jdbc:phoenix:thin:url=http://localhost:8765;serialization=PROTOBUF
java.lang.IllegalArgumentException: Cannot fetch parser for Response with missing class name
at org.apache.calcite.avatica.remote.ProtobufTranslationImpl.getParserForResponse(ProtobufTranslationImpl.java:332)
at org.apache.calcite.avatica.remote.ProtobufTranslationImpl.parseResponse(ProtobufTranslationImpl.java:437)
at org.apache.calcite.avatica.remote.RemoteProtobufService._apply(RemoteProtobufService.java:52)
at org.apache.calcite.avatica.remote.ProtobufService.apply(ProtobufService.java:81)
at org.apache.calcite.avatica.remote.Driver.connect(Driver.java:176)
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:135)
at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:192)
at sqlline.Commands.connect(Commands.java:1364)
at sqlline.Commands.connect(Commands.java:1244)
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 sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
at sqlline.SqlLine.dispatch(SqlLine.java:730)
at sqlline.SqlLine.initArgs(SqlLine.java:410)
at sqlline.SqlLine.begin(SqlLine.java:515)
at sqlline.SqlLine.start(SqlLine.java:267)
at sqlline.SqlLine.main(SqlLine.java:206)
at org.apache.phoenix.queryserver.client.SqllineWrapper.main(SqllineWrapper.java:64)
sqlline version 1.9.0

 

I have no problems using phoenix sqlline.py

 

 

[hduser@dataengineering ~]$ sqlline.py
Picked up _JAVA_OPTIONS: -Xmx4096m
Setting property: [incremental, false]
Setting property: [isolation, TRANSACTION_READ_COMMITTED]
issuing: !connect -p driver org.apache.phoenix.jdbc.PhoenixDriver -p user "none" -p password "none" "jdbc:phoenix:"
Connecting to jdbc:phoenix:
Connected to: Phoenix (version 5.1)
Driver: PhoenixEmbeddedDriver (version 5.1)
Autocommit status: true
Transaction isolation: TRANSACTION_READ_COMMITTED
sqlline version 1.9.0
0: jdbc:phoenix:> !quit

 

Any ideas?

1 REPLY 1

avatar
Super Collaborator

@wallacei 

Error:

sqlline-thin.py is configured to use Protobuf serialization for communication with PQS.
Protobuf relies on pre-defined class names to parse responses from the server.
The error message suggests that sqlline-thin.py is unable to find the class name for a specific response message from PQS.
===================

Check PQS Configuration:
Ensure PQS is configured to use Protobuf serialization as well. This might involve checking configuration files or options during PQS startup.

Verify Library Versions:
Make sure the versions of sqlline-thin.py and the Phoenix libraries (including PQS) are compatible. Inconsistent versions might lead to class name mismatch issues. You can check the documentation for sqlline-thin.py for specific version compatibility information.

Consider sqlline.py (Regular JDBC):
As your sqlline.py script works with regular JDBC, it suggests the basic Phoenix connection is functional. You might consider using sqlline.py for now while troubleshooting the Protobuf issue with sqlline-thin.py.

Alternative Tools:
If sqlline-thin.py continues to cause problems, explore alternative tools for connecting to Phoenix like the Phoenix JDBC thin client or a GUI client like Squirrel SQL.

Double-check the connection URL in sqlline-thin.py. Ensure it points to the correct PQS endpoint (http://localhost:8765 by default).