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

SqlLab + Datasource "down" is a 500, but no error in UI #1530

Closed
wyndhblb opened this issue Nov 2, 2016 · 2 comments · Fixed by #2709
Closed

SqlLab + Datasource "down" is a 500, but no error in UI #1530

wyndhblb opened this issue Nov 2, 2016 · 2 comments · Fixed by #2709

Comments

@wyndhblb
Copy link
Contributor

wyndhblb commented Nov 2, 2016

Should a Datasource by down, SQLLab (the table/schemas parts) "spins forever" even though a 500 exception was thrown from the getting of a data source

(not sure if this is only limited to pyhive, but a 500 was certainly tossed to the client)

The UI should probably mention the "this failed".

[02/Nov/2016 23:17:08] "GET /databasetablesasync/api/read?_flt_0_id=4 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2000, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/contrib/fixers.py", line 152, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1991, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1567, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/decorators.py", line 52, in wraps
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/views.py", line 219, in api_read
    result = self.datamodel.get_values_json(lst, self.list_columns)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/models/base.py", line 95, in get_values_json
    for item in self.get_values(lst, list_columns):
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/models/base.py", line 87, in get_values
    retdict[col] = self._get_attr_value(item, col)
  File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/models/base.py", line 44, in _get_attr_value
    return getattr(item, col)()
  File "/usr/local/lib/python2.7/dist-packages/caravel/models.py", line 496, in all_table_names
    return sorted(self.inspector.get_table_names(schema))
  File "/usr/local/lib/python2.7/dist-packages/caravel/models.py", line 493, in inspector
    return sqla.inspect(engine)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/inspection.py", line 63, in inspect
    ret = reg(subject)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line 139, in _insp
    return Inspector.from_engine(bind)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line 135, in from_engine
    return Inspector(bind)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/reflection.py", line 109, in __init__
    bind.connect().close()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2018, in connect
    return self._connection_cls(self, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 72, in __init__
    if connection is not None else engine.raw_connection()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2104, in raw_connection
    self.pool.unique_connection, _connection)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2074, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 318, in unique_connection
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 713, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 480, in checkout
    rec = pool._do_get()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 1060, in _do_get
    self._dec_overflow()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 1057, in _do_get
    return self._create_connection()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 323, in _create_connection
    return _ConnectionRecord(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 449, in __init__
    self.connection = self.__connect()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 607, in __connect
    connection = self.__pool._invoke_creator(self)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 97, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 385, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python2.7/dist-packages/pyhive/hive.py", line 63, in connect
    return Connection(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyhive/hive.py", line 104, in __init__
    self._transport.open()
  File "/usr/local/lib/python2.7/dist-packages/thrift_sasl/__init__.py", line 61, in open
    self._trans.open()
  File "/usr/local/lib/python2.7/dist-packages/thrift/transport/TSocket.py", line 101, in open
    message=message)

Caravel version

latest (0.12.0)

@msyafiqmazli
Copy link

I faced same issue like above.

@mistercrunch
Copy link
Member

This PR should help #2709

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

Successfully merging a pull request may close this issue.

3 participants