These are chat archives for getredash/redash

20th
Feb 2018
hareeshav
@hareeshav
Feb 20 2018 07:04
@here @arikfr
We have setup redash open source and since drilldown charts are not there, we implemented our own UI to setup charts. But now we are facing a CORS Issue. The error log is listed below. Any help appreciated.
35.229.38.229--Redash server.
Our Ui app is being served from http://localhost:3000.
Steps tried out:
1).
We have set the env variable, export REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN="http://10.16.61.156:3000,http://localhost:3000"
restarted the server using sudo supervisorctl restart all.
2).edited settings.py
ACCESS_CONTROL_ALLOW_ORIGIN = "*"
compiled using python -m compileall settings.py
restarted the server
But still the same issue exists.
{code}
Failed to load http://35.229.38.229/api/queries/32: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 404.
{code}
ugugugug
@YujiArai
Feb 20 2018 08:33

Hi, guys.
Our redis was stucked and refused to connect, redash-server got to shutting down with this logs.

[2018-02-20 05:06:36 +0000] [31] [ERROR] Exception in worker process
ConnectionError: Error 111 connecting to redash-redis:6379. Connection refused.
[2018-02-20 05:06:36 +0000] [31] [INFO] Worker exiting (pid: 31)
[2018-02-20 05:06:36,078] ERROR in app: Exception on /login [GET]
[2018-02-20 05:06:36,082][PID:17][INFO][metrics] method=GET path=/login endpoint=redash_login status=500 content_type=? content_length=-1 duration=5697.15 query_count=0 query_duration=0.00
[2018-02-20 05:06:36 +0000] [17] [INFO] Worker exiting (pid: 17)
[2018-02-20 05:06:36 +0000] [14] [INFO] Worker exiting (pid: 14)
[2018-02-20 05:06:36 +0000] [20] [INFO] Worker exiting (pid: 20)
[2018-02-20 05:06:36 +0000] [1] [INFO] Shutting down: Master
[2018-02-20 05:06:36 +0000] [1] [INFO] Reason: Worker failed to boot.

This is correctly behavior?

hareeshav
@hareeshav
Feb 20 2018 10:28

@here @arikfr
I have also tried to setup CORS at nginx level by adding the below snippet in /etc/nginx/sites-available/redash file.
Still CORS issue exists for me, anyone can please help me on this.
{code}
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#

    # Om nom nom cookies
    #
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    #
    # Custom headers and headers various browsers *should* be OK with but aren't
    #
    add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
    #
    # Tell client that this pre-flight info is valid for 20 days
    #
    add_header 'Access-Control-Max-Age' 1728000;
    add_header 'Content-Type' 'text/plain charset=UTF-8';
    add_header 'Content-Length' 0;
    return 204;
 }
 if ($request_method = 'POST') {
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
 }
 if ($request_method = 'GET') {
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
    add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
 }

{code}

George Tseres
@GiorgosTseres_twitter
Feb 20 2018 13:47
I can see that query versioning has been implemented in the Mozilla fork (mozilla/redash@d5637d2). Is this going to be merged upstream? If so, when is the merge planned for?