Troubleshooting ComplianceAsCode Builder
This guide addresses common issues you might encounter when using ComplianceAsCode Builder and provides solutions.
Docker-Related Issues
Container Won’t Start
Issue: The container fails to start after running docker-compose up -d
.
Solutions:
- Check Docker logs:
docker-compose logs
- Verify Docker is running:
docker info
- Ensure you have sufficient permissions:
# Linux users may need to run Docker with sudo or add user to docker group sudo docker-compose up -d
- Check for port conflicts:
# If other services are using the same ports docker-compose down docker-compose up -d
Disk Space Issues
Issue: Build fails with disk space errors.
Solutions:
- Clear Docker cache:
docker system prune -a
-
Free up disk space on your host system
- Increase Docker’s disk allocation (in Docker Desktop settings)
Build Failures
Certificate Issues
Issue: Build fails with SSL/certificate errors.
Solutions:
- Verify your certificates are correctly installed:
./setup.sh --cert /path/to/ca-bundle.pem
- For testing purposes, you can disable certificate verification:
./setup.sh --no-cert
- Check for proxy issues if you’re behind a corporate firewall
Python Dependency Issues
Issue: Build fails with Python package errors.
Solution: Rebuild the container to ensure all dependencies are installed:
docker-compose down
docker-compose build --no-cache
docker-compose up -d
Product-Specific Issues
Product Build Failures
Issue: Specific product fails to build.
Solutions:
- Update the ComplianceAsCode content:
# Inside the container cd /content git pull
- Ensure you’re using the correct product name:
# Check available products ./build_product.py --list-products
- Try building with verbose output:
build-product rhel10 --verbose
Missing Output Files
Issue: Build completes but some output files are missing.
Solution: Check for build warnings or errors in the output. Some products might not generate all file types.
Connection Issues
Can’t Connect to the Container
Issue: Unable to connect to the container with docker exec
.
Solutions:
- Verify the container is running:
docker ps | grep compliance-as-code
- If not running, start it:
docker-compose up -d
- Try connecting with the full container ID:
docker ps docker exec -it <full-container-id> bash
Repository and Git Issues
Git Authentication Failures
Issue: Git operations fail with authentication errors.
Solution: If using GitHub Container Registry or making Git operations:
# Set up Git credentials in the container
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Performance Issues
Slow Builds
Issue: Builds are taking too long.
Solutions:
- Use a minimal build type if you only need specific products:
./setup.sh --build-type minimal
-
Allocate more resources to Docker (CPU/memory in Docker Desktop settings)
- Use the pre-built products if available (in full build mode)
Getting Additional Help
If you’re still experiencing issues:
- Check the GitHub Issues to see if others have reported similar problems
- Report new issues with detailed information about your environment and the specific error messages
- Join the ComplianceAsCode community discussions for assistance