mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
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 <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
@@ -49,7 +49,9 @@ def status() -> None:
|
||||
|
||||
config = ConfigManager().config
|
||||
|
||||
status_text = "[green]enabled[/green]" if config.telemetry_enabled else "[yellow]disabled[/yellow]"
|
||||
status_text = (
|
||||
"[green]enabled[/green]" if config.telemetry_enabled else "[yellow]disabled[/yellow]"
|
||||
)
|
||||
|
||||
console.print(f"\nTelemetry: {status_text}")
|
||||
console.print(f"Install ID: [dim]{get_install_id()}[/dim]")
|
||||
|
||||
@@ -162,6 +162,11 @@ async def initialize_app(
|
||||
Args:
|
||||
app_config: The Basic Memory project configuration
|
||||
"""
|
||||
# Skip initialization in cloud mode - cloud manages its own projects
|
||||
if app_config.cloud_mode_enabled:
|
||||
logger.debug("Skipping initialization in cloud mode - projects managed by cloud")
|
||||
return
|
||||
|
||||
logger.info("Initializing app...")
|
||||
# Initialize database first
|
||||
await initialize_database(app_config)
|
||||
|
||||
Reference in New Issue
Block a user