openclaw - 💡(How to fix) Fix TypeError: Reflect.ownKeys called on non-object in mattermost channel-plugin-api lazy proxy [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#62053Fetched 2026-04-08 03:09:40
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

Running openclaw cron list (and likely any command that triggers config loading) crashes with:

Failed to read config at ~/.openclaw/openclaw.json TypeError: Reflect.ownKeys called on non-object
    at Reflect.ownKeys (<anonymous>)
    at Object.ownKeys (file:///...dist/extensions/mattermost/channel-plugin-api.js:12:19)
    at mergeBootstrapPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:163:2)
    at getBootstrapChannelPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:207:48)
    at iterateBootstrapChannelPlugins (file:///...dist/bootstrap-registry-DOERdRmD.js:194:18)
    at iterateBootstrapChannelPlugins.next (<anonymous>)
    ...
    at Object.loadConfig (file:///...dist/io-DNfkdag8.js:17474:29)

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: TypeError: Reflect.ownKeys called on non-object

Error Message

Failed to read config at ~/.openclaw/openclaw.json TypeError: Reflect.ownKeys called on non-object at Reflect.ownKeys (<anonymous>) at Object.ownKeys (file:///...dist/extensions/mattermost/channel-plugin-api.js:12:19) at mergeBootstrapPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:163:2) at getBootstrapChannelPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:207:48) at iterateBootstrapChannelPlugins (file:///...dist/bootstrap-registry-DOERdRmD.js:194:18) at iterateBootstrapChannelPlugins.next (<anonymous>) ... at Object.loadConfig (file:///...dist/io-DNfkdag8.js:17474:29)

Config invalid File: ~/.openclaw/openclaw.json Problem:

  • <root>: read failed: TypeError: Reflect.ownKeys called on non-object

Root Cause

Introduced in commit 4133e3bb1d (fix(runtime): narrow bundled runtime startup surfaces).

extensions/mattermost/channel-plugin-api.ts was refactored to use a lazy Proxy that defers loading of channel-plugin-runtime.js via loadBundledEntryExportSync. The ownKeys trap calls Reflect.ownKeys(load()) without guarding against a non-object return value:

ownKeys() {
  return Reflect.ownKeys(load()); // crashes if load() returns null/undefined
},

When loadBundledEntryExportSync(...).mattermostPlugin returns null or undefined (e.g. when the bundled entry cannot be resolved in a global npm install on Linux), Reflect.ownKeys throws.

This affects all users regardless of whether mattermost is configured, because iterateBootstrapChannelPlugins walks all bundled channel plugins (including mattermost) during config validation on every command.

Code Example

Failed to read config at ~/.openclaw/openclaw.json TypeError: Reflect.ownKeys called on non-object
    at Reflect.ownKeys (<anonymous>)
    at Object.ownKeys (file:///...dist/extensions/mattermost/channel-plugin-api.js:12:19)
    at mergeBootstrapPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:163:2)
    at getBootstrapChannelPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:207:48)
    at iterateBootstrapChannelPlugins (file:///...dist/bootstrap-registry-DOERdRmD.js:194:18)
    at iterateBootstrapChannelPlugins.next (<anonymous>)
    ...
    at Object.loadConfig (file:///...dist/io-DNfkdag8.js:17474:29)

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: TypeError: Reflect.ownKeys called on non-object

---

ownKeys() {
  return Reflect.ownKeys(load()); // crashes if load() returns null/undefined
},

---

ownKeys() {
  const result = load();
  if (result == null || typeof result !== "object") return [];
  return Reflect.ownKeys(result);
},
RAW_BUFFERClick to expand / collapse

Description

Running openclaw cron list (and likely any command that triggers config loading) crashes with:

Failed to read config at ~/.openclaw/openclaw.json TypeError: Reflect.ownKeys called on non-object
    at Reflect.ownKeys (<anonymous>)
    at Object.ownKeys (file:///...dist/extensions/mattermost/channel-plugin-api.js:12:19)
    at mergeBootstrapPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:163:2)
    at getBootstrapChannelPlugin (file:///...dist/bootstrap-registry-DOERdRmD.js:207:48)
    at iterateBootstrapChannelPlugins (file:///...dist/bootstrap-registry-DOERdRmD.js:194:18)
    at iterateBootstrapChannelPlugins.next (<anonymous>)
    ...
    at Object.loadConfig (file:///...dist/io-DNfkdag8.js:17474:29)

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - <root>: read failed: TypeError: Reflect.ownKeys called on non-object

Steps to reproduce

  1. Install openclaw globally via npm on Linux (npm install -g openclaw)
  2. Have a valid ~/.openclaw/openclaw.json with no mattermost plugin configured
  3. Run openclaw cron list

Root cause

Introduced in commit 4133e3bb1d (fix(runtime): narrow bundled runtime startup surfaces).

extensions/mattermost/channel-plugin-api.ts was refactored to use a lazy Proxy that defers loading of channel-plugin-runtime.js via loadBundledEntryExportSync. The ownKeys trap calls Reflect.ownKeys(load()) without guarding against a non-object return value:

ownKeys() {
  return Reflect.ownKeys(load()); // crashes if load() returns null/undefined
},

When loadBundledEntryExportSync(...).mattermostPlugin returns null or undefined (e.g. when the bundled entry cannot be resolved in a global npm install on Linux), Reflect.ownKeys throws.

This affects all users regardless of whether mattermost is configured, because iterateBootstrapChannelPlugins walks all bundled channel plugins (including mattermost) during config validation on every command.

Environment

  • Version: 2026.4.6 (eb75028)
  • Platform: Ubuntu (Linux), global npm install
  • Mattermost: not configured in openclaw.json

Suggested fix

Guard against non-object returns in all four Proxy traps in extensions/mattermost/channel-plugin-api.ts:

ownKeys() {
  const result = load();
  if (result == null || typeof result !== "object") return [];
  return Reflect.ownKeys(result);
},

Same guard should be applied to get, has, and getOwnPropertyDescriptor traps.

extent analysis

TL;DR

Guarding against non-object returns in the Proxy traps of extensions/mattermost/channel-plugin-api.ts is likely to fix the crash issue.

Guidance

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING