Skip to content

fix: add all ueberdb2 optional peer dependencies as direct dependencies#7571

Closed
Copilot wants to merge 3 commits intodevelopfrom
copilot/fix-mysql2-dependency
Closed

fix: add all ueberdb2 optional peer dependencies as direct dependencies#7571
Copilot wants to merge 3 commits intodevelopfrom
copilot/fix-mysql2-dependency

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

ueberdb2@5.0.45 moved all database driver dependencies from bundled to optional peer dependencies. Since Etherpad never listed them explicitly, they were absent from the Docker image, causing fatal Cannot find module errors on startup when using any non-default database backend.

Changes

  • src/package.json — add all 10 optional peer dependencies of ueberdb2 as direct dependencies so every supported database backend works out of the box:
    • @elastic/elasticsearch ^9.3.4
    • cassandra-driver ^4.8.0
    • mongodb ^7.1.1
    • mssql ^12.2.1
    • mysql2 ^3.22.0
    • nano ^11.0.5 (CouchDB)
    • pg ^8.20.0 (PostgreSQL)
    • redis ^5.12.1
    • rethinkdb ^2.4.2
    • surrealdb ^2.0.3
  • pnpm-lock.yaml — updated to resolve all new dependencies
  • .github/workflows/docker.yml — add build-test-mysql job: spins up a MySQL 8 service container, builds the production image, and asserts the container reaches a healthy state with DB_TYPE=mysql — regression test for this class of missing-peer-dep failures

Copilot AI linked an issue Apr 20, 2026 that may be closed by this pull request
- Add mysql2 ^3.22.0 to src/package.json dependencies
- Update pnpm-lock.yaml with mysql2 3.22.1
- Add build-test-mysql CI job to docker.yml as regression test

ueberdb2@5.0.45 has mysql2 as an optional peer dependency, but it was
not installed in the Docker image. This caused "Cannot find module 'mysql2'"
errors when Etherpad was configured to use MySQL.

Agent-Logs-Url: https://github.com/ether/etherpad/sessions/5aeca427-fdbb-4502-be3f-45ee62e12da9

Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix mysql2 dependency issue in UeberDB2 fix: add mysql2 as direct dependency to resolve Docker MySQL startup failure Apr 20, 2026
Copilot AI requested a review from JohnMcLear April 20, 2026 15:20
@JohnMcLear
Copy link
Copy Markdown
Member

@copilot this fixes mysql but what about the other peerdeps?

Add all 10 optional peer dependencies of ueberdb2@5.0.45 as direct
dependencies in src/package.json so every supported database backend
works out of the box in Docker:
- @elastic/elasticsearch ^9.3.4
- cassandra-driver ^4.8.0
- mongodb ^7.1.1
- mssql ^12.2.1
- nano ^11.0.5
- pg ^8.20.0
- redis ^5.12.1
- rethinkdb ^2.4.2
- surrealdb ^2.0.3

Agent-Logs-Url: https://github.com/ether/etherpad/sessions/60d96e2b-d8ea-42a2-8d7b-2d4ae52b4cff

Co-authored-by: JohnMcLear <220864+JohnMcLear@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 20, 2026

@copilot this fixes mysql but what about the other peerdeps?

Added all 9 remaining optional peer dependencies of ueberdb2 as direct dependencies in commit 4eec829:

  • @elastic/elasticsearch ^9.3.4
  • cassandra-driver ^4.8.0
  • mongodb ^7.1.1
  • mssql ^12.2.1
  • nano ^11.0.5 (CouchDB)
  • pg ^8.20.0 (PostgreSQL)
  • redis ^5.12.1
  • rethinkdb ^2.4.2
  • surrealdb ^2.0.3

All 10 ueberdb2 peer deps are now direct dependencies so every supported database backend works in Docker without extra setup.

Copilot AI changed the title fix: add mysql2 as direct dependency to resolve Docker MySQL startup failure fix: add all ueberdb2 optional peer dependencies as direct dependencies Apr 20, 2026
@JohnMcLear
Copy link
Copy Markdown
Member

Superseded by clean replacement. Tracking:

Thanks @copilot — the direction was correct; the replacement strips unrelated scope (typescript/oidc-provider/eslint-config bumps, docker.yml restructure that overlaps with #7569) and expands regression coverage to presence-test all 10 drivers plus Postgres in addition to MySQL.

@JohnMcLear JohnMcLear closed this Apr 20, 2026
JohnMcLear added a commit that referenced this pull request Apr 20, 2026
* docs: design spec for issue #7570 (ueberdb2 driver bundling)

Spec for the upstream ueberDB fix (move 10 drivers back from optional
peer deps to dependencies) plus downstream etherpad-lite safety net
(explicit driver list + build-test-db-drivers CI job covering all 10
via presence check and MySQL+Postgres smoke tests).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: implementation plan for issue #7570 ueberdb2 driver bundling

Covers upstream ueberDB PR (move drivers from optional peer deps back
to dependencies, publish 5.0.46) and downstream etherpad-lite PR
(bump ueberdb2, defensive driver list, build-test-db-drivers CI job
with presence + MySQL + Postgres stages gating publish).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(#7570): bundle DB drivers, add regression CI

- Bump ueberdb2 to ^5.0.47 (upstream ueberDB PR #939 re-bundles drivers
  as real dependencies instead of optional peer deps, fixing the class
  of Docker-prod "Cannot find module" failures).
- Declare all 10 ueberdb2 DB drivers as direct src dependencies as a
  defensive safety net against a future upstream drift.
- Add build-test-db-drivers CI job that blocks the publish job:
    * all-10-drivers presence check in the built prod image
    * end-to-end MySQL smoke (reproduces the #7570 repro)
    * end-to-end Postgres smoke
  Any stage failure blocks Docker Hub / GHCR publish.

Supersedes #7571.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(ci): run driver presence test from src/ so node_modules resolves

The presence test ran node from the default cwd (/opt/etherpad-lite),
but the drivers are installed under /opt/etherpad-lite/src/node_modules
by the monorepo workspace. Adding `-w /opt/etherpad-lite/src` makes
Node resolve modules from src/node_modules where pnpm places them.

Matches how the production container itself runs: `pnpm run prod` is
invoked from src/ (cross-env + node --require tsx/cjs node/server.ts).

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UeberDB2 mysql2 dependency

2 participants