<p dir="auto">I was having UTF-8 encoding issues with my python 2.7 install so I upgraded to 3.6. Now I can't view any of my datatables or slices but, instead get this stacktrace:</p>
<p dir="auto">Was any guide published to help Superset users upgrade? I haven't been able to find any.</p>
<p dir="auto">Any help  would be appreciated.<br>
Traceback (most recent call last):<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app<br>
response = self.full_dispatch_request()<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request<br>
rv = self.handle_user_exception(e)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception<br>
reraise(exc_type, exc_value, tb)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/<em>compat.py", line 33, in reraise<br>
raise value<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request<br>
rv = self.dispatch_request()<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request<br>
return self.view_functions<a href="**req.view_args">rule.endpoint</a><br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/superset/utils.py", line 574, in wraps<br>
return f(self, *args, **kwargs)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/superset/views/core.py", line 1672, in dashboard<br>
if datasource and not self.datasource_access(datasource):<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/superset/views/base.py", line 94, in datasource_access<br>
self.schema_access(datasource, user=user) or<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/superset/views/base.py", line 87, in schema_access<br>
self.database_access(datasource.database, user=user) or<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 237, in <strong>get</strong><br>
return self.impl.get(instance_state(instance), dict</em>)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py", line 584, in get<br>
value = self.callable_(state, passive)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/strategies.py", line 557, in _load_for_state<br>
return self._emit_lazyload(session, state, ident_key, passive)<br>
File "", line 1, in <br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/strategies.py", line 603, in _emit_lazyload<br>
return loading.load_on_ident(q, ident_key)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 223, in load_on_ident<br>
return q.one()<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2814, in one<br>
ret = self.one_or_none()<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2784, in one_or_none<br>
ret = list(self)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 90, in instances<br>
util.raise_from_cause(err)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause<br>
reraise(type(exception), exception, tb=exc_tb, cause=cause)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise<br>
raise value<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 75, in instances<br>
rows = [proc(row) for row in fetch]<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 75, in <br>
rows = [proc(row) for row in fetch]<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 437, in _instance<br>
loaded_instance, populate_existing, populators)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/orm/loading.py", line 498, in <em>populate_full<br>
dict</em>[key] = getter(row)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy/sql/type_api.py", line 1122, in process<br>
return process_value(impl_processor(value), dialect)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy_utils/types/encrypted.py", line 261, in process_result_value<br>
decrypted_value = self.engine.decrypt(value)<br>
File "/home/ec2-user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/sqlalchemy_utils/types/encrypted.py", line 89, in decrypt<br>
decrypted = decrypted.decode('utf-8')<br>
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 4: invalid continuation byte</p>
<p dir="auto">Make sure these boxes are checked before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if any</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">0.15.4</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">change the metadata db from db2 to previous db1 can work</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">after changing to db1, exists the encoding error</p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>add <code class="notranslate">?charset=utf8</code> in <code class="notranslate">sqlalchemy_database_uri</code> , and <code class="notranslate">create database db1 character set utf8</code>,<br>
use db1 as the metadata db, works</li>
<li>add <code class="notranslate">?charset=utf8</code> in <code class="notranslate">sqlalchemy_database_uri</code> , and <code class="notranslate">create database db2 character set utf8</code>,<br>
use db2 as the metadata db, works</li>
<li>
<h5 dir="auto">change the <code class="notranslate">sqlalchemy_database_uri </code>from db2 to db1</h5>
</li>
<li>view a slice or use SQL Lab, occur the encoding bug</li>
</ol>
<h4 dir="auto">python3.5   superset 0.15.4  mysql 5.7</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="File &quot;/home/jiajie/project/superset/superset/superset/views.py&quot;, line 1588, in explore
    datasources = sorted(datasources, key=lambda ds: ds.full_name)
  File &quot;/home/jiajie/project/superset/superset/superset/views.py&quot;, line 1588, in &lt;lambda&gt;
    datasources = sorted(datasources, key=lambda ds: ds.full_name)
  File &quot;/home/jiajie/project/superset/superset/superset/models.py&quot;, line 1155, in full_name
    self.database, self.table_name, schema=self.schema)
......................
  File &quot;/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/strategies.py&quot;, line 557, in _load_for_state
    return self._emit_lazyload(session, state, ident_key, passive)
  File &quot;\&lt;string\&gt;&quot;, line 1, in \&lt;lambda\&gt;
    
  File &quot;/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/strategies.py&quot;, line 603, in _emit_lazyload
    return loading.load_on_ident(q, ident_key)
  File &quot;/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/loading.py&quot;, line 223, in load_on_ident
    return q.one()
  .......
  File &quot;/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py&quot;, line 186, in reraise
    raise value
  File &quot;/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/loading.py&quot;, line 75, in instances
    rows = [proc(row) for row in fetch]
  File &quot;/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/loading.py&quot;, line 75, in &lt;listcomp&gt;
    rows = [proc(row) for row in fetch]
 ....................
  File &quot;/usr/local/lib/python3.5/dist-packages/sqlalchemy_utils/types/encrypted.py&quot;, line 261, in process_result_value
    decrypted_value = self.engine.decrypt(value)
  File &quot;/usr/local/lib/python3.5/dist-packages/sqlalchemy_utils/types/encrypted.py&quot;, line 89, in decrypt
    decrypted = decrypted.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 4: invalid continuation byte"><pre class="notranslate"><code class="notranslate">File "/home/jiajie/project/superset/superset/superset/views.py", line 1588, in explore
    datasources = sorted(datasources, key=lambda ds: ds.full_name)
  File "/home/jiajie/project/superset/superset/superset/views.py", line 1588, in &lt;lambda&gt;
    datasources = sorted(datasources, key=lambda ds: ds.full_name)
  File "/home/jiajie/project/superset/superset/superset/models.py", line 1155, in full_name
    self.database, self.table_name, schema=self.schema)
......................
  File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/strategies.py", line 557, in _load_for_state
    return self._emit_lazyload(session, state, ident_key, passive)
  File "\&lt;string\&gt;", line 1, in \&lt;lambda\&gt;
    
  File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/strategies.py", line 603, in _emit_lazyload
    return loading.load_on_ident(q, ident_key)
  File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/loading.py", line 223, in load_on_ident
    return q.one()
  .......
  File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/util/compat.py", line 186, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/loading.py", line 75, in instances
    rows = [proc(row) for row in fetch]
  File "/usr/local/lib/python3.5/dist-packages/SQLAlchemy-1.1.5.dev0-py3.5-linux-x86_64.egg/sqlalchemy/orm/loading.py", line 75, in &lt;listcomp&gt;
    rows = [proc(row) for row in fetch]
 ....................
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy_utils/types/encrypted.py", line 261, in process_result_value
    decrypted_value = self.engine.decrypt(value)
  File "/usr/local/lib/python3.5/dist-packages/sqlalchemy_utils/types/encrypted.py", line 89, in decrypt
    decrypted = decrypted.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 4: invalid continuation byte
</code></pre></div>