Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drone 0.8: build stuck in pending state

Installed Drone 0.8 on virtual machine with the following Docker Compose file:

version: '2'

services:
  drone-server:
    image: drone/drone:0.8
    ports:
      - 8080:8000
      - 9000:9000
    volumes:
      - /var/lib/drone:/var/lib/drone/
    restart: always
    environment:
      - DATABASE_DRIVER=sqlite3
      - DATABASE_CONFIG=/var/lib/drone/drone.sqlite
      - DRONE_OPEN=true
      - DRONE_ORGS=my-github-org
      - DRONE_ADMIN=my-github-user
      - DRONE_HOST=${DRONE_HOST}
      - DRONE_GITHUB=true
      - DRONE_GITHUB_CLIENT=${DRONE_GITHUB_CLIENT}
      - DRONE_GITHUB_SECRET=${DRONE_GITHUB_SECRET}
      - DRONE_SECRET=${DRONE_SECRET}
      - GIN_MODE=release

  drone-agent:
    image: drone/agent:0.8
    restart: always
    depends_on: [ drone-server ]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DRONE_SERVER=drone-server:9000
      - DRONE_SECRET=${DRONE_SECRET}

All variable values are stored in .env file and are correctly passed to running containers. Trying to run a build using private Github repository. When pushing to repository for the first time build starts and fails with the following error (i.e. build fails): first-run Then after clicking on Restart button seeing another screen (i.e. build is pending): second-run

Having the following containers running on the same machine:

root@ci:~# docker ps -a
CONTAINER ID        IMAGE               COMMAND               CREATED             STATUS              PORTS                                                             NAMES
94e6a266e09d        drone/agent:0.8     "/bin/drone-agent"    2 hours ago         Up 2 hours                                                                            root_drone-agent_1
7c7d9f93a532        drone/drone:0.8     "/bin/drone-server"   2 hours ago         Up 2 hours          80/tcp, 443/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:8080->8000/tcp   root_drone-server_1

Even with DRONE_DEBUG=true the only log entry in agent log is:

2017/09/10 15:11:54 pipeline: request next execution

So I think for some reason my agent does not get the build from the queue. I noticed that latest Drone versions are using GRPC instead of WebSockets.

So how to get the build started? What I am missing here?

like image 556
vania-pooh Avatar asked Sep 10 '17 17:09

vania-pooh


People also ask

What is drone CI?

Automate Software Build and Testing. Drone is a self-service Continuous Integration platform for busy development teams.

What is drone runner?

Drone runners poll the server for workloads to execute. There are different types of runners optimized for different use cases and runtime environments. You can install one or many runners, of one or many types.

What is drone Yml?

The . drone. yml file is used to define your pipeline steps. It is a superset of the widely used docker-compose file format. Example pipeline configuration: pipeline: build: image: golang commands: - go get - go build - go test services: postgres: image: postgres:9.4.5 environment: - POSTGRES_USER=myapp.


1 Answers

The reason of the issue - wrong .drone.yml file. Only the first red screen should be shown in that case. Showing pending and Restart button for incorrect YAML is a Drone issue.

like image 188
vania-pooh Avatar answered Sep 25 '22 21:09

vania-pooh