openclaw - 💡(How to fix) Fix [Bug]: Docker: Matrix plugin fails to load with "Cannot find module '@vector -im/matrix-bot-sdk'" (Require stack: /app/dist/matrix-*.js) — persistent even after cleanup/rebuild [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#50039Fetched 2026-04-08 00:59:58
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×2closed ×1commented ×1cross-referenced ×1

The Matrix plugin fails to load in Docker (openclaw:local or built images) with the persistent error: [matrix] [default] channel exited: Cannot find module '@vector -im/matrix-bot-sdk' Require stack:/app/dist/matrix-ZSlmDGn7.js

Even after:

  • Deleting /app/extensions/matrix, /app/dist/matrix-*.js, and /home/node/.openclaw/extensions/matrix
  • Running openclaw plugins install @openclaw/matrix
  • Running npm install --omit=dev in both locations
  • Multiple --no-cache rebuilds using a custom Dockerfile with OPENCLAW_EXTENSIONS=matrix
  • Cleaning the config with openclaw doctor --fix and manual resets

The loader keeps hitting the incomplete bundled version shipped in the base image. The user-installed copy never fully takes precedence, and the runtime is missing @vector-im/matrix-bot-sdk (and sometimes other shared modules).

ai helped me write this report after a day of trying to get matrix plugin installed and working properly in openclaw. would be nice to use a real messenging protocol and element instead of the channels of telegram and signal.

Error Message

The Matrix plugin fails to load in Docker (openclaw:local or built images) with the persistent error: 5. Observe constant auto-restart loop with the above error.

Root Cause

The Matrix plugin fails to load in Docker (openclaw:local or built images) with the persistent error: [matrix] [default] channel exited: Cannot find module '@vector -im/matrix-bot-sdk' Require stack:/app/dist/matrix-ZSlmDGn7.js

Even after:

  • Deleting /app/extensions/matrix, /app/dist/matrix-*.js, and /home/node/.openclaw/extensions/matrix
  • Running openclaw plugins install @openclaw/matrix
  • Running npm install --omit=dev in both locations
  • Multiple --no-cache rebuilds using a custom Dockerfile with OPENCLAW_EXTENSIONS=matrix
  • Cleaning the config with openclaw doctor --fix and manual resets

The loader keeps hitting the incomplete bundled version shipped in the base image. The user-installed copy never fully takes precedence, and the runtime is missing @vector-im/matrix-bot-sdk (and sometimes other shared modules).

ai helped me write this report after a day of trying to get matrix plugin installed and working properly in openclaw. would be nice to use a real messenging protocol and element instead of the channels of telegram and signal.

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

Bug type

Regression / Docker packaging bug

Summary

The Matrix plugin fails to load in Docker (openclaw:local or built images) with the persistent error: [matrix] [default] channel exited: Cannot find module '@vector -im/matrix-bot-sdk' Require stack:/app/dist/matrix-ZSlmDGn7.js

Even after:

  • Deleting /app/extensions/matrix, /app/dist/matrix-*.js, and /home/node/.openclaw/extensions/matrix
  • Running openclaw plugins install @openclaw/matrix
  • Running npm install --omit=dev in both locations
  • Multiple --no-cache rebuilds using a custom Dockerfile with OPENCLAW_EXTENSIONS=matrix
  • Cleaning the config with openclaw doctor --fix and manual resets

The loader keeps hitting the incomplete bundled version shipped in the base image. The user-installed copy never fully takes precedence, and the runtime is missing @vector-im/matrix-bot-sdk (and sometimes other shared modules).

ai helped me write this report after a day of trying to get matrix plugin installed and working properly in openclaw. would be nice to use a real messenging protocol and element instead of the channels of telegram and signal.

Steps to reproduce

  1. Use the standard OpenClaw Docker setup (image openclaw:local or similar).
  2. Mount ~/.openclaw as volume.
  3. Enable Matrix in config (channels.matrix.enabled: true + valid homeserver/userId/accessToken).
  4. Start the gateway.
  5. Observe constant auto-restart loop with the above error.

Expected behavior

Matrix channel should load successfully after openclaw plugins install @openclaw/matrix + dependency install, or when using OPENCLAW_EXTENSIONS=matrix at build time.

Actual behavior

Persistent "Cannot find module '@vector-im/matrix-bot-sdk'" from the bundled /app/dist/matrix-*.js path, plus duplicate plugin warnings.

OpenClaw version

2026.3.13 / 2026.3.14

Operating system

Ubuntu 24.02

Install method

Running in Docker (custom compose with volume mount for ~/.openclaw)

Model

ollama/qwen3-coder

Provider / routing chain

openclaw -> ollama

Config file / key location

No response

Additional provider/model setup details

  • Multiple rm -rf of bundled and user copies
  • npm install @vector-im/matrix-bot-sdk --omit=dev in various locations
  • Custom Dockerfile with build-time install
  • Full config reset + doctor --fix
  • --no-cache rebuilds + --force-recreate

None resolved the issue.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

This appears to be a regression in how extensions (especially Matrix) are packaged in the Docker image. Related issues: #47717, #44350, #5292, #39666.

extent analysis

Fix Plan

To resolve the issue with the Matrix plugin failing to load in Docker, we need to ensure that the user-installed copy of the plugin takes precedence over the bundled version. We will achieve this by modifying the Dockerfile to install the required dependencies and plugins at build time.

Step 1: Modify the Dockerfile

Add the following lines to your custom Dockerfile:

# Install required dependencies
RUN npm install --omit=dev @vector-im/matrix-bot-sdk

# Install the Matrix plugin
RUN openclaw plugins install @openclaw/matrix

# Set the environment variable to enable the Matrix plugin
ENV OPENCLAW_EXTENSIONS=matrix

Step 2: Rebuild the Docker Image

Rebuild the Docker image using the modified Dockerfile with the --no-cache flag to ensure that the changes take effect:

docker build -t my-openclaw-image --no-cache.

Step 3: Run the Container

Run the container with the rebuilt image and mount the ~/.openclaw volume:

docker run -v ~/.openclaw:/app/extensions my-openclaw-image

Verification

To verify that the fix worked, check the logs for the Matrix plugin loading successfully and the absence of the "Cannot find module '@vector-im/matrix-bot-sdk'" error.

Extra Tips

  • Make sure to update the OPENCLAW_EXTENSIONS environment variable to include the Matrix plugin.
  • If you encounter issues with duplicate plugin warnings, try removing the bundled plugin files and restarting the container.
  • Consider pinning the versions of the dependencies and plugins to ensure consistency across builds.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Matrix channel should load successfully after openclaw plugins install @openclaw/matrix + dependency install, or when using OPENCLAW_EXTENSIONS=matrix at build time.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING