Skip to content

Commit ef7adb7

Browse files
phernandezclaude
andcommitted
fix: add cloud_mode check to initialize_app()
MCP server crashes in cloud mode with: ValueError: DATABASE_URL must be set when using Postgres backend Root cause: initialize_app() did not check cloud_mode_enabled before trying to initialize the database. Only ensure_initialization() had the check. In cloud mode, tenant DBs are per-request via headers, not via DATABASE_URL environment variable. Also includes minor formatting fix in telemetry.py. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: phernandez <[email protected]>
1 parent 3cd9178 commit ef7adb7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/basic_memory/cli/commands/telemetry.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def status() -> None:
4949

5050
config = ConfigManager().config
5151

52-
status_text = "[green]enabled[/green]" if config.telemetry_enabled else "[yellow]disabled[/yellow]"
52+
status_text = (
53+
"[green]enabled[/green]" if config.telemetry_enabled else "[yellow]disabled[/yellow]"
54+
)
5355

5456
console.print(f"\nTelemetry: {status_text}")
5557
console.print(f"Install ID: [dim]{get_install_id()}[/dim]")

src/basic_memory/services/initialization.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ async def initialize_app(
162162
Args:
163163
app_config: The Basic Memory project configuration
164164
"""
165+
# Skip initialization in cloud mode - cloud manages its own projects
166+
if app_config.cloud_mode_enabled:
167+
logger.debug("Skipping initialization in cloud mode - projects managed by cloud")
168+
return
169+
165170
logger.info("Initializing app...")
166171
# Initialize database first
167172
await initialize_database(app_config)

0 commit comments

Comments
 (0)