Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running query: 'ascii' codec can't encode characters in position #6772

Open
artemsafiyulin opened this issue Feb 20, 2024 · 3 comments

Comments

@artemsafiyulin
Copy link

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

  1. Setup redash version 10.1.0 (2589bef)
  2. Add postgresql datasource
  3. In postgresql create database with SQL_ASCII encoding and create table with row containing 'ç'
  4. 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 (2589bef)
  • Browser/OS: chrome/centos7
  • How did you install Redash: docker-compose

I tried apply this fix to our installation: #2165
But it doesn't help.

@annisun2020
Copy link

annisun2020 commented Mar 18, 2024

I add the following code in the /app/redash/task/queries.py file and it works fine

import sys
reload(sys)
sys.setdefaultencode("utf8")

image
@artemsafiyulin , Hope this helps you

@artemsafiyulin
Copy link
Author

@annisun2020 I can't find this path in redash project. Can you send link on file in repo which you chnge?

@annisun2020
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants