sagemathinc / cocalc-docker

DEPRECATED (was -- Docker setup for running CoCalc as downloadable software on your own computer)
https://cocalc.com
Other
398 stars 103 forks source link

websocket closed every minute #194

Open webysther opened 1 year ago

webysther commented 1 year ago

Hi, I started using this project in my NAS with docker compose and nginx proxy manager (fancy nginx) and I'm getting websocket drops, I have nearly 60 containers in my homelab and no issues, my configuration:

The ws primus close:

image

version: '3.9'

services:
  cocalc:
    image: sagemathinc/cocalc-v2
    container_name: app-calc
    env_file: ../cocalc/.env
    networks:
      cocalc:
    expose:
      - 80
    volumes:
      - /etc/TZ:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - "$STORAGE/projects:/projects"
    restart: unless-stopped

networks:
  cocalc:
    name: cocalc
STORAGE=/volume1/docker/cocalc
NOSSL=true

My nginx is boring, websockets enabled and with cocalc resolving in the same bridge internally (look above the expose and not ports):

image

I'm using my public domain but the project is used as a personal tool, mainly to play around with jupyter.

image

image

image

image

I got a error about context in websocket and fixed using:

add_header 'Service-Worker-Allowed' '/';

But still getting the same error.

image

PS¹: No firewall rules from my pc to nas, cable connection, all wi-fi traffic is using another VLAN. PS²: I read all from Debugging connectivity issues

Any suggestions to look?

webysther commented 1 year ago

Seems to hub is always connected and working but the ws is reconnect, not a big issue but the annoyng "starting" splash, as a workaround, there a way to disable this splash?

image

Here is using the cocalc on chrome latest without any extension enabled:

image

webysther commented 1 year ago

screen-capture.webm

williamstein commented 1 year ago

Do you have a reasonably minimal sequence of steps that I can use to reproduce the problem?

webysther commented 1 year ago

Hi @williamstein, turns out I think I discovered the root problem.

I'm using the Synology DSM 7.2, very new but old kernel (4.4.302+), the docker engine have some problem with the cocalc and I got this error, why I have so much sure?

Worked just fine, I got less latency but I think the major problem is the kernel.

Note:

I don't know if make sense to provide Synology constrains support by cocalc, so for now I will move to jupyterlab container but I really like to see this project grow, I will keep the server installed on my NAS with watchtower to automatic update, if you want my help to check the new versions, but let me know.

webysther commented 1 year ago

This is my connection from this setup:

image