name: agent-troubleshooting description: Troubleshoots Buildkite agent issues including jobs stuck waiting for agents, agent connectivity problems, and queue configuration. Use when jobs aren't being picked up or there are agent-related problems.
Agent Troubleshooting
You are helping troubleshoot Buildkite agent issues - jobs not being picked up, agent connectivity, or queue configuration problems.
Approach
-
Understand the Symptom
- Jobs stuck in "scheduled" state = no agent picking them up
- Jobs stuck in "assigned" state = agent accepted but not starting
- Jobs failing immediately = agent issue or configuration problem
-
Check Cluster and Queue Configuration
- Use
buildkite_list_clustersto see available clusters - Use
buildkite_list_cluster_queuesto see queues in each cluster - Compare job's required queue/tags with available queues
- Use
-
Analyze Job Agent Requirements
- Use
buildkite_get_buildto see job details - Check the
agent_query_rulesor agent tags required by the job - Look for queue targeting:
queue=deploy,queue=default
- Use
-
Check for Common Issues
Jobs Not Being Picked Up
Queue Mismatch
- Job requires
queue=specialbut no agents are in that queue - Check pipeline YAML for
agents:configuration - Verify queue exists with
buildkite_list_cluster_queues
Tag Mismatch
- Job requires specific tags like
docker=trueoros=linux - No agents match ALL required tags (tags are AND-ed)
- Check what tags are configured on available agents
No Agents Running
- Queue exists but no agents are connected
- Check Buildkite Agents page or use cluster APIs
- Verify agent is running and can reach Buildkite
Agent Concurrency Exhausted
- Agents exist but are all busy
- Check
spawnsetting on agents - Consider scaling up or adjusting parallelism
Agent Connectivity Issues
Agent Disconnecting
- Network instability between agent and Buildkite
- Agent process crashing or being killed
- Resource exhaustion on agent host (memory, disk)
Agent Not Starting Jobs
- Agent hooks failing (environment, pre-command)
- Plugin installation failures
- File system permissions
Configuration Issues
Pipeline Agent Rules
# Global agent rules (apply to all steps)
agents:
queue: "deploy"
# Per-step agent rules
steps:
- command: "deploy.sh"
agents:
queue: "deploy"
cloud: "aws"
Agent Tag Format
- Tags are key=value or just key (boolean)
- Multiple tags are AND conditions
- Use
*wildcard for partial matching:instance-type=m5.*
Diagnostic Steps
-
List available queues
Use buildkite_list_cluster_queues to see all queues -
Check queue details
Use buildkite_get_cluster_queue for specific queue stats -
Compare with job requirements
- Get the build details
- Look at failed/waiting job's agent configuration
- Match against available queues
Response Format
- Issue Identified: What's preventing job execution
- Agent Configuration: What the job requires vs what's available
- Root Cause: Specific mismatch or problem
-
Resolution: Steps to fix
- Immediate: How to get this build working
- Long-term: How to prevent recurrence
Common Resolutions
- Wrong queue: Update pipeline YAML or add agents to queue
- Missing tags: Add tags to agents or remove requirement from job
- No agents: Start agents or check agent host health
- All agents busy: Scale up agents or reduce parallelism
- Agent crashing: Check agent logs, hooks, and host resources
Important Notes
- Agent issues often manifest as jobs stuck in "scheduled" state
- Always verify the queue/tags in the pipeline match available agents
- Consider that dynamic pipelines might change agent requirements
- Cluster configuration affects which queues are available
chat Comments (0)
Sign in to join the discussion and leave a comment.
Skill Details
GitHub Stars
0
GitHub Forks
0
Created
Jan 2026
Last Updated
6 months ago
tools
tools cicd
Related Skills
Build your own?
Join 12,000+ developers contributing to the Claude ecosystem.
No comments yet. Be the first to share your thoughts!