Skip to content
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

Unable to connect with Vertica #3232

Closed
Juanan92 opened this issue Aug 3, 2017 · 6 comments
Closed

Unable to connect with Vertica #3232

Juanan92 opened this issue Aug 3, 2017 · 6 comments

Comments

@Juanan92
Copy link

Juanan92 commented Aug 3, 2017

Superset version

0.18.5

Hi everyone,
I'm trying to connect Superset with a Vertica database through Sources > Databases with the SQLAlchemy URI
vertica+vertica_python://user:passwd@hostname:5432/DB
error2
and I got the following error:
ERROR: {"error": "Connection failed!\n\nThe error message returned was:\n'NoneType' object has no attribute '__getitem__'"}
error1
I have already installed the Vertica connector (pip install sqlalchemy-vertica-python) and I have sucessfully connected to a Redshift database.
Any ideas?
Sorry for my noobness...
Thanks in advance

@xrmx
Copy link
Contributor

xrmx commented Aug 3, 2017

Full stackstrace please. Also this driver looks a bit more maintained than the one you are using https://pypi.python.org/pypi/sqlalchemy-vertica

@hc000
Copy link

hc000 commented Oct 3, 2017

@xrmx I tried the new package, got this error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/superset/views/core.py", line 1414, in testconn
    engine = create_engine(uri, connect_args=connect_args)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/__init__.py", line 391, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/strategies.py", line 88, in create
    dialect = dialect_cls(**dialect_args)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/dialects/postgresql/base.py", line 2083, in __init__
    default.DefaultDialect.__init__(self, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/default.py", line 196, in __init__
    self.paramstyle = self.dbapi.paramstyle
AttributeError: module 'sqlalchemy_vertica' has no attribute 'paramstyle'```


using the old package, got this error

`Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/superset/views/core.py", line 1415, in testconn
    engine.connect()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2091, in connect
    return self._connection_cls(self, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 90, in __init__
    if connection is not None else engine.raw_connection()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2177, in raw_connection
    self.pool.unique_connection, _connection)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2151, in _wrap_pool_connect
    e, dialect, self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 1465, in _handle_dbapi_exception_noconnection
    exc_info
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2147, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 328, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 766, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 516, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1138, in _do_get
    self._dec_overflow()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1135, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 333, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 461, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 651, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/strategies.py", line 105, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/default.py", line 393, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 25, in connect
    return Connection(kwargs)
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 45, in __init__
    self.startup_connection()
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 271, in startup_connection
    'salt': getattr(message, 'salt', None)}))
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 180, in write
    raise_from(errors.ConnectionError, e)
  File "<string>", line 2, in raise_from
sqlalchemy.exc.DatabaseError: (vertica_python.errors.ConnectionError) 
`

running it outside of apache super set yields this error:

`>>> sa.create_engine('vertica+vertica_python://user:pass@ip:port/name').connect()
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1122, in _do_get
    return self._pool.get(wait, self._timeout)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/queue.py", line 145, in get
    raise Empty
sqlalchemy.util.queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 166, in write
    for data in message.fetch_message():
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/messages/message.py", line 84, in fetch_message
    yield self.get_message()
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/messages/message.py", line 80, in get_message
    bytes_ = self.read_bytes()
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/messages/frontend_messages/password.py", line 60, in read_bytes
    encoded_pw = self.encoded_password()
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/messages/frontend_messages/password.py", line 57, in encoded_password
    raise ValueError("unsupported authentication method: {0}".format(self._auth_method))
ValueError: unsupported authentication method: 11

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2147, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 328, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 766, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 516, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1138, in _do_get
    self._dec_overflow()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1135, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 333, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 461, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 651, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/strategies.py", line 105, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/default.py", line 393, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 25, in connect
    return Connection(kwargs)
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 45, in __init__
    self.startup_connection()
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 271, in startup_connection
    'salt': getattr(message, 'salt', None)}))
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 180, in write
    raise_from(errors.ConnectionError, e)
  File "<string>", line 2, in raise_from
vertica_python.errors.ConnectionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2091, in connect
    return self._connection_cls(self, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 90, in __init__
    if connection is not None else engine.raw_connection()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2177, in raw_connection
    self.pool.unique_connection, _connection)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2151, in _wrap_pool_connect
    e, dialect, self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 1465, in _handle_dbapi_exception_noconnection
    exc_info
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/base.py", line 2147, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 328, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 766, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 516, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1138, in _do_get
    self._dec_overflow()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 1135, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 333, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 461, in __init__
    self.__connect(first_connect_check=True)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/pool.py", line 651, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/strategies.py", line 105, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy/engine/default.py", line 393, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 25, in connect
    return Connection(kwargs)
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 45, in __init__
    self.startup_connection()
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 271, in startup_connection
    'salt': getattr(message, 'salt', None)}))
  File "/usr/local/lib/python3.5/dist-packages/vertica_python/vertica/connection.py", line 180, in write
    raise_from(errors.ConnectionError, e)
  File "<string>", line 2, in raise_from
sqlalchemy.exc.DatabaseError: (vertica_python.errors.ConnectionError)`

@hc000
Copy link

hc000 commented Oct 3, 2017

when using an incorrect credentials I get invalid username or password error.
so I think its connecting and authenticate but it fails afterwards

@xrmx
Copy link
Contributor

xrmx commented Oct 4, 2017

@hc000 none of the stacktraces you posted are superset issues and you need to use triple backquote to quote them otherwise they are unreadable. Better option is to open an issue to the vertica dialect with the first stackstrace and ask for help there.

@hc000
Copy link

hc000 commented Oct 4, 2017

@xrmx I only used these python library because it was mentioned specifically in the superset documentation https://superset.incubator.apache.org/installation.html

I followed the documentation for vertica and it doesn't work. I posted the errors above.

It does seem like the issue is NOT with superset specifically, but the docs recommends those package and says it supports vertica.

@mistercrunch
Copy link
Member

Notice: this issue has been closed because it has been inactive for 200 days. Feel free to comment and request for this issue to be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants