troubleshoot
Diagnose container failures, networking issues, permissions, and port conflicts
What this skill does
# Docker Troubleshooting Skill
## Overview
This skill helps diagnose and resolve common Docker issues:
- Container startup failures
- Networking problems
- Permission errors
- Port conflicts
- Data persistence issues
- Health check failures
## Process
### 1. Consult Documentation
Read relevant documentation:
- `17-troubleshooting.md` for common issues
- `15-port-conflicts.md` for port problems
- `16-restart-strategies.md` for restart issues
### 2. Diagnose Issue
Gather information:
```bash
# Check container status
docker compose ps -a
# View logs
docker compose logs servicename
# Check configuration
docker compose config
# Inspect container
docker inspect containername
```
### 3. Apply Solution
## Common Issues and Solutions
### Container Won't Start
**Diagnosis:**
```bash
docker compose logs servicename
docker inspect --format='{{.State.ExitCode}}' containername
```
**Solutions:**
- Check logs for error messages
- Verify configuration syntax
- Check dependencies are running
- Verify image exists
### Port Already in Use
**Diagnosis:**
```bash
lsof -i :3000
# or
netstat -tulpn | grep 3000
```
**Solutions:**
```bash
# Kill process
kill $(lsof -t -i:3000)
# Or change port in compose
ports:
- "3001:3000"
```
### Permission Denied
**Diagnosis:**
```bash
docker compose exec app ls -la /app/data
```
**Solutions:**
```yaml
# Fix in compose
services:
app:
user: "1000:1000"
# Or fix in container
docker compose exec -u root app chown -R appuser:appgroup /app/data
```
### Data Disappearing
**Diagnosis:**
```bash
docker volume ls
docker compose config | grep -A5 "volumes:"
```
**Solutions:**
```yaml
# Use named volumes instead of anonymous
volumes:
- postgres_data:/var/lib/postgresql/data # Named (persists)
# NOT: - /var/lib/postgresql/data # Anonymous (deleted)
```
### Container Can't Reach Other Container
**Diagnosis:**
```bash
docker network inspect networkname
docker compose exec app ping db
docker compose exec app nslookup db
```
**Solutions:**
```yaml
# Ensure same network
services:
app:
networks:
- backend
db:
networks:
- backend
networks:
backend:
```
### Health Check Failing
**Diagnosis:**
```bash
docker inspect --format='{{json .State.Health}}' containername | jq
```
**Solutions:**
```yaml
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s # Give time to start
```
### Out of Disk Space
**Diagnosis:**
```bash
docker system df
docker system df -v
```
**Solutions:**
```bash
# Clean unused resources
docker system prune -a --volumes
```
### Build Cache Issues
**Solutions:**
```bash
docker compose build --no-cache
docker builder prune -a
```
## Debugging Commands
```bash
# Shell into running container
docker compose exec app sh
# Shell into failed container
docker compose run --entrypoint sh app
# View resource usage
docker stats
# View container processes
docker compose top
# View real-time events
docker events
# Copy files from container
docker compose cp app:/app/logs ./logs
```
## Quick Diagnostic Checklist
1. **Check if container is running:** `docker compose ps`
2. **Check logs:** `docker compose logs servicename`
3. **Check network:** `docker network ls`
4. **Check volumes:** `docker volume ls`
5. **Check resources:** `docker stats`
6. **Validate config:** `docker compose config`
7. **Check disk space:** `docker system df`
## Error Messages Reference
| Error | Cause | Solution |
|-------|-------|----------|
| "port is already allocated" | Port in use | Kill process or change port |
| "network not found" | Missing network | Create network or check name |
| "volume not found" | Missing volume | Create volume or check name |
| "no such service" | Service name typo | Check compose.yaml |
| "unauthorized" | Auth issue | `docker login` |
| "image not found" | Missing image | `docker compose pull` |
| "permission denied" | File permissions | Fix ownership/permissions |
| "out of memory" | Memory limit | Increase limit or optimize app |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.