March 23, 2026
Docker Swarm Auto-healing: A Guide to Troubleshooting 'Pending' States
Ever seen your services stuck in limbo? We deep-dive into Swarm’s auto-healing mechanisms and show you how to resolve common resource constraints and network label issues fast.

It’s 3:00 AM. Your monitoring alert pings. You open your Swarm cluster dashboard and see the dreaded status: Pending.
In Docker Swarm, a Pending task means the scheduler has accepted the desired state but cannot find a suitable node to run the task. Unlike crashes or errors that appear in logs, Pending is a silent scheduling limbo. Swarm’s built-in auto-healing wants to reconcile the cluster, but something is blocking it.
In 2026, with resource-hungry AI workloads, multi-arch edge clusters, and high-density Raspberry Pi deployments, Pending states have become more common. The good news? Most are fixable quickly once you know where to look - especially with SwarmCLI, the k9s-style TUI that surfaces scheduler decisions in real time.
This comprehensive guide covers the root causes, diagnostic workflows, and prevention strategies so you can keep your Swarm healthy and self-healing.
Understanding Swarm Auto-Healing and the Pending State
Docker Swarm’s orchestrator continuously reconciles the actual state with the desired state defined in your services and stacks. When a task fails or a node becomes unavailable, Swarm automatically attempts to reschedule it - this is the core of its auto-healing.
A task enters Pending when the scheduler cannot assign it to any node that meets all requirements (resources, labels, networks, volumes, etc.). The scheduler is conservative: it would rather wait than place a task in a way that might destabilize the cluster.
Common triggers in 2026:
- Tight resource reservations on memory-constrained edge nodes.
- Overly specific placement constraints.
- Overlay network or volume synchronization delays.
- Node drain/maintenance states.
1. Resource Exhaustion - The #1 Culprit
The most frequent cause of Pending tasks is mismatched resource reservations and limits.
Example Scenario
You deploy a service with:
deploy:
resources:
reservations:
cpus: '2.0'
memory: 4G
limits:
cpus: '3.5'
memory: 6G
On a 3-node Raspberry Pi 5 cluster where each node has only ~5–6GB available after system overhead, Swarm cannot place new replicas.
Diagnosis
Native Docker Commands:
docker service ps --no-trunc <service_name>
docker service inspect --pretty <service_name>
Look for the Error column: no suitable node (insufficient resources) or similar.
SwarmCLI - Instant Visibility:
Launch swarmcli on your laptop or manager node. In the services view (:service), pending tasks are highlighted with exact resource shortfall details. Switch to the nodes view (:node) to see real-time CPU/memory/disk usage across the entire cluster. SwarmCLI aggregates this data without the overhead of Prometheus.
Fixes:
- Scale down replicas or adjust reservations.
- Add more nodes or upgrade hardware.
- Use
docker service update --reserve-memory 2G <service>to relax constraints dynamically.
2. Placement Constraints & Node Labels (The "VIP" Problem)
Constraints are powerful for edge setups (e.g., GPU-only nodes, camera-attached Pis, or storage-specific placement), but misconfigurations create impossible scheduling puzzles.
Common Issues
- Forgetting to apply labels to new nodes.
- Typos in constraints (
node.labels.storage == ssdvs actual labelstorage=ssd). - Mixing global and replicated services with conflicting constraints.
Diagnosis & Resolution
docker node ls
docker node inspect <node-id> | grep -A 20 Labels
In SwarmCLI, select a node and press i (or equivalent detail view) to inspect labels instantly. The TUI also shows which services cannot be scheduled and why.
Fix:
docker node update --label-add storage=ssd pi-worker-02
docker service update --constraint-add "node.labels.storage == ssd" <service>
For temporary overrides, use placement preferences instead of hard constraints.
3. Network & Volume Mismatches
Overlay Network Issues
Swarm overlay networks must be present and healthy on every node. In multi-manager or edge setups with flaky connectivity, synchronization can lag.
Diagnosis:
docker network ls --filter driver=overlay
docker service ps <service> -f "desired-state=running"
SwarmCLI Advantage: The network view (:network) shows attachment status per node and highlights mismatches immediately.
Fix: Recreate the network if corrupted:
docker network rm <network>
docker network create --driver overlay --opt encrypted my-net
Volume Problems
Named volumes or bind mounts that exist only on specific nodes cause Pending states in replicated services.
Best Practice: Use Swarm-aware storage (e.g., lightweight NFS, or Ceph/Rook for larger clusters) or ensure volumes are created on all nodes via init containers or startup scripts.
4. Additional Common Causes in 2026 Swarm Clusters
Node Availability & Drain Mode
A node in Drain availability will never accept new tasks.
docker node ls
docker node update --availability active <node>
SwarmCLI’s node list shows availability status with color coding.
Port Conflicts
Published ports that are already in use on target nodes.
Image Pull Failures on ARM/multi-arch
Ensure images have proper multi-arch manifests. Use docker manifest inspect or pin to linux/arm64 variants.
Raft Quorum & Manager Issues
With only one manager, any failure halts scheduling. Always maintain 3 or 5 managers in production.
Pro Debugging Workflow with SwarmCLI (2026)
- Launch
swarmcli. - Go to
:stackor:serviceview - pending services are flagged. - Drill into a task → see the exact scheduler message (resource, constraint, network, etc.).
- Switch to
:nodefor capacity overview. - Use built-in actions (scale, update, logs) without leaving the TUI.
- For Business Edition users: exec into tasks, reveal secrets, and apply RBAC policies directly.
SwarmCLI turns hours of docker inspect JSON spelunking into minutes of intuitive navigation.
Prevention Best Practices for Healthy Auto-Healing
- Resource Discipline: Always set conservative reservations. Monitor with SwarmCLI’s system panel.
- Label Strategy: Maintain a consistent labeling convention (e.g.,
edge-role,hardware-type,zone). - Stack Validation: Test stacks locally or in CI before production deployment.
- Monitoring: Integrate SwarmCLI with simple alerting (e.g., watch for Pending tasks > 30s).
- Regular Health Checks:
Terminal
docker node ls docker service ls docker stack ps <stack> - Business Edition Features: Use the RBAC proxy and advanced secret management to reduce configuration drift.
Real-World Edge Cluster Example (Raspberry Pi 5)
In a 3-node Pi Swarm running local AI services, Pending tasks often appear when deploying larger models (e.g., 7B parameter LLMs). By using SwarmCLI’s node view, you can quickly identify which Pi is thermally throttling or low on memory and adjust placement constraints on the fly.
Summary: Turn Pending into Productive
Docker Swarm’s auto-healing is powerful but requires a clear path for the scheduler. By mastering resource planning, constraints, networking, and using SwarmCLI for real-time visibility, you can resolve 95% of Pending issues in under 5 minutes.
Don’t let scheduling ghosts haunt your cluster. Equip yourself with the right tools and practices for reliable Swarm operations in 2026 and beyond.
Next Steps:
- Install SwarmCLI today:
brew install eldaratech/tap/swarmclior download from GitHub. - Star the repo and try the Business Edition for advanced troubleshooting features.
- Share your toughest Pending scenarios in the comments or GitHub discussions.
Happy Swarming - may your tasks always find a home!