Builds are not being triggered

I’m using open source edition of drone.

docker-compose.yml:

version: '2'

services:
  drone-server:
    image: drone/drone:0.5
    ports:
     - 80:8000
    volumes:
     - ./drone:/var/lib/drone/
    restart: always
    environment:
     - DRONE_OPEN=true
     - DRONE_ADMIN=khataev
     - DRONE_GITHUB_CLIENT=github-client-string
     - DRONE_GITHUB_SECRET=github-secret-string
     - DRONE_SECRET=drone-secret-string

  drone-agent:
    image: drone/drone:0.5
    command: agent
    restart: always
    depends_on: [ drone-server ]
    volumes:
     - /var/run/docker.sock:/var/run/docker.sock
    environment:
     - DRONE_SERVER=ws://drone-server:8000/ws/broker
     - DRONE_SECRET=drone-secret-string

Application is registered and authorized on Github and secret/client strings are provided.

I placed .drone.yml file into my project repository:

pipeline:
  build:
    image: rails-qna
    commands: 
      - bundle exec rake db:drop
      - bundle exec rake db:create
      - bundle exec rake db:migrate
      - bundle exec rspec

Screenshots of project settings and builds status

  1. What I’ve missed, why build is not triggering by commit to repo?
  2. How to trigger build manually?
  3. What is Timeout in project settings?

Thanks in advance!

What I’ve missed, why build is not triggering by commit to repo?

Can you confirm GitHub is able to send hook to Drone? You can look at your repository settings in GitHub to see a history of hooks being sent and if there were successful. The common reason for builds not being triggered is when GitHub is unable to post hooks to your Drone instance due to running Drone behind a firewall or using localhost as your Drone address (GitHub cannot post a hook for localhost for obvious reasons)

How to trigger build manually?

You cannot. Builds are only triggered by hooks

What is Timeout in project settings?

It is the time limit for a build. The running build will be cancelled if the timeout is exceeded. For example, if the timeout is 60 minutes, a build cannot run for more than 60 minutes or it will be cancelled.

1 Like

You was right! It was webhooks issue. I think it worth to mention this in documentation, because it is not obvious for one who is doing such job first time :wink:

I have now two questions:

  1. First build attempts showed me error: Image not found, but then after several retries it disappeared and built process was initiated. I will investigate this situation in future as you advice looking docker daemon logs. But what is interesting - image, specified in .drone.yml is being searched in docker repository or locally?

    pipeline:
    build:
    image: rails-qna
    [skipped]

For now I have it only locally (but in future I plan to register it within docker hub)
‘docker images’ output:
REPOSITORY TAG IMAGE ID CREATED SIZE
rails-qna latest 84e34a10b52c 2 days ago 1.23 GB

  1. How could I connect inside running drone-server container to explore its contents? For example for extended logs. I’m trying
    sudo docker exec -it 971b08b26f67 /bin/bash
    or even
    sudo docker exec -it 971b08b26f67 echo 123
    and get
    rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: “/bin/bash”: stat /bin/bash: no such file or directory"
    rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused “exec: “echo”: executable file not found in $PATH”

  2. sometimes I can see such error in output:
    drone-server_1 | 1:M 07 Mar 11:35:39.316 * stomp client: subscription not found: 4
    What does it mean?

there is nothing inside the drone-server image, only the drone binary at /drone

First build attempts showed me error: Image not found

an image not found means the image does not exist locally, and cannot be downloaded from the docker registry. This error comes from Docker, not from Drone. So if you are getting this error, it means that Docker cannot find the image.

If you have further questions regarding image not found errors you will need to discuss with the Docker community / support team.

1 Like