github doobidoo/mcp-memory-service v9.0.3
v9.0.3 - Critical Hotfix: Cloudflare D1 Migration

latest releases: v10.41.0, v10.40.4, v10.40.3...
3 months ago

🚨 Critical Hotfix: Cloudflare D1 Schema Migration

Release Date: 2026-01-17
Priority: HIGH (fixes container reboot loop)

Overview

This hotfix resolves a critical bug affecting Cloudflare users upgrading from v8.69.0 to v8.72.0+ that caused container reboot loops due to missing database columns.

Fixed

CRITICAL: Automatic Schema Migration for Cloudflare D1 Backend

Issue: Container reboot loop for Cloudflare users upgrading from v8.69.0 → v8.72.0+

Root Cause: v8.72.0 added tags and deleted_at columns, but Cloudflare backend had no migration logic.

Impact:

  • Users upgrading from v8.69.0 → v8.72.0+ experienced container reboot loop
  • 400 Bad Request errors from D1 when trying to use missing columns
  • Service unable to start until manual database intervention

Solution:

  • Added _migrate_d1_schema() method with automatic column detection and migration
  • Implemented _add_column_with_retry() with retry logic for D1 metadata sync issues
  • Added clear error messages with manual SQL workaround if automated migration fails
  • 9 integration tests covering all migration scenarios

Migration Process (Automatic on first startup):

  1. Check existing schema using PRAGMA table_info(memories)
  2. Add missing columns: tags TEXT, deleted_at REAL DEFAULT NULL
  3. Create index: idx_memories_deleted_at
  4. Verify columns are usable (handles D1 metadata sync issues)

Migration Safety:

  • Idempotent (safe to run multiple times)
  • Zero data loss (only adds columns)
  • Backward compatible (works with all versions v8.69.0+)

Manual Workaround (if automated migration fails):

ALTER TABLE memories ADD COLUMN tags TEXT;
ALTER TABLE memories ADD COLUMN deleted_at REAL DEFAULT NULL;
CREATE INDEX IF NOT EXISTS idx_memories_deleted_at ON memories(deleted_at);

Upgrade Instructions

For Cloudflare Users:

  1. Upgrade to v9.0.3 immediately: pip install --upgrade mcp-memory-service
  2. Restart service (migration runs automatically on first startup)
  3. Verify migration: Check logs for "Schema migration completed successfully"

For Docker Users:

docker pull ghcr.io/doobidoo/mcp-memory-service:v9.0.3
# or
docker pull doobidoo/mcp-memory-service:v9.0.3

Related Issues

Fixes: #354
PR: #355

Files Changed

  • src/mcp_memory_service/storage/cloudflare.py:290-495 - Added migration methods
  • tests/unit/test_cloudflare_migration.py - 387 lines of integration tests

Full Changelog

See CHANGELOG.md for complete details.


Recommendation: All Cloudflare users on v8.72.0+ should upgrade to v9.0.3 immediately to ensure proper database schema compatibility.

Don't miss a new mcp-memory-service release

NewReleases is sending notifications on new releases.