Developer tools dump stack traces, exit codes, and jargon. Figuring out *what to do next* often means searching the same Stack Overflow answers again.
| Rule( |
| 9 | id="docker.port_allocated", |
| 10 | tool="docker", |
| 11 | title="Port is already allocated", |
| 12 | why="Docker could not bind a published port because another process already uses it.", |
| 13 | checks=( |
| 14 | "Is another container or service using that host port?", |
| 15 | "Can you map a different host port?", |
| 16 | ), |
| 17 | fixes=( |
| 18 | "Stop the conflicting container: docker ps", |
| 19 | "Change the host port in compose/run flags", |
| 20 | ), |
| 21 | patterns=( |
| 22 | Pattern( |
| 23 | r"port is already allocated|Bind for .+: already in use|" |
| 24 | r"address already in use", |
| 25 | kind="regex", |
| 26 | required=True, |
| 27 | ), |
| 28 | Pattern("docker", kind="tool"), |
| 29 | ), |
| 30 | confidence="high", |
| 31 | secondary=("failed to bind",), |
| 32 | ), |
| 33 | Rule( |
| 34 | id="docker.daemon_not_running", |
| 35 | tool="docker", |
| 36 | title="Cannot connect to the Docker daemon", |
| 37 | why="The Docker client cannot reach the Docker daemon — Docker may not be running " |
| 38 | "or you lack permission.", |
| 39 | checks=( |
| 40 | "Is Docker Desktop / dockerd running?", |
| 41 | "Is your user in the docker group?", |
| 42 | "Is DOCKER_HOST set incorrectly?", |
| 43 | ), |
| 44 | fixes=( |
| 45 | "Start Docker Desktop or the docker service", |
| 46 | "docker info", |
| 47 | ), |
| 48 | patterns=( |
| 49 | Pattern( |
| 50 | r"Cannot connect to the Docker daemon|" |
| 51 | r"Is the docker daemon running|" |
| 52 | r"error during connect", |
| 53 | kind="regex", |
| 54 | required=True, |
| 55 | ), |
| 56 | ), |
| 57 | confidence="high", |
| 58 | secondary=("docker",), |
| 59 | ), |
| 60 | Rule( |
| 61 | id="docker.image_not_found", |
| 62 | tool="docker", |
| 63 | title="Docker image not found", |
| 64 | why="The requested image name/tag does not exist locally and could not be pulled.", |
| 65 | checks=( |
| 66 | "Is the image name and tag correct?", |
| 67 | "Is the registry reachable / authenticated?", |
| 68 | ), |
| 69 | fixes=( |
| 70 | "docker pull <image>:<tag>", |
| 71 | "Verify the name on the registry", |
| 72 | ), |
| 73 | patterns=( |
| 74 | Pattern( |
| 75 | r"Unable to find image|pull access denied|" |
| 76 | r"manifest for .+ not found|manifest unknown|" |
| 77 | r"repository does not exist|Error response from daemon: pull", |
| 78 | kind="regex", |
| 79 | required=True, |
| 80 | ), |
| 81 | ), |
| 82 | confidence="high", |
| 83 | secondary=("docker", "pull"), |
| 84 | ), |
| 85 | Rule( |
| 86 | id="docker.name_in_use", |
| 87 | tool="docker", |
| 88 | title="Container name already in use", |
| 89 | why="A container with that name already exists.", |
| 90 | checks=( |
| 91 | "Do you want to reuse, rename, or remove the existing container?", |
| 92 | ), |
| 93 | fixes=( |
| 94 | "docker rm -f <name>", |
| 95 | "Or choose a different --name", |
| 96 | ), |
| 97 | patterns=( |
| 98 | Pattern( |
| 99 | r"Conflict\. The container name .+ is already in use|" |
| 100 | r"name is already in use", |
| 101 | kind="regex", |
| 102 | required=True, |
| 103 | ), |
| 104 | ), |
| 105 | confidence="high", |
| 106 | secondary=("docker",), |
| 107 | ), |
| 108 | Rule( |
| 109 | id="docker.permission_denied", |
| 110 | tool="docker", |
| 111 | title="Docker permission denied", |
| 112 | why="Your user cannot access the Docker socket or a bind-mounted path.", |
| 113 | checks=( |
| 114 | "Is your user in the docker group?", |
| 115 | "Does a volume mount point to a restricted host path?", |
| 116 | ), |
| 117 | fixes=( |
| 118 | "Add your user to the docker group and re-login", |
| 119 | "Or run Docker Desktop as a user with access", |
| 120 | ), |
| 121 | patterns=( |
| 122 | Pattern("Permission denied", kind="exact", required=True), |
| 123 | Pattern( |
| 124 | r"docker\.sock|/var/run/docker|Got permission denied while trying to connect", |
| 125 | kind="regex", |
| 126 | required=True, |
| 127 | ), |
| 128 | ), |
| 129 | confidence="high", |
| 130 | ), |
| 131 | Rule( |
| 132 | id="docker.no_such_service", |
| 133 | tool="docker", |
| 134 | title="No such Compose service", |
| 135 | why="docker compose was asked to operate on a service name that is not defined.", |
| 136 | checks=( |
| 137 | "Is the service name spelled correctly in compose.yaml?", |
| 138 | "Are you in the correct project directory?", |
| 139 | ), |
| 140 | fixes=( |
| 141 | "docker compose config --services", |
| 142 | "Use a service name that exists in the compose file", |
| 143 | ), |
| 144 | patterns=( |
| 145 | Pattern( |
| 146 | r"no such service|service .+ not found", |
| 147 | kind="regex", |
| 148 | required=True, |
| 149 | ), |
| 150 | ), |
| 151 | confidence="high", |
| 152 | secondary=("compose", "docker"), |
| 153 | ), |
| 154 | Rule( |
| 155 | id="docker.build_failed", |
| 156 | tool="docker", |
| 157 | title="Docker build failed", |
| 158 | why="A Dockerfile instruction failed during image build.", |
| 159 | checks=( |
| 160 | "Which build step number failed?", |
| 161 | "Are COPY paths correct?", |
| 162 | "Did an apt/npm/pip command inside the build fail?", |
| 163 | ), |
| 164 | fixes=( |
| 165 | "Read the failing RUN/COPY step output above the error", |
| 166 | "docker build --progress=plain .", |
| 167 | ), |
| 168 | patterns=( |
| 169 | Pattern( |
| 170 | r"ERROR \[.*\]|failed to solve|executor failed running|" |
| 171 | r"build failed|The command '/bin/sh -c .*' returned a non-zero code", |
| 172 | kind="regex", |
| 173 | required=True, |
| 174 | ), |
| 175 | ), |
| 176 | confidence="medium", |
| 177 | secondary=("docker", "Dockerfile"), |
| 178 | ), |
| 179 | Rule( |
| 180 | id="docker.healthcheck_failed", |
| 181 | tool="docker", |
| 182 | title="Container healthcheck failed", |
| 183 | why="The container started but its HEALTHCHECK reported unhealthy.", |
| 184 | checks=( |
| 185 | "Is the healthcheck command correct?", |
| 186 | "Is the app listening on the expected port inside the container?", |
| 187 | "Do logs show startup errors?", |
| 188 | ), |
| 189 | fixes=( |
| 190 | "docker inspect --format='{{json .State.Health}}' <container>", |
| 191 | "docker logs <container>", |
| 192 | ), |
| 193 | patterns=( |
| 194 | Pattern( |
| 195 | r"healthcheck|unhealthy|Health check failed", |
| 196 | kind="regex", |
| 197 | required=True, |
| 198 | ), |
| 199 | Pattern("docker", kind="tool"), |
| 200 | ), |
| 201 | confidence="medium", |
| 202 | ), |
| 203 | Rule( |
| 204 | id="docker.network_not_found", |
| 205 | tool="docker", |
| 206 | title="Docker network not found", |
| 207 | why="The container was attached to a network that does not exist.", |
| 208 | checks=( |
| 209 | "Was the network removed?", |
| 210 | "Is the network name correct in compose/run?", |
| 211 | ), |
| 212 | fixes=( |
| 213 | "docker network ls", |
| 214 | "docker network create <name>", |
| 215 | "Or: docker compose up to recreate project networks", |
| 216 | ), |
| 217 | patterns=( |
| 218 | Pattern( |
| 219 | r"network .+ not found|Error: No such network", |
| 220 | kind="regex", |
| 221 | required=True, |
| 222 | ), |
| 223 | ), |
| 224 | confidence="high", |
| 225 | secondary=("docker",), |
| 226 | ), |
| 227 | Rule( |
| 228 | id="docker.volume_not_found", |
| 229 | tool="docker", |
| 230 | title="Docker volume not found", |
| 231 | why="A referenced named volume does not exist.", |
| 232 | checks=( |
| 233 | "Was the volume deleted?", |
| 234 | "Is the volume name correct?", |
| 235 | ), |
| 236 | fixes=( |
| 237 | "docker volume ls", |
| 238 | "docker volume create <name>", |
| 239 | ), |
| 240 | patterns=( |
| 241 | Pattern( |
| 242 | r"volume .+ not found|No such volume", |
| 243 | kind="regex", |
| 244 | required=True, |
| 245 | ), |
| 246 | ), |
| 247 | confidence="high", |
| 248 | secondary=("docker",), |
| 249 | ), |
| 250 | ] |