Nothing happens when I push code


#1

When you push code to your repository (in GitHub) the expected behavior is that your build pipeline will execute. This guide will help you troubleshoot the scenario where you push code and nothing happens in Drone.

First you should enable debug mode by setting the DRONE_LOGS_DEBUG=true environment variable and passing this to your Drone server.

Did your version control system trigger the webhook?

When you push code to your source code management system (e.g. GitHub) it will send a webhook to Drone. Navigate to your webhook settings and verify the webhook address is correct. Also check your repository webhook history to confirm successful delivery.

The most common root cause for failed delivery are:

  • You are running Drone with a localhost address. GitHub cannot post a webhook to a local address
  • You are running Drone with a private address behind a firewall. GitHub cannot post a webhook to a private address.
  • You are running Drone with a self-signed SSL certificate. You will need to disable SSL verification in the GitHub webhook settings
  • You did not configure the correct DRONE_SERVER_HOST or DRONE_SERVER_PROTO which caused Drone to set an incorrect webhook address.

Did Drone receive the webhook?

If Drone receives and parses the webhook from the source code management system (e.g. GitHub) it will write a message to the logs indicating the webhook was parsed successfully. It will also write additional metadata to the logs, including the repository and ref.

{
  "commit": "16cf589c156e3274125710a971f89fb53d881bf0",
  "event": "push",
  "level": "debug",
  "msg": "webhook parsed",
  "name": "drone-test-go",
  "namespace": "bradrydzewski",
  "time": "2019-01-10T11:42:30-08:00"
}
{
  "commit": "16cf589c156e3274125710a971f89fb53d881bf0",
  "event": "push",
  "level": "debug",
  "msg": "trigger: received",
  "ref": "refs/heads/master",
  "repo": "bradrydzewski/drone-test-go",
  "time": "2019-01-10T11:42:30-08:00"
}

Did Drone ignore the webhook or skip the build?

If Drone skips your build it will always write the skip reason to the logs. In the below example we see the build was skipped due to the [CI SKIP] directive being found in the commit message.

{
  "commit": "042bc1df43d9e9d195be53a50bef741e9702c0d6",
  "event": "push",
  "level": "info",
  "msg": "trigger: skipping hook. found skip directive",
  "ref": "refs/heads/master",
  "repo": "bradrydzewski/drone-test-go",
  "time": "2019-01-10T11:39:26-08:00"
}

Do you see an entry for your build in the user interface, but it is stuck in Pending?

This may indicate that your agents are not properly configured or are unable to reach the Drone server to fetch jobs. We will post a separate tutorial to triage this category of issue.