# Jenkins: Still waiting to schedule task — Waiting for next available executor / 'agent1' is offline

**Code:** `Waiting for next available executor` · **Category:** CI/CD · **Seen on:** Jenkins

A Jenkins build is queued because no executor with the required label is free or the agent is offline.

## Meaning

Check Manage Jenkins → Nodes. An agent may be offline (disk space, network, SSH/JNLP failure), have all executors busy, or not match the label in `agent { label 'x' }`. The queue message explains which. Bring the agent online or fix the label.

## Common causes

- Agent offline (crashed, network, disk space low, credentials)
- Label in the Jenkinsfile matches no node
- All executors busy
- Node marked temporarily offline by a health check (low disk or swap)
- Cloud agents not provisioning

## Quick fix

1. Open Manage Jenkins → Nodes and relaunch the agent
2. Check the label spelling in `agent { label '…' }`
3. Free disk space or raise executor count

## Detailed fix by platform

### Jenkins

1. Hover the queue item for "because" text; node log is under Nodes → agent → Log

## Code examples

### Pin a label

```groovy
pipeline {
  agent { label 'linux && docker' }
  stages { stage('Build') { steps { sh 'make' } } }
}
```

## How to diagnose

1. **Node** — Online?
2. **Label** — Matches a node?
3. **Capacity** — Executors free?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cicd/jenkins-agent-offline-waiting-for-executor)
