openclaw - 💡(How to fix) Fix conversation_messages table missing parent_message_id column (gateway crashes on every message) [1 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#62020Fetched 2026-04-08 03:10:14
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Error Message

Error (OperationalError): (sqlite3.OperationalError) table conversation_messages has no column named parent_message_id

  • Fresh volume (no prior state) — same error
  • Disabling all plugins individually — same error
  • Removing manifest extension entirely — same error
  • Running openclaw doctor --fix — same error
  • Different OpenClaw versions (2026.4.2, 2026.4.5) — same error
  • Different streaming, replyToMode, tools.profile, tools.exec.ask configs — same error

Code Example

Error (OperationalError): (sqlite3.OperationalError) table conversation_messages has no column named parent_message_id
[SQL: INSERT INTO conversation_messages (id, channel_id, role, content, parent_message_id) VALUES (?, ?, ?, ?, ?) RETURNING timestamp]
RAW_BUFFERClick to expand / collapse

Bug Description

Every inbound Telegram message fails immediately with:

Error (OperationalError): (sqlite3.OperationalError) table conversation_messages has no column named parent_message_id
[SQL: INSERT INTO conversation_messages (id, channel_id, role, content, parent_message_id) VALUES (?, ?, ?, ?, ?) RETURNING timestamp]

The conversation_messages table is created at runtime (in-memory sql.js) but the schema omits the parent_message_id column that the INSERT expects.

Reproduction

  1. Run OpenClaw gateway with Telegram channel configured
  2. Send any message (DM or group)
  3. Bot immediately responds with the OperationalError

Environment

  • OpenClaw versions tested: 2026.4.2, 2026.4.5 (both affected)
  • Platform: Fly.io (Linux amd64) + macOS local gateway
  • Channel: Telegram (DM and group, with and without topics)
  • Plugins tested: Occurs with all plugins disabled, manifest removed, composio removed, lossless-claw disabled

What I've tried

  • Fresh volume (no prior state) — same error
  • Disabling all plugins individually — same error
  • Removing manifest extension entirely — same error
  • Running openclaw doctor --fix — same error
  • Different OpenClaw versions (2026.4.2, 2026.4.5) — same error
  • Different streaming, replyToMode, tools.profile, tools.exec.ask configs — same error

Expected behavior

Messages should be processed normally. The conversation_messages table should include parent_message_id in its CREATE TABLE schema.

Notes

The table name doesn't appear as a string literal in any file in the dist/ directory — it's likely generated by TypeORM from a class name via decorator metadata at runtime.

extent analysis

TL;DR

The most likely fix is to update the conversation_messages table schema to include the parent_message_id column.

Guidance

  • Verify that the conversation_messages table is being generated correctly by TypeORM, and that the parent_message_id column is defined in the corresponding entity class.
  • Check the entity class for the conversation_messages table to ensure that the parent_message_id property is properly decorated with TypeORM metadata.
  • Review the database migration scripts to ensure that the parent_message_id column is being added to the conversation_messages table.
  • If using a custom database schema, verify that the parent_message_id column is included in the schema definition.

Example

// Example entity class for conversation_messages table
import { Entity, Column, PrimaryColumn } from 'typeorm';

@Entity()
export class ConversationMessage {
  @PrimaryColumn()
  id: number;

  @Column()
  channel_id: number;

  @Column()
  role: string;

  @Column()
  content: string;

  @Column()
  parent_message_id: number; // Ensure this property is defined and decorated
}

Notes

The issue may be related to a mismatch between the entity class definition and the database schema. Ensuring that the parent_message_id column is properly defined in the entity class and included in the database schema should resolve the issue.

Recommendation

Apply a workaround by manually adding the parent_message_id column to the conversation_messages table schema, or update the entity class to include the parent_message_id property with proper TypeORM metadata. This should resolve the OperationalError and allow messages to be processed normally.

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

Messages should be processed normally. The conversation_messages table should include parent_message_id in its CREATE TABLE schema.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING