etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

UeberDB2 mysql2 dependency

Open lucaguindani opened this issue 7 months ago • 7 comments

As stated here, I tried to rebuild the docker image from the 2.6.1 tag AND from the develop branch but I get the following error when I run the container:

etherpad-app    | [2026-04-20T11:36:51.354] [INFO] server - Starting Etherpad...
etherpad-app    | [2026-04-20T11:36:51.368] [ERROR] server - Error occurred while starting Etherpad
etherpad-app    | [2026-04-20T11:36:51.368] [ERROR] server - Metrics at time of fatal error:
etherpad-app    | {
etherpad-app    |   "httpStartTime": 0,
etherpad-app    |   "memoryUsage": 113803264,
etherpad-app    |   "memoryUsageHeap": 20201544
etherpad-app    | }
etherpad-app    | [2026-04-20T11:36:51.368] [ERROR] server - Error: Cannot find module 'mysql2'
etherpad-app    | Require stack:
etherpad-app    | - /opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/mysql_db-CRYtP-Mk.js
etherpad-app    | - /opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js
etherpad-app    | - /opt/etherpad-lite/src/node/db/DB.ts
etherpad-app    | - /opt/etherpad-lite/src/node/server.ts
etherpad-app    |     at node:internal/modules/cjs/loader:1476:15
etherpad-app    |     at nextResolveSimple (/opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-D46fvsV_.cjs:4:1004)
etherpad-app    |     at /opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-D46fvsV_.cjs:3:2630
etherpad-app    |     at /opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-D46fvsV_.cjs:3:1542
etherpad-app    |     at resolveTsPaths (/opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-D46fvsV_.cjs:4:760)
etherpad-app    |     at Module._resolveFilename (/opt/etherpad-lite/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-D46fvsV_.cjs:4:1102)
etherpad-app    |     at wrapResolveFilename (node:internal/modules/cjs/loader:1049:27)
etherpad-app    |     at defaultResolveImplForCJSLoading (node:internal/modules/cjs/loader:1073:10)
etherpad-app    |     at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1094:12)
etherpad-app    |     at Module._load (node:internal/modules/cjs/loader:1262:25)
etherpad-app    | [2026-04-20T11:36:51.368] [INFO] server - Exiting...
etherpad-app    | [2026-04-20T11:36:51.368] [INFO] server - Waiting for Node.js to exit...
etherpad-app    | [2026-04-20T11:36:51.484] [INFO] plugins - pnpm --version: 10.33.0
etherpad-app    | /opt/etherpad-lite/src:
etherpad-app    |  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  [email protected] prod: `cross-env NODE_ENV=production node --require tsx/cjs node/server.ts`
etherpad-app    | Exit status 1
etherpad-app    |  ELIFECYCLE  Command failed with exit code 1.
etherpad-app exited with code 1  

Locally built images were running fine 1 week ago.

Many thanks !

lucaguindani avatar Apr 20 '26 11:04 lucaguindani

Can you provide steps to replicate please? Exactly commands etc.

JohnMcLear avatar Apr 20 '26 12:04 JohnMcLear

Hey @JohnMcLear ! You can find below the steps to replicate.

  1. Clone the repository locally (develop branch).

  2. Update the docker-compose.yml to build the image locally and use mysql instead of psql.

services:
  app:
    user: "5001:0"
    build:
      context: ./
      dockerfile: ./Dockerfile
      target: production
    tty: true
    stdin_open: true
    volumes:
      - plugins:/opt/etherpad-lite/src/plugin_packages
      - etherpad-var:/opt/etherpad-lite/var
    depends_on:
      - mariadb
    environment:
      NODE_ENV: production
      ADMIN_PASSWORD: ${DOCKER_COMPOSE_APP_ADMIN_PASSWORD:-admin}
      DB_CHARSET: ${DOCKER_COMPOSE_APP_DB_CHARSET:-utf8mb4}
      DB_HOST: mariadb
      DB_NAME: etherpad
      DB_PASS: password
      DB_PORT: 3306
      DB_TYPE: mysql
      DB_USER: user
      # For now, the env var DEFAULT_PAD_TEXT cannot be unset or empty; it seems to be mandatory in the latest version of etherpad
      DEFAULT_PAD_TEXT: ${DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT:-Test }
      DISABLE_IP_LOGGING: ${DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING:-false}
      SOFFICE: ${DOCKER_COMPOSE_APP_SOFFICE:-null}
      TRUST_PROXY: ${DOCKER_COMPOSE_APP_TRUST_PROXY:-true}
    ports:
      - "${DOCKER_COMPOSE_APP_PORT_PUBLISHED:-9001}:${DOCKER_COMPOSE_APP_PORT_TARGET:-9001}"

  mariadb:
    image: mariadb:11.4
    volumes:
      - mysql-data:/var/lib/mysql
    environment:
       MYSQL_DATABASE: etherpad
       MYSQL_USER: user
       MYSQL_PASSWORD: password
       MYSQL_ROOT_PASSWORD: root
       MARIADB_AUTO_UPGRADE: 1

volumes:
  mysql-data:
  plugins:
  etherpad-var:
  1. From the project root : docker compose build.

  2. From the project root : docker compose up. You should get the error described above.

We are building a personalized image to automatically install libreoffice and plugins (https://docs.etherpad.org/docker.html#build-a-personalized-container).

lucaguindani avatar Apr 20 '26 13:04 lucaguindani

That's great thanks. I'll put a CI in for this before I go afk. Cc @SamTV12345 this is not yet confirmed but it's docker so probably real 🤣

JohnMcLear avatar Apr 20 '26 14:04 JohnMcLear

Yeah confirming this is real.

We need to:

  1. Introduce CI with regression test
  2. Reintroduce bundling

Hold off on releasing Etherpad until this is done. @SamTV12345

JohnMcLear avatar Apr 20 '26 15:04 JohnMcLear

@lucaguindani can you test this please? Fix is in develop.. About to be afk for 1.5 days so apologies if not sorted :|

JohnMcLear avatar Apr 20 '26 17:04 JohnMcLear

@JohnMcLear I can confirm the container is starting as expected in develop now 👍

I get some warnings because of a duplicated types key in tsconfig.json, but this as nothing to do with the mysql driver issue.

lucaguindani avatar Apr 21 '26 06:04 lucaguindani

Awesome buddy thanks for the bug report and testing :) Really appreciate it!

JohnMcLear avatar Apr 21 '26 07:04 JohnMcLear