redash
redash copied to clipboard
Error running query: 'ascii' codec can't encode characters in position
Issue Summary
I am getting an error on running queries.
Error running query: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128
Steps to Reproduce
- Setup redash version 10.1.0 (2589bef1)
- Add postgresql datasource
- In postgresql create database with SQL_ASCII encoding and create table with row containing 'ç'
- In redash create query wich will select this row from postgresql or without tabe just query: "select 'ç' "
If we change database encoding to utf8 and run query again - we don't get error.
Technical details:
- Redash Version: 10.1.0 (2589bef1)
- Browser/OS: chrome/centos7
- How did you install Redash: docker-compose
I tried apply this fix to our installation: https://github.com/getredash/redash/pull/2165 But it doesn't help.
I add the following code in the /app/redash/task/queries.py file and it works fine
import sys
reload(sys)
sys.setdefaultencode("utf8")
@artemsafiyulin , Hope this helps you
@annisun2020 I can't find this path in redash project. Can you send link on file in repo which you chnge?
@annisun2020 I can't find this path in redash project. Can you send link on file in repo which you chnge?
docker exec -it redash-adhoc_worker-1 /bin/bash
vim /app/redash/tasks/queries.py