Skip to content

Fix: Handle missing Graphiti compose file gracefully during restart#379

Open
Priyanka-2725 wants to merge 1 commit into
vxcontrol:mainfrom
Priyanka-2725:fix/installer-restart-graphiti-disabled
Open

Fix: Handle missing Graphiti compose file gracefully during restart#379
Priyanka-2725 wants to merge 1 commit into
vxcontrol:mainfrom
Priyanka-2725:fix/installer-restart-graphiti-disabled

Conversation

@Priyanka-2725

Copy link
Copy Markdown

Description of the Change

Problem

When running ./installer restart with GRAPHITI_ENABLED=false in .env, the installer fails with:

This occurs because:

  1. The restart operation attempts to stop all stacks including optional ones (Graphiti, Langfuse, Observability)
  2. The code checks if the compose file exists before stopping, but due to race conditions or timing issues, the check can pass while the actual operation fails
  3. The error propagates and causes the entire restart operation to fail, even though Graphiti is disabled

Solution

Added a two-layer defensive approach for handling missing compose files:

Layer 1: Existing check - composeFileExists() returns early if file doesn't exist

Layer 2 (NEW): Added error handling that catches "file does not exist" errors from the actual operation and treats them as success (skip gracefully)

Key changes:

  • Added isComposeMissingError() helper function to detect missing file errors by checking error messages
  • Modified performStackOperation() to catch and handle missing file errors gracefully for optional stacks
  • Added strings import for error message parsing
  • Added comprehensive unit tests to verify the fix

Closes #378

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Configuration change
  • 🧪 Test update
  • 🛡️ Security update

Areas Affected

  • Core Services (Frontend UI/Backend API)
  • AI Agents (Researcher/Developer/Executor)
  • Security Tools Integration
  • Memory System (Vector Store/Knowledge Base)
  • Monitoring Stack (Grafana/OpenTelemetry)
  • Analytics Platform (Langfuse)
  • External Integrations (LLM/Search APIs)
  • Documentation
  • Infrastructure/DevOps

Testing and Verification

Test Configuration

PentAGI Version: v2.0.0-87ac00f
Docker Version: Latest
Host OS: Ubuntu 26.04 LTS (reported), Windows 11 (development)
LLM Provider: N/A (installer-only change)
Enabled Features: Graphiti disabled (GRAPHITI_ENABLED=false)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: installer restart fails: "file docker-compose-graphiti.yml does not exist" when Graphiti is disabled

2 participants