Support Questions

Find answers, ask questions, and share your expertise

Druid Superset Won't Start on HDP 2.6

Druid Superset does not start on HDP 2.6.

Version detail:

HDP 2.6.1 on CentOS 6.9

We see the following error:

Traceback (most recent call last):
 File "/var/lib/ambari-agent/cache/common-services/DRUID/0.9.2/package/scripts/superset.py", line 169, in <module>
   Superset().execute()
 File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 329, in execute
   method(env)
 File "/var/lib/ambari-agent/cache/common-services/DRUID/0.9.2/package/scripts/superset.py", line 108, in start
   self.configure(env, upgrade_type=upgrade_type)
 File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 119, in locking_configure
   original_configure(obj, *args, **kw)
 File "/var/lib/ambari-agent/cache/common-services/DRUID/0.9.2/package/scripts/superset.py", line 88, in configure
   user=params.druid_user)
 File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 155, in __init__
   self.env.run()
 File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 160, in run
   self.run_action(resource, action)
 File "/usr/lib/python2.6/site-packages/resource_management/core/environment.py", line 124, in run_action
   provider_action()
 File "/usr/lib/python2.6/site-packages/resource_management/core/providers/system.py", line 262, in action_run
   tries=self.resource.tries, try_sleep=self.resource.try_sleep)
 File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 72, in inner
   result = function(command, **kwargs)
 File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 102, in checked_call
   tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy)
 File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 150, in _call_wrapper
   result = _call(command, **kwargs_copy)
 File "/usr/lib/python2.6/site-packages/resource_management/core/shell.py", line 303, in _call
   raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of 'source /etc/superset/conf/superset-env.sh ; /usr/hdp/current/druid-superset/bin/superset init' returned 1. /usr/hdp/2.6.1.0-129/superset/lib/python3.4/importlib/_bootstrap.py:1161: ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
 spec.loader.load_module(spec.name)
/usr/hdp/2.6.1.0-129/superset/lib/python3.4/importlib/_bootstrap.py:1161: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
 spec.loader.load_module(spec.name)
/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.
 warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
/usr/hdp/2.6.1.0-129/superset/lib/python3.4/importlib/_bootstrap.py:1161: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
 spec.loader.load_module(spec.name)
2017-08-28 10:19:14,181:INFO:flask_appbuilder.base:Registering class MyIndexView on menu 
2017-08-28 10:19:14,189:INFO:flask_appbuilder.base:Registering class UtilView on menu 
2017-08-28 10:19:14,191:INFO:flask_appbuilder.base:Registering class LocaleView on menu 
2017-08-28 10:19:14,194:INFO:flask_appbuilder.base:Registering class ResetPasswordView on menu 
2017-08-28 10:19:14,207:INFO:flask_appbuilder.base:Registering class ResetMyPasswordView on menu 
2017-08-28 10:19:14,218:INFO:flask_appbuilder.base:Registering class UserInfoEditView on menu 
2017-08-28 10:19:14,228:INFO:flask_appbuilder.base:Registering class AuthDBView on menu 
2017-08-28 10:19:14,233:INFO:flask_appbuilder.base:Registering class UserDBModelView on menu List Users
2017-08-28 10:19:14,263:INFO:flask_appbuilder.base:Registering class RoleModelView on menu List Roles
2017-08-28 10:19:14,290:INFO:flask_appbuilder.base:Registering class UserStatsChartView on menu User's Statistics
2017-08-28 10:19:14,307:INFO:flask_appbuilder.base:Registering class PermissionModelView on menu Base Permissions
2017-08-28 10:19:14,326:INFO:flask_appbuilder.base:Registering class ViewMenuModelView on menu Views/Menus
2017-08-28 10:19:14,345:INFO:flask_appbuilder.base:Registering class PermissionViewModelView on menu Permission on Views/Menus
2017-08-28 10:19:14,773:INFO:flask_appbuilder.base:Registering class TableColumnInlineView on menu 
2017-08-28 10:19:14,811:INFO:flask_appbuilder.base:Registering class DruidColumnInlineView on menu 
2017-08-28 10:19:14,832:INFO:flask_appbuilder.base:Registering class SqlMetricInlineView on menu 
2017-08-28 10:19:14,852:INFO:flask_appbuilder.base:Registering class DruidMetricInlineView on menu 
2017-08-28 10:19:14,879:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-08-28 10:19:14,881:INFO:flask_appbuilder.base:Registering class DatabaseView on menu Databases
2017-08-28 10:19:14,949:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-08-28 10:19:14,951:INFO:flask_appbuilder.base:Registering class DatabaseAsync on menu 
2017-08-28 10:19:14,968:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2017-08-28 10:19:14,970:INFO:flask_appbuilder.base:Registering class DatabaseTablesAsync on menu 
2017-08-28 10:19:14,988:INFO:flask_appbuilder.base:Registering class TableModelView on menu Tables
2017-08-28 10:19:15,014:INFO:flask_appbuilder.base:Registering class AccessRequestsModelView on menu Access requests
2017-08-28 10:19:15,039:INFO:flask_appbuilder.base:Registering class DruidClusterModelView on menu Druid Clusters
2017-08-28 10:19:15,065:INFO:flask_appbuilder.base:Registering class SliceModelView on menu Slices
2017-08-28 10:19:15,087:INFO:flask_appbuilder.base:Registering class SliceAsync on menu 
2017-08-28 10:19:15,104:INFO:flask_appbuilder.base:Registering class SliceAddView on menu 
2017-08-28 10:19:15,122:INFO:flask_appbuilder.base:Registering class DashboardModelView on menu Dashboards
2017-08-28 10:19:15,145:INFO:flask_appbuilder.base:Registering class DashboardModelViewAsync on menu 
2017-08-28 10:19:15,164:INFO:flask_appbuilder.base:Registering class LogModelView on menu Action Log
2017-08-28 10:19:15,189:INFO:flask_appbuilder.base:Registering class QueryView on menu Queries
2017-08-28 10:19:15,214:INFO:flask_appbuilder.base:Registering class DruidDatasourceModelView on menu Druid Datasources
2017-08-28 10:19:15,239:INFO:flask_appbuilder.base:Registering class R on menu 
2017-08-28 10:19:15,242:INFO:flask_appbuilder.base:Registering class Superset on menu 
2017-08-28 10:19:15,297:INFO:flask_appbuilder.base:Registering class CssTemplateModelView on menu CSS Templates
2017-08-28 10:19:15,321:INFO:flask_appbuilder.base:Registering class CssTemplateAsyncModelView on menu 
2017-08-28 10:19:15,378:INFO:root:Syncing role definition
2017-08-28 10:19:15,384:INFO:root:Creating database reference
Loaded your LOCAL configuration
Traceback (most recent call last):
 File "/usr/hdp/current/druid-superset/bin/superset", line 85, in <module>
   manager.run()
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/flask_script/__init__.py", line 412, in run
   result = self.handle(sys.argv[0], sys.argv[1:])
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/flask_script/__init__.py", line 383, in handle
   res = handle(*args, **config)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/flask_script/commands.py", line 216, in __call__
   return self.run(*args, **kwargs)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/superset/cli.py", line 27, in init
   security.sync_role_definitions()
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/superset/security.py", line 122, in sync_role_definitions
   get_or_create_main_db()
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/superset/security.py", line 96, in get_or_create_main_db
   .filter_by(database_name='main')
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2690, in first
   ret = list(self[0:1])
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2482, in __getitem__
   return list(res)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 90, in instances
   util.raise_from_cause(err)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
   reraise(type(exception), exception, tb=exc_tb, cause=cause)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
   raise value
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 75, in instances
   rows = [proc(row) for row in fetch]
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 75, in <listcomp>
   rows = [proc(row) for row in fetch]
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 437, in _instance
   loaded_instance, populate_existing, populators)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 498, in _populate_full
   dict_[key] = getter(row)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy/sql/type_api.py", line 1122, in process
   return process_value(impl_processor(value), dialect)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 261, in process_result_value
   decrypted_value = self.engine.decrypt(value)
 File "/usr/hdp/2.6.1.0-129/superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 89, in decrypt
   decrypted = decrypted.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 2: invalid start byte 
14 REPLIES 14

Super Mentor

@Hellmar Becker

What is your Python version? Is it Python3? Ambari Support Matrices

# python --version
Python 2.6.6

.

Yes it is Python 2.6.6. However, Ambari relies on Python 2.x, doesn't it?

Super Mentor

@Hellmar Becker

I am not very familiar with "superset" service/APIs however i see "python3.4" ( is that expected)?

/usr/hdp/2.6.1.0-129/superset/lib/python3.4/

.

Are you using the correct /compatible version of "superset" ?

That's what I am wondering too. Is Superset bringing its own Python?

Super Mentor

@Hellmar Becker

Yes, looks like the "superset" version that we installed is not correct or not compatible to the HDP 2.6.

Can you please let us know how you installed it?

We did a standard install of HDP 2.6.1 and HDF 3.0 using Ambari 2.5.1, according to the docs. However, the base OS is CentOS 6.9. All our database references are to a PostgreSQL 9.6 database, which was installed separately.

correction: OS is RHEL 6.9

Expert Contributor
@Jay Kumar SenSharma

I encounter the same problem.

I tried to run:

```

/usr/hdp/2.6.1.0-129/superset/bin/python3.4 /usr/hdp/current/druid-superset/bin/superset init

```

It still shows:

/usr/hdp/current/druid-superset/lib/python3.4/importlib/_bootstrap.py:1161: ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
  spec.loader.load_module(spec.name)
/usr/hdp/current/druid-superset/lib/python3.4/importlib/_bootstrap.py:1161: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
  spec.loader.load_module(spec.name)
Loaded your LOCAL configuration
/usr/hdp/current/druid-superset/lib/python3.4/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.
  warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
/usr/hdp/current/druid-superset/lib/python3.4/importlib/_bootstrap.py:1161: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
  spec.loader.load_module(spec.name)
2018-04-03 17:56:04,163:INFO:flask_appbuilder.base:Registering class MyIndexView on menu 
2018-04-03 17:56:04,169:INFO:flask_appbuilder.base:Registering class UtilView on menu 
2018-04-03 17:56:04,173:INFO:flask_appbuilder.base:Registering class LocaleView on menu 
2018-04-03 17:56:04,178:INFO:flask_appbuilder.base:Registering class ResetPasswordView on menu 
2018-04-03 17:56:04,203:INFO:flask_appbuilder.base:Registering class ResetMyPasswordView on menu 
2018-04-03 17:56:04,226:INFO:flask_appbuilder.base:Registering class UserInfoEditView on menu 
2018-04-03 17:56:04,250:INFO:flask_appbuilder.base:Registering class AuthDBView on menu 
2018-04-03 17:56:04,260:INFO:flask_appbuilder.base:Registering class UserDBModelView on menu List Users
2018-04-03 17:56:04,342:INFO:flask_appbuilder.base:Registering class RoleModelView on menu List Roles
2018-04-03 17:56:04,424:INFO:flask_appbuilder.base:Registering class UserStatsChartView on menu User's Statistics
2018-04-03 17:56:04,485:INFO:flask_appbuilder.base:Registering class PermissionModelView on menu Base Permissions
2018-04-03 17:56:04,554:INFO:flask_appbuilder.base:Registering class ViewMenuModelView on menu Views/Menus
2018-04-03 17:56:04,624:INFO:flask_appbuilder.base:Registering class PermissionViewModelView on menu Permission on Views/Menus
2018-04-03 17:56:05,666:INFO:flask_appbuilder.base:Registering class TableColumnInlineView on menu 
2018-04-03 17:56:05,708:INFO:flask_appbuilder.base:Registering class DruidColumnInlineView on menu 
2018-04-03 17:56:05,748:INFO:flask_appbuilder.base:Registering class SqlMetricInlineView on menu 
2018-04-03 17:56:05,785:INFO:flask_appbuilder.base:Registering class DruidMetricInlineView on menu 
2018-04-03 17:56:05,842:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2018-04-03 17:56:05,845:INFO:flask_appbuilder.base:Registering class DatabaseView on menu Databases
2018-04-03 17:56:05,896:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2018-04-03 17:56:05,900:INFO:flask_appbuilder.base:Registering class DatabaseAsync on menu 
2018-04-03 17:56:05,935:WARNING:flask_appbuilder.models.filters:Filter type not supported for column: password
2018-04-03 17:56:05,938:INFO:flask_appbuilder.base:Registering class DatabaseTablesAsync on menu 
2018-04-03 17:56:06,041:INFO:flask_appbuilder.base:Registering class TableModelView on menu Tables
2018-04-03 17:56:06,094:INFO:flask_appbuilder.base:Registering class AccessRequestsModelView on menu Access requests
2018-04-03 17:56:06,147:INFO:flask_appbuilder.base:Registering class DruidClusterModelView on menu Druid Clusters
2018-04-03 17:56:06,201:INFO:flask_appbuilder.base:Registering class SliceModelView on menu Slices
2018-04-03 17:56:06,246:INFO:flask_appbuilder.base:Registering class SliceAsync on menu 
2018-04-03 17:56:06,283:INFO:flask_appbuilder.base:Registering class SliceAddView on menu 
2018-04-03 17:56:06,321:INFO:flask_appbuilder.base:Registering class DashboardModelView on menu Dashboards
2018-04-03 17:56:06,368:INFO:flask_appbuilder.base:Registering class DashboardModelViewAsync on menu 
2018-04-03 17:56:06,406:INFO:flask_appbuilder.base:Registering class LogModelView on menu Action Log
2018-04-03 17:56:06,460:INFO:flask_appbuilder.base:Registering class QueryView on menu Queries
2018-04-03 17:56:06,511:INFO:flask_appbuilder.base:Registering class DruidDatasourceModelView on menu Druid Datasources
2018-04-03 17:56:06,562:INFO:flask_appbuilder.base:Registering class R on menu 
2018-04-03 17:56:06,568:INFO:flask_appbuilder.base:Registering class Superset on menu 
2018-04-03 17:56:06,667:INFO:flask_appbuilder.base:Registering class CssTemplateModelView on menu CSS Templates
2018-04-03 17:56:06,719:INFO:flask_appbuilder.base:Registering class CssTemplateAsyncModelView on menu 
2018-04-03 17:56:06,837:INFO:root:Syncing role definition
2018-04-03 17:56:06,848:INFO:root:Creating database reference
2018-04-03 17:56:06,854:INFO:root:mysql+pymysql://superset:superset@192.168.112.48:3306/superset
Traceback (most recent call last):
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1127, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 693, in _init_compiled
    for key in compiled_params
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 693, in <genexpr>
    for key in compiled_params
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/sql/type_api.py", line 1156, in process
    return impl_processor(process_param(value, dialect))
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 237, in process_bind_param
    self._update_key()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 232, in _update_key
    self.engine._update_key(key)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 35, in _update_key
    digest.update(key)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/cryptography/hazmat/primitives/hashes.py", line 92, in update
    raise TypeError("data must be bytes.")
TypeError: data must be bytes.


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


Traceback (most recent call last):
  File "/usr/hdp/current/druid-superset/bin/superset", line 85, in <module>
    manager.run()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/flask_script/__init__.py", line 412, in run
    result = self.handle(sys.argv[0], sys.argv[1:])
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/superset/cli.py", line 27, in init
    security.sync_role_definitions()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/superset/security.py", line 122, in sync_role_definitions
    get_or_create_main_db()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/superset/security.py", line 106, in get_or_create_main_db
    db.session.commit()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/scoping.py", line 153, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 943, in commit
    self.transaction.commit()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 467, in commit
    self._prepare_impl()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 447, in _prepare_impl
    self.session.flush()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2254, in flush
    self._flush(objects)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2380, in _flush
    transaction.rollback(_capture_exception=True)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/session.py", line 2344, in _flush
    flush_context.execute()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 391, in execute
    rec.execute(self)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/unitofwork.py", line 556, in execute
    uow
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py", line 181, in save_obj
    mapper, table, insert)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/orm/persistence.py", line 866, in _emit_insert_statements
    execute(statement, params)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 948, in execute
    return meth(self, multiparams, params)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/sql/elements.py", line 269, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1060, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1132, in _execute_context
    None, None)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1413, in _handle_dbapi_exception
    exc_info
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
    raise value.with_traceback(tb)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/base.py", line 1127, in _execute_context
    context = constructor(dialect, self, conn, *args)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 693, in _init_compiled
    for key in compiled_params
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/engine/default.py", line 693, in <genexpr>
    for key in compiled_params
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy/sql/type_api.py", line 1156, in process
    return impl_processor(process_param(value, dialect))
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 237, in process_bind_param
    self._update_key()
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 232, in _update_key
    self.engine._update_key(key)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 35, in _update_key
    digest.update(key)
  File "/usr/hdp/current/druid-superset/lib/python3.4/site-packages/cryptography/hazmat/primitives/hashes.py", line 92, in update
    raise TypeError("data must be bytes.")
sqlalchemy.exc.StatementError: (builtins.TypeError) data must be bytes. [SQL: 'INSERT INTO dbs (created_on, changed_on, database_name, sqlalchemy_uri, password, cache_timeout, select_as_create_table_as, expose_in_sqllab, allow_run_sync, allow_run_async, allow_ctas, allow_dml, force_ctas_schema, extra, perm, changed_by_fk, created_by_fk) VALUES (%(created_on)s, %(changed_on)s, %(database_name)s, %(sqlalchemy_uri)s, %(password)s, %(cache_timeout)s, %(select_as_create_table_as)s, %(expose_in_sqllab)s, %(allow_run_sync)s, %(allow_run_async)s, %(allow_ctas)s, %(allow_dml)s, %(force_ctas_schema)s, %(extra)s, %(perm)s, %(changed_by_fk)s, %(created_by_fk)s)'] [parameters: [{'sqlalchemy_uri': 'mysql+pymysql://superset:XXXXXXXXXX@192.168.112.48:3306/superset', 'cache_timeout': None, 'password': 'superset', 'force_ctas_schema': None, 'allow_run_sync': True, 'expose_in_sqllab': True, 'database_name': 'main', 'perm': '[main].(id:None)'}]]

So I think there some bug when pyhton3 working with pymysql asn sqlalchemy

Expert Contributor
@Dan Chaffelson

Please help !!!

Super Guru

Is the database initialized and working?

Anything else in /var/log/superset

https://superset.incubator.apache.org/installation.html

Expert Contributor
@Timothy Spann

I know how to initialized supeset,and i follow the document for superset,

I use mysql to storage superset data.

As I post above,it shows error.

Super Guru

https://github.com/apache/incubator-superset/issues/2174

This step was run https://docs.hortonworks.com/HDPDocuments/HDF3/HDF-3.1.1/bk_installing-hdf-and-hdp-ppc/content/confi... ?


You do no need to run superset init anymore. Just setup the database as in the document and Ambari will do the rest. Worked for me in HDP 2.6.4 on Centos 7. I have done this 6 or 7 times.

Expert Contributor

I think there is no help to the problem post above.

Expert Contributor

Did you resolve the problem? I have the same.