Skip to content

Troubleshooting Guide

Troubleshooting

Common Issues and Solutions

  1. Service Failed to Start

    # Check logs
    docker-compose logs [service-name]
    
    # Verify configurations
    docker-compose config
    
    # Check resource usage
    docker stats
    

  2. Authentication Issues

    # Check Keycloak logs
    docker-compose logs keycloak
    
    # Verify network connectivity
    docker network inspect keycloak_keycloak_net
    

Viewing Logs

Access and analyze centralized logs efficiently through Grafana and Docker:

1. Grafana - Centralized Log Visualization

  • Navigate to Explore: Open Grafana and click on the Explore icon (compass) in the left sidebar

  • Select Data Source: Choose Loki from the data source dropdown at the top

  • Configure Label Filters:

    • Click on "Label filters"
    • Select service_name as the label
    • Choose the desired container name from the available values (e.g., llmgw, iguard, etc.)
  • Adjust Time Range: If you don't see the expected container names:

    • Click on the time range picker in the upper right corner
    • Increase the time range (e.g., Last 24 hours or Last 7 days)
    • Container names will appear only if they generated logs within the selected time frame
  • View and Filter Logs:

    • Logs will appear in chronological order
    • Use the search bar to filter logs with specific text
    • Example queries:
      {service_name="llmgw"} |= "error"
      {service_name="iguard"} |= "warning"
      
  • Additional Features:

    • Use the "Live" button to see logs in real-time
    • Click on log lines to expand and see full details
    • Use the split view to compare logs from different services

2. Local Deployment Logs

  • Accessing Logs:
    • Navigate to the root folder where logs are stored:
      cd /logs
      
    • This directory contains raw log files organized by service component and date, allowing for manual inspection when necessary.
  • Log Format and Content: Understand the format of the logs (e.g., JSON, plain text) and the information they contain, such as timestamps, log level, and service identifiers.

3. Docker Container Logs

  • Viewing Real-Time Container Logs:
    docker logs container-name
    
  • Monitoring Logs with Timestamps:
    docker logs -f --timestamps container-name
    
  • Inspecting Recent Log Entries:
    docker logs --tail 100 container-name
    
  • Tips for Effective Log Management:
    • Use docker-compose logs for services managed via Docker Compose:
      docker-compose logs --follow service-name
      
    • Combine logs from all containers in a Docker Compose setup:
      docker-compose logs --tail=50 --follow
      
    • Filter logs by time or keywords using grep or other command-line tools for more specific log analysis.

Additional Tips

  • Setting Up Log Rotation: Ensure that log rotation is configured to manage disk space effectively. Docker and system-level log rotation settings should be verified to prevent service disruption due to filled disk spaces.