cleanslate: WebSocket connection failed

I am trying to self host CleanSlate, and the app crashes post login.

This is what I see on the browser console:

WebSocket connection to 'wss://<redacted-domain.com>/v1/graphql' failed: There was a bad response from the server.

And these are the server logs:

{
   "detail.http_info.content_encoding":null,
   "detail.http_info.http_version":"HTTP/1.0",
   "detail.http_info.ip":"<REDACTED>",
   "detail.http_info.method":"GET",
   "detail.http_info.status":200,
   "detail.http_info.url":"/v1/graphql",
   "detail.operation.error.code":"invalid-headers",
   "detail.operation.error.error":"Missing &apos;Authorization&apos; or &apos;Cookie&apos; header in JWT authentication mode",
   "detail.operation.error.path":"&#x24;",
   "detail.operation.raw_query":"",
   "detail.operation.request_id":"2338fbce-263d-40c7-9ffa-027609bff628",
   "detail.operation.request_mode":"error",
   "detail.operation.response_size":117,
   "detail.operation.uncompressed_response_size":117,
   "detail.request_id":"2338fbce-263d-40c7-9ffa-027609bff628",
   "level":"error",
   "span_id":"31006d54753b4345",
   "timestamp":"2024-01-09T22:26:24.548+0000",
   "trace_id":"f54beb7d98d7e34cf8aabdee1f5df1fa",
   "type":"http-log"
}

And my localStorage does have the ‘token’ set appropriately. I am not sure what’s wrong here. Can you help? Let me know if you need further information.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Sure - just made my final update to the config for the night and I’m officially done lol - feel free to use it whenever. And let me know if you have any feature suggestions (in a different issue). Thanks!

Sure, thanks for letting me know!

Ok, added! This was a good exercise for nginx users:

And just a brief aside, this header:

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;";

I’ve updated it to remove the preload directive by default, so it is now just this:

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";

You may or not want to preload your domain, just thought I would add that disclaimer.

Awesome, I’ll make a note for that in the readme.md 😃

Okay, I seem to have figured it out. It was an issue with my nginx config. I forgot that I had to explicitly set the Upgrade and Connection headers (for the WS tunnel to work) as follows:

location /v1 {
  # API (Hasura)
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection 'Upgrade';
  proxy_set_header Host $host;
  proxy_pass http://localhost:8080;
}

Thanks for your help! Now, onto playing with a clean slate 😃