UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 4 #16733
Replies: 16 comments
-
Could you please replicate using utf8mb4 as character set instead of utf8? |
Beta Was this translation helpful? Give feedback.
-
@xrmx ok, i'll try, tks. But still amazing |
Beta Was this translation helpful? Give feedback.
-
this is a workaround you can use - convert the utf field to ascii using mysql expression in the edit dimension. or include ?charset=utf8 in the SQLAlchemy URL |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@timfeirg does |
Beta Was this translation helpful? Give feedback.
-
@timfeirg sorry, typo :) i meant |
Beta Was this translation helpful? Give feedback.
-
I'm sorry, I just tried both If I switch back to python2.7, the example charts would work fine, with or without adding the extra this comment was a mistake, @xrmx |
Beta Was this translation helpful? Give feedback.
-
I'm hitting this too when upgrading a sqlite installation from caravel to superset, both python3.4. |
Beta Was this translation helpful? Give feedback.
-
@zhangjiajie023 @timfeirg Here this was caused by having in the config a SECRET_KEY different than the one used to encrypt the password. |
Beta Was this translation helpful? Give feedback.
-
I've been down for some time. I checked the security key and am using same one as with 2.7. My complete traceback below. Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
-
We don't recommend using sqlite in production. Also we don't build against python 3.6 (yet). Might be safer/easier to run py3.4 on against mysql |
Beta Was this translation helpful? Give feedback.
-
@mistercrunch it's not an unicode issue, it is trying to decode encrypted data with the wrong key. I've opened a PR raising an intelligible error upstream but i forgot to update it. |
Beta Was this translation helpful? Give feedback.
-
@jerryhall I don't think sqlite takes a charset option |
Beta Was this translation helpful? Give feedback.
-
@xrmx any solutions on this? If not, can you tell me how to run this in python 2.7. I believe I'm running into the same error.... Stack trace as follows: |
Beta Was this translation helpful? Give feedback.
-
@bmackattack if you are using the wrong key the only solution is to use the right one, you are the only one who knows it. My patch just makes the error explicit. |
Beta Was this translation helpful? Give feedback.
-
Here is how I was able to fix this: #8538 (comment) |
Beta Was this translation helpful? Give feedback.
-
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
0.15.4
Expected results
change the metadata db from db2 to previous db1 can work
Actual results
after changing to db1, exists the encoding error
Steps to reproduce
?charset=utf8
insqlalchemy_database_uri
, andcreate database db1 character set utf8
,use db1 as the metadata db, works
?charset=utf8
insqlalchemy_database_uri
, andcreate database db2 character set utf8
,use db2 as the metadata db, works
change the
sqlalchemy_database_uri
from db2 to db1python3.5 superset 0.15.4 mysql 5.7
Beta Was this translation helpful? Give feedback.
All reactions