hedgedoc / hedgedoc

HedgeDoc - Ideas grow better together

Home Page:https://hedgedoc.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hedgedoc docker container dies with uncaughtException: Cannot read properties of undefined (reading 'userid')

moepman opened this issue · comments

Description

Sometimes the hedgedoc docker container dies.

Steps to reproduce

I have not been able to reproduce the bug myself, as this never happend when I used the hedgedoc instance.
I hope that the lines indicated in the backtrace are helpful enough.

Expected behaviour

The error not happening and therefore the docker container not dying.

Logs

Note: The first line repeats many times.

Jan 31 20:25:11 fluorine docker-compose[847815]: app_1       | 2024-01-31T19:25:11.599Z info:         deserializeUser: a76bb187-8078-4508-aa35-e7ca812e0546
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       | 2024-01-31T19:25:20.159Z error:         uncaughtException: Cannot read properties of undefined (reading 'userid')
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       | TypeError: Cannot read properties of undefined (reading 'userid')
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       |     at finishConnection (/hedgedoc/lib/realtime.js:389:25)
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       |     at startConnection (/hedgedoc/lib/realtime.js:510:12)
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       |     at Timeout._onTimeout (/hedgedoc/lib/realtime.js:361:7)
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       |     at listOnTimeout (node:internal/timers:573:17)
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       |     at process.processTimers (node:internal/timers:514:7)
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       | 2024-01-31T19:25:20.160Z error:         An uncaught exception has occured.
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       | 2024-01-31T19:25:20.160Z error:         Cannot read properties of undefined (reading 'userid')
Jan 31 20:25:20 fluorine docker-compose[847815]: app_1       | 2024-01-31T19:25:20.160Z error:         Process will exit now.

Config

version: "3"
services:
  database:
    image: postgres:13-alpine
    environment:
      - POSTGRES_USER={{ hedgedoc_dbuser }}
      - POSTGRES_PASSWORD={{ hedgedoc_dbpass }}
      - POSTGRES_DB={{ hedgedoc_dbname }}
    volumes:
      - ./database:/var/lib/postgresql/data
  app:
    image: quay.io/hedgedoc/hedgedoc:1.9.9
    environment:
      - CMD_DOMAIN={{ hedgedoc_domain }}
      - CMD_PROTOCOL_USESSL=true
      - CMD_ALLOW_ANONYMOUS=false
      - CMD_ALLOW_ANONYMOUS_EDITS=true
      - CMD_ALLOW_FREEURL=true
      - CMD_SESSION_SECRET={{ hedgedoc_secret }}
      - CMD_HSTS_ENABLE=true
      - CMD_HSTS_MAX_AGE=2592000
      - CMD_HSTS_INCLUDE_SUBDOMAINS=true
      - CMD_HSTS_PRELOAD=true
      - CMD_CSP_ENABLE=true
      - CMD_DB_URL=postgres://{{ hedgedoc_dbuser }}:{{ hedgedoc_dbpass }}@database/{{ hedgedoc_dbname }}
      - CMD_LDAP_URL={{ ldap_uri }}
      - CMD_LDAP_BINDDN={{ ldap_binddn }}
      - CMD_LDAP_BINDCREDENTIALS={{ ldap_bindpw }}
      - CMD_LDAP_SEARCHBASE={{ ldap_base }}
      - CMD_LDAP_SEARCHFILTER=(uid={{ '{{' }}username{{ '}}' }})
      - CMD_LDAP_SEARCHATTRIBUTES=cn,uid
      - CMD_LDAP_USERIDFIELD=uid
      - CMD_LDAP_USERNAMEFIELD=cn
      - CMD_LDAP_TLS_CA=/etc/ssl/certs/ca-certificates.crt
      - CMD_EMAIL=false
    volumes:
      - /etc/hosts:/etc/hosts:ro
      - /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro
      - ./uploads:/hedgedoc/public/uploads
    ports:
      - "127.0.0.1:3000:3000"
    depends_on:
      - database

Your Setup

The hedgedoc instance is running as a Dockerized Setup on Debian 12. See the config section for the docker-compose from my ansible Setup. The container is behind an nginx reverse proxy.

Additional context

No response