JetBrains / datalore-configs

MIT License
26 stars 16 forks source link

nginx reverse proxy & sql command issue after upgrading to 2022.3 #25

Closed junyuanz1 closed 1 year ago

junyuanz1 commented 1 year ago

Hi developers,

I have tried to update my docker-based datalore to 2022.3 however, I am running into all different kinds of wss connection issues.

and I also get ServletServer server unable to start, message=null while trying to run SQL block.

it would be great if I get some help to debug and resolve this issue.

Thanks,

Junyuan

MIOB commented 1 year ago

Hi, could you give a bit more logs? There should be a stack trace after the ServletServer server unable to start message. And what kind of wss errors do you have?

RealSocius commented 1 year ago

Getting Problems with Nginx reverse proxy and wss as well

Console:

Starting socket manager: url=wss://datalore.example.com/wsdp, clientId=Za1PzFlD3UWDe9C85v6Wel
datalore.tvm.js?v=287:4588 WebSocket connection to 'wss://datalore.example.com/wsdp?connection_id=HeI2qXS3QNGAX9jv5RAU1s&client_id=Za1PzFlD3UWDe9C85v6Wel' failed: 
A.Mz8 @ datalore.tvm.js?v=287:4588
A.ZON @ datalore.tvm.js?v=287:4587
A.LzO @ datalore.tvm.js?v=287:95299
(anonym) @ datalore.tvm.js?v=287:29
A.Pr5 @ datalore.tvm.js?v=287:1290
(anonym) @ datalore.tvm.js?v=287:29
A.CRV @ datalore.tvm.js?v=287:9669
A.ABE @ datalore.tvm.js?v=287:9668
A.S2U @ datalore.tvm.js?v=287:9665
(anonym) @ datalore.tvm.js?v=287:29
A.SxS @ datalore.tvm.js?v=287:35699
(anonym) @ datalore.tvm.js?v=287:29
A.VTg @ datalore.tvm.js?v=287:63271
A.NqR @ datalore.tvm.js?v=287:138
(anonym) @ datalore.tvm.js?v=287:29
CCV @ datalore.tvm.js?v=287:93055
A.MuL @ datalore.tvm.js?v=287:21323
(anonym) @ datalore.tvm.js?v=287:29
A.Y9R @ datalore.tvm.js?v=287:87781
(anonym) @ datalore.tvm.js?v=287:30
TeaVMThread.run @ datalore.tvm.js?v=287:123459
TeaVMThread.start @ datalore.tvm.js?v=287:123458
$rt_startThread @ datalore.tvm.js?v=287:123460
(anonym) @ datalore.tvm.js?v=287:30
(anonym) @ bundle.min.js?v=287:1
datalore.tvm.js?v=287:107928 Disposing connection due to error event url=wss://datalore.example.com/wsdp?connection_id=HeI2qXS3QNGAX9jv5RAU1s&client_id=Za1PzFlD3UWDe9C85v6Wel
datalore.tvm.js?v=287:107928 Socket connection closed with code 1006: wss://datalore.example.com/wsdp. Reason: 
datalore.tvm.js?v=287:107928 reconnect in 1858 ms
datalore.tvm.js?v=287:107928 Disposing connection due to close event url=wss://datalore.example.com/wsdp?connection_id=HeI2qXS3QNGAX9jv5RAU1s&client_id=Za1PzFlD3UWDe9C85v6Wel, code=1006, reason=

My Firefox Network Tab My Firefox Network Tab

My Nginx config, after litteraly trying for 4 hours

location / {
        client_max_body_size 100m;
        add_header 'Access-Control-Allow-Origin' '*' always;
        add_header 'Access-Control-Allow-Credentials' 'true' always;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

        proxy_set_header        Host $host;
        proxy_set_header        X-Real-IP $remote_addr;

        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass_request_headers on;
        proxy_http_version 1.1;

        proxy_read_timeout 120;
        proxy_send_timeout 120;
        proxy_connect_timeout 120;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_pass http://localhost:8080;
        proxy_pass_header Sec-WebSocket-Extensions;
        proxy_pass_header Sec-WebSocket-Key;
        proxy_pass_header Sec-WebSocket-Version;
    }
RealSocius commented 1 year ago

Downgrading to 2022.2.3 is a solution but the wss for collaboration does throw error 403 on this version.

igRo commented 1 year ago

Hello @junyuan-z and @RealSocius,

Sorry for the confusion, it is required to specify DATALORE_PUBLIC_URL in the environment section (see example).

We will update the documentation to reflect that.

Thank you!

theartofdevel commented 1 month ago

2024.3 version, setup DATALORE_PUBLIC_URL env and no reaction, same error