Skip to main content

Debugging

Tips for debugging LusterCMS issues.

Backend Debugging

Logging

import logging
logger = logging.getLogger(__name__)

logger.debug("Debug message")
logger.info("Info message")
logger.warning("Warning message")
logger.error("Error message")

View logs:

docker logs infrastructure-backend-1 -f

Python Debugger

import pdb; pdb.set_trace()
# or
breakpoint()

GraphQL Debugging

Enable GraphiQL at /graphql for:

  • Schema exploration
  • Query testing
  • Error inspection

Frontend Debugging

React DevTools

Install browser extension for:

  • Component tree inspection
  • Props/state viewing
  • Performance profiling

Network Tab

Check API calls:

  • Request/response bodies
  • Headers
  • Timing

Console Logging

console.log('Debug:', data);
console.table(items);
console.time('operation');
// ... code
console.timeEnd('operation');

Common Issues

"Document not found"

Y.js collaboration issue:

  1. Check WebSocket connection
  2. Verify document ID
  3. Restart collab server

"Insufficient credits"

AI operation blocked:

  1. Check credit balance
  2. Purchase more credits
  3. Verify operation cost

"Permission denied"

RBAC issue:

  1. Check user role
  2. Verify permission assignment
  3. Check route guards

Docker Debugging

# View logs
docker compose logs -f

# Enter container
docker exec -it infrastructure-backend-1 bash

# Check health
docker compose ps

Database Debugging

# Connect to PostgreSQL
docker exec -it infrastructure-db-1 psql -U postgres

# View tables
\dt

# Query data
SELECT * FROM content_entries LIMIT 10;