Skip to content

Connector does not report underlying problem with connection #262

Closed

Description

@drewaogle

Copy of https://github.com/aperture-data/athena/issues/1116

If authentication fails, you will get an error like:

Python output --------------------------------------------------------------------------- KeyError Traceback (most recent call last) File /opt/conda/lib/python3.11/site-packages/aperturedb/Connector.py:113, in Connector.authenticate(self, shared_data, user, password, token) 112 try: --> 113 self._authenticate(user, password, token) 114 except Exception as e: File /opt/conda/lib/python3.11/site-packages/aperturedb/Connector.py:165, in Connector._authenticate(self, user, password, token) 163 response, _ = self._query(query) --> 165 session_info = response[0]["Authenticate"] 166 if session_info["status"] != 0:

KeyError: 'Authenticate'

During handling of the above exception, another exception occurred:

Exception Traceback (most recent call last)
Cell In[7], line 3
1 from aperturedb import Connector
----> 3 db = Connector.Connector("172.17.0.4", 55555,
4 user="admin", password="admin", authenticate=True)

File /opt/conda/lib/python3.11/site-packages/aperturedb/Connector.py:105, in Connector.init(self, host, port, user, password, token, use_ssl, shared_data, authenticate)
102 self._connect()
104 if authenticate:
--> 105 self.authenticate(shared_data, user, password, token)

File /opt/conda/lib/python3.11/site-packages/aperturedb/Connector.py:115, in Connector.authenticate(self, shared_data, user, password, token)
113 self._authenticate(user, password, token)
114 except Exception as e:
--> 115 raise Exception("Authentication failed:", str(e))
116 else:
117 self.shared_data = shared_data

It would be helpful to print last_response in this case, as it likely sheds more light on the underlying problem.

Activity

  1. self-assigned this
    on Jul 27, 2023
  2. drewaogle commented on Jul 27, 2023

    @drewaogle
    ContributorAuthor
  3. luisremis commented on Jul 27, 2023

    @luisremis
    Contributor
  4. gsaluja9 commented on Aug 3, 2023

    @gsaluja9
    Contributor

    This is addressed in #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions