Skip to content

Make Qual Output Analysis

Issues Identified

1. Orphan Containers Warning ⚠️

Warning:

WARN[0000] Found orphan containers ([po-minio-init po-promtail po-postgres po-loki po-grafana po-prometheus po-elasticsearch po-rabbitmq po-adminer po-minio po-traefik po-redis]) for this project.

Root Cause: - qualification.yml uses external networks (traefik-public and po-shared-network) - These networks are created by shared.yml which defines the infrastructure services - When running make qual, Docker Compose sees containers from shared.yml but they're not defined in qualification.yml - Docker Compose considers them "orphans" because they're not part of the current compose project

Impact: - ⚠️ Warning only - Services still work correctly - The orphan containers are actually required (they're the shared infrastructure) - This is expected behavior when using external networks

Solution Options:

Option A: Suppress Warning (Recommended) Add --remove-orphans flag to prevent the warning (but don't actually remove them since they're needed):

qual: networks
    @echo "Starting qualification environment..."
    @if [ ! -f .env.qual ]; then \
        echo "Copying .env.qual template..."; \
        cp infrastructure/env-templates/.env.qualification .env.qual; \
    fi
    @docker compose -f infrastructure/compose/qualification.yml --env-file .env.qual up -d --remove-orphans

Note: --remove-orphans won't remove containers on external networks, so it's safe.

Option B: Ensure Shared Infrastructure is Started First Modify qual target to start shared.yml first:

qual: networks
    @echo "Ensuring shared infrastructure is running..."
    @docker compose -f infrastructure/compose/shared.yml --env-file infrastructure/compose/.env.shared up -d || true
    @echo "Starting qualification environment..."
    @if [ ! -f .env.qual ]; then \
        echo "Copying .env.qual template..."; \
        cp infrastructure/env-templates/.env.qualification .env.qual; \
    fi
    @docker compose -f infrastructure/compose/qualification.yml --env-file .env.qual up -d

Option C: Ignore Warning (Current State) The warning is harmless - services work correctly. You can ignore it.

2. Traefik Network Warning ⚠️

Warning:

Warning: traefik network does not exist (required for qual/prod)

Root Cause: - The Makefile checks for a network named traefik (line 100) - But qualification.yml uses traefik-public (external network) - The check is looking for the wrong network name

Impact: - ⚠️ Warning only - Services still work - The network check is incorrect but doesn't affect functionality - traefik-public network is created by shared.yml when it starts

Solution:

Update the network check in Makefile to check for traefik-public instead of traefik:

@docker network inspect traefik-public >/dev/null 2>&1 || echo "  Warning: traefik-public network does not exist (will be created by shared.yml)"

Or better, ensure shared.yml is started first (see Option B above).

Current Behavior

Despite the warnings, everything works correctly:

Services Started Successfully: - All qualification services started - External networks (traefik-public, po-shared-network) are available - Services can communicate with shared infrastructure

No Functional Issues: - The warnings are informational only - Services are accessible at the expected URLs - No errors in the startup process

Fix 1: Update Network Check

Change line 100 in Makefile:

# Before:
@docker network inspect traefik >/dev/null 2>&1 || echo "  Warning: traefik network does not exist (required for qual/prod)"

# After:
@docker network inspect traefik-public >/dev/null 2>&1 || echo "  Info: traefik-public network will be created by shared.yml if needed"

Fix 2: Ensure Shared Infrastructure Starts First

Update qual target to start shared infrastructure:

qual: networks
    @echo "Ensuring shared infrastructure is running..."
    @if [ ! -f infrastructure/compose/.env.shared ]; then \
        echo "Warning: infrastructure/compose/.env.shared not found"; \
        echo "Shared infrastructure may not start correctly"; \
    fi
    @docker compose -f infrastructure/compose/shared.yml --env-file infrastructure/compose/.env.shared up -d || echo "  Shared infrastructure already running or not configured"
    @echo "Starting qualification environment..."
    @if [ ! -f .env.qual ]; then \
        echo "Copying .env.qual template..."; \
        cp infrastructure/env-templates/.env.qualification .env.qual; \
    fi
    @docker compose -f infrastructure/compose/qualification.yml --env-file .env.qual up -d
    @echo "Qualification environment started"
    @echo "Services available at:"
    @echo "  - Main website: https://public-fo-qual.portugalodyssey.pt"
    @echo "  - Strapi CMS: https://cms-qual.portugalodyssey.pt"
    @echo "  - API Gateway: https://api-qual.portugalodyssey.pt"

Fix 3: Suppress Orphan Warning (Optional)

Add --remove-orphans flag (safe because it won't remove containers on external networks):

@docker compose -f infrastructure/compose/qualification.yml --env-file .env.qual up -d --remove-orphans

Summary

Status:Working correctly - Warnings are informational only

Issues: 1. ⚠️ Orphan containers warning (harmless - expected with external networks) 2. ⚠️ Wrong network name in check (traefik vs traefik-public)

Recommendation: - Fix the network check (Fix 1) - Quick and easy - Optionally ensure shared infrastructure starts first (Fix 2) - Better practice - Optionally suppress orphan warning (Fix 3) - Cosmetic improvement

Priority: - Low - Everything works, warnings are cosmetic - Fixes are optional improvements for cleaner output