Support Questions

Find answers, ask questions, and share your expertise

HDP-2.6.4.0 - Superset startup failes with error binascii.Error: Incorrect padding

avatar
Rising Star

Using HDP-2.6.4.0. Enabled apache superset service. The service is not starting. Startup failes with error following error.

Traceback (most recent call last):
  File "/usr/hdp/current/superset/bin/superset", line 85, in <module>
    manager.run()
  File "/usr/hdp/2.6.4.0-91/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.4.0-91/superset/lib/python3.4/site-packages/flask_script/__init__.py", line 383, in handle
    res = handle(*args, **config)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/flask_script/commands.py", line 216, in __call__
    return self.run(*args, **kwargs)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/superset/cli.py", line 27, in init
    security.sync_role_definitions()
  File "/usr/hdp/2.6.4.0-91/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.4.0-91/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.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2690, in first
    ret = list(self[0:1])
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/orm/query.py", line 2482, in __getitem__
    return list(res)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 90, in instances
    util.raise_from_cause(err)
  File "/usr/hdp/2.6.4.0-91/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.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/usr/hdp/2.6.4.0-91/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.4.0-91/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.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 437, in _instance
    loaded_instance, populate_existing, populators)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy/orm/loading.py", line 498, in _populate_full
    dict_[key] = getter(row)
  File "/usr/hdp/2.6.4.0-91/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.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 266, in process_result_value
    decrypted_value = self.engine.decrypt(value)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/site-packages/sqlalchemy_utils/types/encrypted.py", line 90, in decrypt
    decrypted = base64.b64decode(value)
  File "/usr/hdp/2.6.4.0-91/superset/lib/python3.4/base64.py", line 90, in b64decode
    return binascii.a2b_base64(s)
binascii.Error: Incorrect padding

Looks like a malformed string is getting passed to base64.b64decode. Any pointers on how to workaround the issue. I am using postgresql database for superset meta data.

1 ACCEPTED SOLUTION

avatar

@Vinuraj M

Below is the workaround for the issue:

1. In /usr/hdp/current/superset/lib/python3.4/site-packages/superset/models.py, replace: 
password = Column(EncryptedType(String(1024), config.get('SECRET_KEY'))) with password = Column(String(1024))
2. Then drop and re-create the database.

View solution in original post

2 REPLIES 2

avatar

@Vinuraj M

Below is the workaround for the issue:

1. In /usr/hdp/current/superset/lib/python3.4/site-packages/superset/models.py, replace: 
password = Column(EncryptedType(String(1024), config.get('SECRET_KEY'))) with password = Column(String(1024))
2. Then drop and re-create the database.

avatar
Rising Star

Modified as suggested. Service is starting now. thanks