|
| 1 | +--- |
| 2 | +name: docker-debug |
| 3 | +description: Debug Kurtosis running on local Docker. Inspect engine, API container, and service logs. Diagnose container crashes, port conflicts, and networking issues. Use when kurtosis commands fail or services aren't reachable on Docker. |
| 4 | +compatibility: Requires Docker and kurtosis CLI. |
| 5 | +metadata: |
| 6 | + author: ethpandaops |
| 7 | + version: "1.0" |
| 8 | +--- |
| 9 | + |
| 10 | +# Docker Debug |
| 11 | + |
| 12 | +Diagnose and fix issues with Kurtosis running on a local Docker engine. |
| 13 | + |
| 14 | +## Quick triage |
| 15 | + |
| 16 | +```bash |
| 17 | +# Check engine is running |
| 18 | +kurtosis engine status |
| 19 | + |
| 20 | +# List all kurtosis containers |
| 21 | +docker ps -a --filter "label=app.kubernetes.io/managed-by=kurtosis" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" |
| 22 | + |
| 23 | +# If no label filter works, grep for kurtosis |
| 24 | +docker ps -a | grep kurtosis |
| 25 | +``` |
| 26 | + |
| 27 | +## Engine issues |
| 28 | + |
| 29 | +### Engine won't start |
| 30 | + |
| 31 | +```bash |
| 32 | +# Check if old engine is still running |
| 33 | +docker ps -a | grep kurtosis-engine |
| 34 | + |
| 35 | +# Check engine logs |
| 36 | +docker logs $(docker ps -aq --filter "name=kurtosis-engine") 2>&1 | tail -50 |
| 37 | + |
| 38 | +# Nuclear option: stop and remove all kurtosis containers |
| 39 | +kurtosis engine stop |
| 40 | +docker ps -a | grep kurtosis | awk '{print $1}' | xargs -r docker rm -f |
| 41 | +kurtosis engine start |
| 42 | +``` |
| 43 | + |
| 44 | +### Engine version mismatch |
| 45 | + |
| 46 | +```bash |
| 47 | +# Check CLI version |
| 48 | +kurtosis version |
| 49 | + |
| 50 | +# Check running engine version |
| 51 | +kurtosis engine status |
| 52 | + |
| 53 | +# Force restart with matching version |
| 54 | +kurtosis engine restart |
| 55 | +``` |
| 56 | + |
| 57 | +## Enclave / API container issues |
| 58 | + |
| 59 | +The API container (core/APIC) runs inside each enclave and manages services. |
| 60 | + |
| 61 | +```bash |
| 62 | +# List enclaves |
| 63 | +kurtosis enclave ls |
| 64 | + |
| 65 | +# Find the APIC container for an enclave |
| 66 | +docker ps -a | grep "kurtosis-api" |
| 67 | + |
| 68 | +# View APIC logs (most useful for debugging enclave creation failures) |
| 69 | +docker logs $(docker ps -aq --filter "name=kurtosis-api") 2>&1 | tail -100 |
| 70 | +``` |
| 71 | + |
| 72 | +## Service debugging |
| 73 | + |
| 74 | +```bash |
| 75 | +# List services in an enclave |
| 76 | +kurtosis enclave inspect <enclave-name> |
| 77 | + |
| 78 | +# View service logs |
| 79 | +kurtosis service logs <enclave-name> <service-name> |
| 80 | + |
| 81 | +# Follow logs in real time |
| 82 | +kurtosis service logs <enclave-name> <service-name> -f |
| 83 | + |
| 84 | +# Shell into a running service |
| 85 | +kurtosis service shell <enclave-name> <service-name> |
| 86 | + |
| 87 | +# Execute a command in a service |
| 88 | +kurtosis service exec <enclave-name> <service-name> -- <command> |
| 89 | +``` |
| 90 | + |
| 91 | +## Port and networking issues |
| 92 | + |
| 93 | +```bash |
| 94 | +# Check mapped ports for a service |
| 95 | +kurtosis enclave inspect <enclave-name> |
| 96 | + |
| 97 | +# Verify port is actually listening inside the container |
| 98 | +kurtosis service exec <enclave-name> <service-name> -- netstat -tlnp |
| 99 | + |
| 100 | +# Test connectivity between services (from inside a service) |
| 101 | +kurtosis service exec <enclave-name> <service-name> -- wget -qO- http://<other-service>:<port>/endpoint |
| 102 | +``` |
| 103 | + |
| 104 | +## File artifacts |
| 105 | + |
| 106 | +```bash |
| 107 | +# List file artifacts in an enclave |
| 108 | +kurtosis enclave inspect <enclave-name> |
| 109 | + |
| 110 | +# Download a file artifact for inspection |
| 111 | +kurtosis files download <enclave-name> <artifact-name> /tmp/artifact-output |
| 112 | +``` |
| 113 | + |
| 114 | +## Common problems |
| 115 | + |
| 116 | +| Symptom | Likely cause | Fix | |
| 117 | +|---------|-------------|-----| |
| 118 | +| `engine not running` | Engine crashed or was stopped | `kurtosis engine start` | |
| 119 | +| Port conflict on start | Old container holding the port | `docker ps -a \| grep kurtosis \| awk '{print $1}' \| xargs docker rm -f` | |
| 120 | +| Service unreachable | Wrong port or service not ready | Check `kurtosis enclave inspect` for mapped ports | |
| 121 | +| `image not found` | Image not pulled or tag wrong | Check image name in Starlark, try `docker pull <image>` | |
| 122 | +| Enclave creation hangs | APIC crash or image pull issue | Check APIC logs: `docker logs` on the kurtosis-api container | |
| 123 | + |
| 124 | +## Cleanup |
| 125 | + |
| 126 | +```bash |
| 127 | +# Remove a specific enclave |
| 128 | +kurtosis enclave rm <enclave-name> |
| 129 | + |
| 130 | +# Remove all enclaves and clean up |
| 131 | +kurtosis clean -a |
| 132 | + |
| 133 | +# Full nuclear clean (if kurtosis clean fails) |
| 134 | +docker ps -a | grep kurtosis | awk '{print $1}' | xargs -r docker rm -f |
| 135 | +docker network ls | grep kurtosis | awk '{print $1}' | xargs -r docker network rm |
| 136 | +kurtosis engine start |
| 137 | +``` |
0 commit comments