codeforge-dev 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devcontainer/CHANGELOG.md +112 -0
- package/.devcontainer/README.md +7 -3
- package/.devcontainer/config/main-system-prompt.md +10 -0
- package/.devcontainer/config/settings.json +9 -5
- package/.devcontainer/connect-external-terminal.ps1 +77 -0
- package/.devcontainer/connect-external-terminal.sh +69 -0
- package/.devcontainer/devcontainer.json +9 -4
- package/.devcontainer/features/agent-browser/install.sh +5 -5
- package/.devcontainer/features/biome/devcontainer-feature.json +16 -0
- package/.devcontainer/features/biome/install.sh +19 -0
- package/.devcontainer/features/tmux/README.md +75 -0
- package/.devcontainer/features/tmux/devcontainer-feature.json +17 -0
- package/.devcontainer/features/tmux/install.sh +52 -0
- package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +2 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/hooks/hooks.json +5 -5
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/format-on-stop.py +177 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/hooks/hooks.json +2 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/.claude-plugin/commands/debug.md +86 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/debug-logs.md +149 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/hooks/hooks.json +46 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/collect-edited-files.py +44 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/skill-suggester.py +229 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/syntax-validator.py +141 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/debugging/SKILL.md +165 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/debugging/references/error-patterns.md +530 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/debugging/references/log-locations.md +430 -0
- package/README.md +13 -9
- package/package.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/format-file.py +0 -101
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/claude-code-headless/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/claude-code-headless/references/cli-flags-and-output.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/claude-code-headless/references/sdk-and-mcp.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/docker/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/docker/references/compose-services.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/docker/references/dockerfile-patterns.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/docker-py/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/docker-py/references/container-lifecycle.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/docker-py/references/resources-and-security.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/fastapi/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/fastapi/references/middleware-and-lifespan.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/fastapi/references/pydantic-models.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/fastapi/references/routing-and-dependencies.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/fastapi/references/sse-and-streaming.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/pydantic-ai/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/pydantic-ai/references/agents-and-tools.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/pydantic-ai/references/models-and-streaming.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/skill-building/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/skill-building/references/cross-vendor-principles.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/skill-building/references/patterns-and-antipatterns.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/skill-building/references/skill-authoring-patterns.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/sqlite/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/sqlite/references/advanced-queries.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/sqlite/references/javascript-patterns.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/sqlite/references/python-patterns.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/sqlite/references/schema-and-pragmas.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/ai-sdk-svelte.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/component-patterns.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/layercake.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/migration-guide.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/runes-and-reactivity.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/spa-and-routing.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/svelte5/references/svelte-dnd-action.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/testing/SKILL.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/testing/references/fastapi-testing.md +0 -0
- /package/.devcontainer/plugins/devs-marketplace/plugins/{codedirective-skills → code-directive}/skills/testing/references/svelte-testing.md +0 -0
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
# Error Patterns Reference
|
|
2
|
+
|
|
3
|
+
Catalog of common error patterns with symptoms, diagnosis commands, and resolutions. Organized by error category.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Connection Errors
|
|
8
|
+
|
|
9
|
+
### ECONNREFUSED / Connection refused
|
|
10
|
+
|
|
11
|
+
**Symptoms:**
|
|
12
|
+
```
|
|
13
|
+
Error: connect ECONNREFUSED 127.0.0.1:5432
|
|
14
|
+
ConnectionRefusedError: [Errno 111] Connection refused
|
|
15
|
+
upstream connect error or disconnect/reset before headers
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Diagnosis:**
|
|
19
|
+
```bash
|
|
20
|
+
# Is the target service running?
|
|
21
|
+
docker ps -a --filter "name=<service>"
|
|
22
|
+
ss -tlnp | grep <port>
|
|
23
|
+
netstat -tlnp 2>/dev/null | grep <port>
|
|
24
|
+
|
|
25
|
+
# Can we reach the port?
|
|
26
|
+
curl -v telnet://localhost:<port> 2>&1 | head -5
|
|
27
|
+
|
|
28
|
+
# In Docker Compose, services use service names as hostnames
|
|
29
|
+
docker compose exec <client_service> sh -c "nc -zv <target_service> <port>"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Resolution:**
|
|
33
|
+
- Target service is not running → Start it, check its logs for startup failures
|
|
34
|
+
- Wrong hostname → In Docker Compose, use the service name (not `localhost`)
|
|
35
|
+
- Wrong port → Verify the port the service is actually listening on
|
|
36
|
+
- Service starting too slowly → Add health check + `depends_on` with `condition: service_healthy`
|
|
37
|
+
|
|
38
|
+
### ETIMEDOUT / Connection timed out
|
|
39
|
+
|
|
40
|
+
**Symptoms:**
|
|
41
|
+
```
|
|
42
|
+
Error: connect ETIMEDOUT 10.0.0.5:3000
|
|
43
|
+
requests.exceptions.ConnectTimeout
|
|
44
|
+
dial tcp 10.0.0.5:3000: i/o timeout
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Diagnosis:**
|
|
48
|
+
```bash
|
|
49
|
+
# Network reachability
|
|
50
|
+
ping -c 3 <host>
|
|
51
|
+
traceroute <host>
|
|
52
|
+
|
|
53
|
+
# DNS resolution
|
|
54
|
+
nslookup <hostname>
|
|
55
|
+
dig <hostname>
|
|
56
|
+
|
|
57
|
+
# Docker network inspection
|
|
58
|
+
docker network ls
|
|
59
|
+
docker network inspect <network_name>
|
|
60
|
+
|
|
61
|
+
# Check if container is on the expected network
|
|
62
|
+
docker inspect --format '{{json .NetworkSettings.Networks}}' <container> | python3 -m json.tool
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Resolution:**
|
|
66
|
+
- Containers on different Docker networks → Connect to same network or use `external` network
|
|
67
|
+
- Firewall/security group blocking → Check iptables, cloud security groups
|
|
68
|
+
- DNS not resolving → Verify Docker DNS, check `/etc/resolv.conf` in container
|
|
69
|
+
|
|
70
|
+
### DNS Resolution Failure
|
|
71
|
+
|
|
72
|
+
**Symptoms:**
|
|
73
|
+
```
|
|
74
|
+
Error: getaddrinfo ENOTFOUND myservice
|
|
75
|
+
socket.gaierror: [Errno -2] Name or service not known
|
|
76
|
+
dial tcp: lookup myservice: no such host
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Diagnosis:**
|
|
80
|
+
```bash
|
|
81
|
+
# From inside the container
|
|
82
|
+
docker compose exec <service> sh -c "nslookup <target_hostname>"
|
|
83
|
+
docker compose exec <service> sh -c "cat /etc/resolv.conf"
|
|
84
|
+
|
|
85
|
+
# Docker DNS uses 127.0.0.11 internally
|
|
86
|
+
docker compose exec <service> sh -c "nslookup <target_hostname> 127.0.0.11"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Resolution:**
|
|
90
|
+
- Typo in hostname → Check Compose service names, environment variables
|
|
91
|
+
- Container not on same network → Verify Docker network membership
|
|
92
|
+
- External DNS failure → Check `/etc/resolv.conf`, try `8.8.8.8` as resolver
|
|
93
|
+
|
|
94
|
+
### SSL/TLS Errors
|
|
95
|
+
|
|
96
|
+
**Symptoms:**
|
|
97
|
+
```
|
|
98
|
+
SSL: CERTIFICATE_VERIFY_FAILED
|
|
99
|
+
unable to verify the first certificate
|
|
100
|
+
x509: certificate signed by unknown authority
|
|
101
|
+
ERR_CERT_AUTHORITY_INVALID
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Diagnosis:**
|
|
105
|
+
```bash
|
|
106
|
+
# Check certificate
|
|
107
|
+
openssl s_client -connect <host>:<port> -servername <host> </dev/null 2>/dev/null | openssl x509 -noout -dates -subject -issuer
|
|
108
|
+
|
|
109
|
+
# Check certificate chain
|
|
110
|
+
openssl s_client -connect <host>:<port> -servername <host> -showcerts </dev/null 2>&1 | grep -E "subject|issuer|verify"
|
|
111
|
+
|
|
112
|
+
# Check CA bundle in container
|
|
113
|
+
docker compose exec <service> sh -c "ls -la /etc/ssl/certs/"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Resolution:**
|
|
117
|
+
- Self-signed cert in development → Set `REQUESTS_CA_BUNDLE`, `NODE_TLS_REJECT_UNAUTHORIZED=0` (dev only!)
|
|
118
|
+
- Expired certificate → Renew, check dates with openssl command above
|
|
119
|
+
- Missing intermediate cert → Ensure full chain is provided, not just leaf cert
|
|
120
|
+
- CA not trusted in container → Mount CA cert and update trust store
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Resource Exhaustion Errors
|
|
125
|
+
|
|
126
|
+
### OOMKilled (Out of Memory)
|
|
127
|
+
|
|
128
|
+
**Symptoms:**
|
|
129
|
+
```
|
|
130
|
+
Container exited with code 137
|
|
131
|
+
Killed
|
|
132
|
+
OOMKilled: true
|
|
133
|
+
kernel: Out of memory: Killed process <pid> (<name>)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Diagnosis:**
|
|
137
|
+
```bash
|
|
138
|
+
# Check if container was OOM killed
|
|
139
|
+
docker inspect --format '{{.State.OOMKilled}}' <container>
|
|
140
|
+
|
|
141
|
+
# Container memory limit vs usage
|
|
142
|
+
docker stats --no-stream <container>
|
|
143
|
+
|
|
144
|
+
# Memory limit configured
|
|
145
|
+
docker inspect --format '{{.HostConfig.Memory}}' <container>
|
|
146
|
+
|
|
147
|
+
# Kernel OOM killer logs
|
|
148
|
+
journalctl -k --no-pager | grep -i "oom\|out of memory\|killed process" | tail -10
|
|
149
|
+
dmesg | grep -i "oom\|killed process" | tail -10
|
|
150
|
+
|
|
151
|
+
# Current memory usage
|
|
152
|
+
free -h
|
|
153
|
+
cat /proc/meminfo | head -10
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Resolution:**
|
|
157
|
+
- Increase container memory limit in `docker-compose.yml` (`deploy.resources.limits.memory`)
|
|
158
|
+
- Increase host memory or swap
|
|
159
|
+
- Fix memory leak in application (profile with language-specific tools)
|
|
160
|
+
- For Java: adjust `-Xmx` heap size to stay within container limit
|
|
161
|
+
- For Node: `--max-old-space-size=<MB>`
|
|
162
|
+
|
|
163
|
+
### Disk Space Exhaustion
|
|
164
|
+
|
|
165
|
+
**Symptoms:**
|
|
166
|
+
```
|
|
167
|
+
No space left on device
|
|
168
|
+
ENOSPC: no space left on device
|
|
169
|
+
OSError: [Errno 28] No space left on device
|
|
170
|
+
write /var/lib/docker/...: no space left on device
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Diagnosis:**
|
|
174
|
+
```bash
|
|
175
|
+
# Filesystem usage
|
|
176
|
+
df -h
|
|
177
|
+
|
|
178
|
+
# Largest directories
|
|
179
|
+
du -sh /var/lib/docker/ 2>/dev/null
|
|
180
|
+
du -sh /var/log/ 2>/dev/null
|
|
181
|
+
du -sh /tmp/ 2>/dev/null
|
|
182
|
+
|
|
183
|
+
# Docker disk usage breakdown
|
|
184
|
+
docker system df
|
|
185
|
+
docker system df -v
|
|
186
|
+
|
|
187
|
+
# Large Docker images
|
|
188
|
+
docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" | sort -k3 -h
|
|
189
|
+
|
|
190
|
+
# Dangling images and stopped containers
|
|
191
|
+
docker images -f "dangling=true"
|
|
192
|
+
docker ps -a --filter "status=exited" --format "table {{.Names}}\t{{.Size}}"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Resolution:**
|
|
196
|
+
- Clean Docker resources: `docker system prune` (removes stopped containers, dangling images, unused networks)
|
|
197
|
+
- Clean build cache: `docker builder prune`
|
|
198
|
+
- Remove old images: `docker image prune -a`
|
|
199
|
+
- Rotate/compress log files
|
|
200
|
+
- Increase disk allocation
|
|
201
|
+
|
|
202
|
+
### File Descriptor Exhaustion
|
|
203
|
+
|
|
204
|
+
**Symptoms:**
|
|
205
|
+
```
|
|
206
|
+
Too many open files
|
|
207
|
+
EMFILE: too many open files
|
|
208
|
+
OSError: [Errno 24] Too many open files
|
|
209
|
+
accept4: too many open files
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Diagnosis:**
|
|
213
|
+
```bash
|
|
214
|
+
# Current limits
|
|
215
|
+
ulimit -n
|
|
216
|
+
|
|
217
|
+
# Per-process file descriptors (find PID first)
|
|
218
|
+
ls -la /proc/<pid>/fd | wc -l
|
|
219
|
+
cat /proc/<pid>/limits | grep "open files"
|
|
220
|
+
|
|
221
|
+
# System-wide
|
|
222
|
+
cat /proc/sys/fs/file-nr
|
|
223
|
+
# Format: <allocated> <free> <max>
|
|
224
|
+
|
|
225
|
+
# In Docker
|
|
226
|
+
docker exec <container> sh -c "ulimit -n"
|
|
227
|
+
docker exec <container> sh -c "cat /proc/1/limits | grep 'open files'"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Resolution:**
|
|
231
|
+
- Increase container ulimit: `ulimits: { nofile: { soft: 65536, hard: 65536 } }` in Compose
|
|
232
|
+
- Increase host limit in `/etc/security/limits.conf`
|
|
233
|
+
- Fix file descriptor leaks (unclosed connections, file handles)
|
|
234
|
+
- For databases: check connection pooling settings
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Permission Errors
|
|
239
|
+
|
|
240
|
+
### EACCES / Permission denied
|
|
241
|
+
|
|
242
|
+
**Symptoms:**
|
|
243
|
+
```
|
|
244
|
+
Error: EACCES: permission denied, open '/app/data/file.txt'
|
|
245
|
+
PermissionError: [Errno 13] Permission denied: '/app/data/file.txt'
|
|
246
|
+
open /app/data/file.txt: permission denied
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Diagnosis:**
|
|
250
|
+
```bash
|
|
251
|
+
# Check file ownership and permissions
|
|
252
|
+
docker exec <container> ls -la /app/data/
|
|
253
|
+
docker exec <container> id
|
|
254
|
+
|
|
255
|
+
# Check who the container runs as
|
|
256
|
+
docker inspect --format '{{.Config.User}}' <container>
|
|
257
|
+
|
|
258
|
+
# Volume mount permissions
|
|
259
|
+
ls -la <host_mount_path>
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**Resolution:**
|
|
263
|
+
- Mismatch between container user UID and file owner → Set correct ownership on host or match UIDs
|
|
264
|
+
- Volume mounted as root, container runs as non-root → `chown` on host or use `user:` in Compose
|
|
265
|
+
- Read-only filesystem → Check if volume is mounted as `:ro`
|
|
266
|
+
- SELinux → Add `:z` or `:Z` suffix to volume mount
|
|
267
|
+
|
|
268
|
+
### EPERM / Operation not permitted
|
|
269
|
+
|
|
270
|
+
**Symptoms:**
|
|
271
|
+
```
|
|
272
|
+
Operation not permitted
|
|
273
|
+
EPERM: operation not permitted
|
|
274
|
+
permission denied while trying to connect to the Docker daemon socket
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Diagnosis:**
|
|
278
|
+
```bash
|
|
279
|
+
# Docker socket access
|
|
280
|
+
ls -la /var/run/docker.sock
|
|
281
|
+
id # Check group membership
|
|
282
|
+
|
|
283
|
+
# Container capabilities
|
|
284
|
+
docker inspect --format '{{.HostConfig.CapAdd}}' <container>
|
|
285
|
+
docker inspect --format '{{.HostConfig.SecurityOpt}}' <container>
|
|
286
|
+
|
|
287
|
+
# AppArmor / seccomp
|
|
288
|
+
docker inspect --format '{{.HostConfig.SecurityOpt}}' <container>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
**Resolution:**
|
|
292
|
+
- Docker socket → Add user to `docker` group, or mount socket with correct permissions
|
|
293
|
+
- Missing capability → Add with `cap_add:` in Compose (e.g., `NET_ADMIN`, `SYS_PTRACE`)
|
|
294
|
+
- Seccomp blocking → Use custom seccomp profile or `--security-opt seccomp=unconfined` (dev only)
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## Application Errors
|
|
299
|
+
|
|
300
|
+
### Unhandled Exceptions (Python)
|
|
301
|
+
|
|
302
|
+
**Symptoms:**
|
|
303
|
+
```
|
|
304
|
+
Traceback (most recent call last):
|
|
305
|
+
File "/app/main.py", line 42, in process_request
|
|
306
|
+
result = await db.execute(query)
|
|
307
|
+
asyncio.exceptions.CancelledError
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
**Diagnosis:**
|
|
311
|
+
```bash
|
|
312
|
+
# Search for tracebacks in container logs
|
|
313
|
+
docker logs <container> 2>&1 | grep -A 20 "Traceback"
|
|
314
|
+
|
|
315
|
+
# Search log files
|
|
316
|
+
grep -r -A 20 "Traceback" /app/logs/ 2>/dev/null
|
|
317
|
+
|
|
318
|
+
# Check the last error specifically
|
|
319
|
+
docker logs --tail 50 <container> 2>&1 | grep -B 5 -A 20 "Error\|Exception"
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Resolution:**
|
|
323
|
+
- Read the traceback bottom-to-top: the exception type and message are at the bottom, the call chain above
|
|
324
|
+
- `ModuleNotFoundError` → Missing dependency, check requirements.txt/pyproject.toml
|
|
325
|
+
- `AttributeError` → Wrong object type or missing attribute
|
|
326
|
+
- `KeyError` → Missing dictionary key, check data shape
|
|
327
|
+
- `asyncio.CancelledError` → Task cancelled, often during shutdown
|
|
328
|
+
|
|
329
|
+
### Unhandled Promise Rejections (Node.js)
|
|
330
|
+
|
|
331
|
+
**Symptoms:**
|
|
332
|
+
```
|
|
333
|
+
UnhandledPromiseRejectionWarning: Error: <message>
|
|
334
|
+
(node:1) UnhandledPromiseRejection
|
|
335
|
+
This error originated either by throwing inside an async function without a catch block
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
**Diagnosis:**
|
|
339
|
+
```bash
|
|
340
|
+
docker logs <container> 2>&1 | grep -B 5 -A 10 "UnhandledPromiseRejection\|unhandledRejection"
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
**Resolution:**
|
|
344
|
+
- Add try/catch around async operations
|
|
345
|
+
- Add global handler: `process.on('unhandledRejection', handler)`
|
|
346
|
+
- Check if a database connection or external service call is failing
|
|
347
|
+
|
|
348
|
+
### Segmentation Faults
|
|
349
|
+
|
|
350
|
+
**Symptoms:**
|
|
351
|
+
```
|
|
352
|
+
Segmentation fault (core dumped)
|
|
353
|
+
signal: segmentation fault (core dumped)
|
|
354
|
+
SIGSEGV
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**Diagnosis:**
|
|
358
|
+
```bash
|
|
359
|
+
# Kernel log for segfault details
|
|
360
|
+
dmesg | grep segfault | tail -5
|
|
361
|
+
journalctl -k | grep segfault | tail -5
|
|
362
|
+
|
|
363
|
+
# Check if core dump exists
|
|
364
|
+
ls -la /var/crash/ /tmp/core.* 2>/dev/null
|
|
365
|
+
|
|
366
|
+
# In container
|
|
367
|
+
docker logs <container> 2>&1 | grep -i "segfault\|sigsegv\|core dumped"
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Resolution:**
|
|
371
|
+
- Native extension or C library issue — update dependencies
|
|
372
|
+
- Memory corruption — check for buffer overflows in native code
|
|
373
|
+
- Incompatible binary — rebuild native modules for container architecture
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Docker-Specific Errors
|
|
378
|
+
|
|
379
|
+
### Image Not Found
|
|
380
|
+
|
|
381
|
+
**Symptoms:**
|
|
382
|
+
```
|
|
383
|
+
Error response from daemon: manifest for <image>:<tag> not found
|
|
384
|
+
pull access denied for <image>, repository does not exist
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**Diagnosis:**
|
|
388
|
+
```bash
|
|
389
|
+
# Check available local images
|
|
390
|
+
docker images | grep <image_name>
|
|
391
|
+
|
|
392
|
+
# Check registry
|
|
393
|
+
docker manifest inspect <image>:<tag> 2>&1
|
|
394
|
+
|
|
395
|
+
# Check Compose file for typos
|
|
396
|
+
grep -n "image:" docker-compose.yml
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
**Resolution:**
|
|
400
|
+
- Typo in image name or tag
|
|
401
|
+
- Private registry requires `docker login`
|
|
402
|
+
- Image was removed from registry
|
|
403
|
+
- Architecture mismatch (arm64 vs amd64)
|
|
404
|
+
|
|
405
|
+
### Port Conflict
|
|
406
|
+
|
|
407
|
+
**Symptoms:**
|
|
408
|
+
```
|
|
409
|
+
Bind for 0.0.0.0:8080 failed: port is already allocated
|
|
410
|
+
Error starting userland proxy: listen tcp4 0.0.0.0:8080: bind: address already in use
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**Diagnosis:**
|
|
414
|
+
```bash
|
|
415
|
+
# What's using the port?
|
|
416
|
+
ss -tlnp | grep <port>
|
|
417
|
+
lsof -i :<port> 2>/dev/null
|
|
418
|
+
|
|
419
|
+
# Docker containers using the port
|
|
420
|
+
docker ps --format "table {{.Names}}\t{{.Ports}}" | grep <port>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**Resolution:**
|
|
424
|
+
- Stop the conflicting service or container
|
|
425
|
+
- Change the host port mapping in Compose (e.g., `8081:8080` instead of `8080:8080`)
|
|
426
|
+
|
|
427
|
+
### Volume Mount Errors
|
|
428
|
+
|
|
429
|
+
**Symptoms:**
|
|
430
|
+
```
|
|
431
|
+
ERROR: for <service> Cannot create container for service <service>: source path does not exist
|
|
432
|
+
Mounts denied: the path /host/path is not shared from the host
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
**Diagnosis:**
|
|
436
|
+
```bash
|
|
437
|
+
# Check if host path exists
|
|
438
|
+
ls -la <host_path>
|
|
439
|
+
|
|
440
|
+
# Check Docker Desktop file sharing settings (macOS/Windows)
|
|
441
|
+
docker info | grep -A 5 "Docker Root Dir"
|
|
442
|
+
|
|
443
|
+
# Inspect existing mounts
|
|
444
|
+
docker inspect --format '{{json .Mounts}}' <container> | python3 -m json.tool
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
**Resolution:**
|
|
448
|
+
- Create the host directory before starting the container
|
|
449
|
+
- On Docker Desktop: add path to file sharing settings
|
|
450
|
+
- Use named volumes instead of bind mounts for portability
|
|
451
|
+
|
|
452
|
+
### Health Check Failures
|
|
453
|
+
|
|
454
|
+
**Symptoms:**
|
|
455
|
+
```
|
|
456
|
+
Container <name> is unhealthy
|
|
457
|
+
health_status: unhealthy
|
|
458
|
+
depends_on condition not met: service <name> is not healthy
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
**Diagnosis:**
|
|
462
|
+
```bash
|
|
463
|
+
# Health status and recent check results
|
|
464
|
+
docker inspect --format '{{json .State.Health}}' <container> | python3 -m json.tool
|
|
465
|
+
|
|
466
|
+
# What health check is configured?
|
|
467
|
+
docker inspect --format '{{json .Config.Healthcheck}}' <container> | python3 -m json.tool
|
|
468
|
+
|
|
469
|
+
# Run the health check manually
|
|
470
|
+
docker exec <container> <health_check_command>
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
**Resolution:**
|
|
474
|
+
- Health check command failing → Run it manually to see the error
|
|
475
|
+
- Service not ready in time → Increase `start_period` and `interval`
|
|
476
|
+
- Wrong health check endpoint → Verify the URL/port/command
|
|
477
|
+
|
|
478
|
+
### Build Failures
|
|
479
|
+
|
|
480
|
+
**Symptoms:**
|
|
481
|
+
```
|
|
482
|
+
ERROR: Service '<service>' failed to build
|
|
483
|
+
COPY failed: file not found in build context
|
|
484
|
+
RUN /bin/sh -c <command> returned a non-zero code
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
**Diagnosis:**
|
|
488
|
+
```bash
|
|
489
|
+
# Check .dockerignore (it may exclude needed files)
|
|
490
|
+
cat .dockerignore 2>/dev/null
|
|
491
|
+
|
|
492
|
+
# Verify build context contents
|
|
493
|
+
ls -la <context_path>
|
|
494
|
+
|
|
495
|
+
# Build with verbose output
|
|
496
|
+
docker compose build --no-cache --progress plain <service> 2>&1
|
|
497
|
+
|
|
498
|
+
# Check which stage failed in multi-stage build
|
|
499
|
+
docker compose build <service> 2>&1 | grep -E "^#|ERROR|FAILED"
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
**Resolution:**
|
|
503
|
+
- `COPY failed` → File excluded by `.dockerignore` or wrong path relative to build context
|
|
504
|
+
- `RUN` failed → Command error; read the output for the specific failure
|
|
505
|
+
- Cache invalidation → Use `--no-cache` to rebuild from scratch
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## Exit Code Reference
|
|
510
|
+
|
|
511
|
+
| Code | Signal | Meaning |
|
|
512
|
+
|---|---|---|
|
|
513
|
+
| `0` | — | Success / clean exit |
|
|
514
|
+
| `1` | — | General application error |
|
|
515
|
+
| `2` | — | Misuse of shell command (bad arguments) |
|
|
516
|
+
| `126` | — | Command invoked cannot execute (permission problem) |
|
|
517
|
+
| `127` | — | Command not found (bad PATH or entrypoint) |
|
|
518
|
+
| `128` | — | Invalid exit argument |
|
|
519
|
+
| `129` | SIGHUP (1) | Hangup (terminal closed) |
|
|
520
|
+
| `130` | SIGINT (2) | Interrupted (Ctrl+C) |
|
|
521
|
+
| `131` | SIGQUIT (3) | Quit with core dump |
|
|
522
|
+
| `134` | SIGABRT (6) | Abort (assertion failure, `abort()`) |
|
|
523
|
+
| `136` | SIGFPE (8) | Floating point exception |
|
|
524
|
+
| `137` | SIGKILL (9) | Killed (OOM killer, `docker kill`, `kill -9`) |
|
|
525
|
+
| `139` | SIGSEGV (11) | Segmentation fault |
|
|
526
|
+
| `141` | SIGPIPE (13) | Broken pipe |
|
|
527
|
+
| `143` | SIGTERM (15) | Terminated (`docker stop`, graceful shutdown) |
|
|
528
|
+
| `255` | — | Exit status out of range |
|
|
529
|
+
|
|
530
|
+
**Rule of thumb:** Exit codes 128+N mean the process was killed by signal N. Calculate: `exit_code - 128 = signal_number`.
|