# Agent in status Pending all time

**URL:** <https://drone.discourse.group/t/agent-in-status-pending-all-time/4381>\
**Category:** Drone Support\
**Created:** [February 13, 2019, 6:49am UTC](https://drone.discourse.group/t/agent-in-status-pending-all-time/4381 "2019-02-13T06:49:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilful](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/wilful/32/5426_2.png) [@wilful](https://drone.discourse.group/u/wilful)\
**Post date:** [February 13, 2019, 6:49am UTC](https://drone.discourse.group/t/agent-in-status-pending-all-time/4381/1 "2019-02-13T06:49:45Z")

</div>

On my test bench, Drone cannot reach the Agent, Build is constantly in Pending status.

docker-compose.yaml:

```
version: "3"
networks:
    drone:
services:
  drone:
    image: drone/drone:1.0.0-rc.5
    container_name: drone
    ports:
        - 80:80
        - 443:443
    volumes:
        - /var/lib/drone:/data
    environment:
        - DRONE_GIT_ALWAYS_AUTH=false
        - DRONE_GITEA_SERVER=${DRONE_GITEA_SERVER}
        - DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
        - DRONE_SERVER_HOST=${DRONE_SERVER_HOST}
        - DRONE_SERVER_PROTO=${DRONE_SERVER_PROTO}
        - DRONE_TLS_AUTOCERT=false
        - DRONE_LOGS_DEBUG=true
    networks:
        - drone
        
  agent:
    image: drone/agent:1.0.0-rc.5
    container_name: agent
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock
    environment:
        - DRONE_RPC_SERVER=${DRONE_RPC_SERVER}
        - DRONE_RPC_SECRET=${DRONE_RPC_SECRET}
        - DRONE_RUNNER_CAPACITY=2
        - DRONE_RUNNER_NAME=agent
        - DRONE_LOGS_DEBUG=true
    networks:
        - drone

```

.drone.yml

```
kind: pipeline
name: default

platform:
    os: linux
    arch: amd64

steps:
    - name: run-hello-world
      image: alpine
      commands:
          - echo Test

node:
    instance: agent
```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [February 13, 2019, 7:14am UTC](https://drone.discourse.group/t/agent-in-status-pending-all-time/4381/2 "2019-02-13T07:14:03Z")

</div>

the problem is with the yaml syntax. The `node` block in your yaml instructs drone to only execute the pipeline on agents with `DRONE_RUNNER_LABELS=instance=agent`, however, this variable is never being set which means the build will always be pending. Just remove this block and it should work.

```diff
-node:
- instance: agent

```

Also, if you are using docker-compose and running Drone on a single machine, you should just use the single-machine install instructions. You do not need agents when running drone on a single machine. See [https://docs.drone.io/installation/gitea/](https://docs.drone.io/installation/gitea/)

---

<div class="post-metadata">

**Author:** ![wilful](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/wilful/32/5426_2.png) [@wilful](https://drone.discourse.group/u/wilful)\
**Post date:** [February 13, 2019, 7:21am UTC](https://drone.discourse.group/t/agent-in-status-pending-all-time/4381/3 "2019-02-13T07:21:26Z")

</div>

This is a test bench, then the agent will be launched on the build server. How do I specify in the Pipeline agent on which I need to run build? I took an example from the documentation

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [February 13, 2019, 7:22am UTC](https://drone.discourse.group/t/agent-in-status-pending-all-time/4381/4 "2019-02-13T07:22:27Z")

</div>

[https://docs.drone.io/reference/agent/drone-runner-labels/](https://docs.drone.io/reference/agent/drone-runner-labels/)

---

<div class="post-metadata">

**Author:** ![wilful](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/wilful/32/5426_2.png) [@wilful](https://drone.discourse.group/u/wilful)\
**Post date:** [February 13, 2019, 7:26am UTC](https://drone.discourse.group/t/agent-in-status-pending-all-time/4381/5 "2019-02-13T07:26:36Z")

</div>

Agent service changes:

```
    - DRONE_RUNNER_LABELS=instance:agent

```

Did not help.
