Build not running on tag

Hello!

I’ve been using drone internally at my company for several months and am starting to migrate my open source projects to cloud.drone.io

I’m having a problem with my build not running on tag events.

It looks like webhooks is being rejected, but not for a reason that makes sense.

Please let me know if there is something more I need to adjust for this to start working.

Thanks in advance for all your help!

-Andy

.drone.yml

clone:
  git:
    image: plugins/git

pipeline:
  install:
    image: node:6
    commands:
      - npm i
  node6:
    group: test
    image: node:6
    commands:
    - npm test
  node7:
    group: test
    image: node:7
    commands:
    - npm test
  node8:
    group: test
    image: node:8
    commands:
    - npm test
  node9:
    group: test
    image: node:9
    commands:
    - npm test
  node10:
    group: test
    image: node:10
    commands:
    - npm test
  node11:
    group: test
    image: node:11
    commands:
    - npm test
  publish:
    image: node:10
    commands:
      - echo "//registry.npmjs.org/:_authToken=$${NPM_DEPLOY_TOKEN}" > ~/.npmrc
      - echo "unsafe-perm=true" >> ~/.npmrc
      - npm publish
    secrets:
      - npm_deploy_token
    when:
      event: tag
      branch:
        - include: [ v* ]

Here’s the webhook post that was sent:

Headers:

Request URL: https://cloud.drone.io/hook
Request method: POST
content-type: application/json
Expect: 
User-Agent: GitHub-Hookshot/60c6631
X-GitHub-Delivery: e57d7ca0-1025-11e9-86a1-c3b717587c46
X-GitHub-Event: push
X-Hub-Signature: sha1=c48ba070c49bbdfa7c2d96172af0c78b559911d1

Body:

{
  "ref": "refs/tags/v0.2.1",
  "before": "0000000000000000000000000000000000000000",
  "after": "744113f178862a1081ae0184f481e061d92375ba",
  "created": true,
  "deleted": false,
  "forced": false,
  "base_ref": null,
  "compare": "https://github.com/terodox/argument-contracts/compare/v0.2.1",
  "commits": [

  ],
  "head_commit": {
    "id": "26534ce320872692a7311d8b359dc0b9c8a59da1",
    "tree_id": "a1b2706cb19ff7e110b1fdd469f606c1c0c1ea59",
    "distinct": true,
    "message": "0.2.1",
    "timestamp": "2019-01-04T08:37:32-05:00",
    "url": "https://github.com/terodox/argument-contracts/commit/26534ce320872692a7311d8b359dc0b9c8a59da1",
    "author": {
      "name": "terodox",
      "email": "terodox@gmail.com",
      "username": "terodox"
    },
    "committer": {
      "name": "terodox",
      "email": "terodox@gmail.com",
      "username": "terodox"
    },
    "added": [

    ],
    "removed": [

    ],
    "modified": [
      "package-lock.json",
      "package.json"
    ]
  },
  "repository": {
    "id": 129319292,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMjkzMTkyOTI=",
    "name": "argument-contracts",
    "full_name": "terodox/argument-contracts",
    "private": false,
    "owner": {
      "name": "terodox",
      "email": "andy.desmarais@meltwater.com",
      "login": "terodox",
      "id": 4835893,
      "node_id": "MDQ6VXNlcjQ4MzU4OTM=",
      "avatar_url": "https://avatars3.githubusercontent.com/u/4835893?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/terodox",
      "html_url": "https://github.com/terodox",
      "followers_url": "https://api.github.com/users/terodox/followers",
      "following_url": "https://api.github.com/users/terodox/following{/other_user}",
      "gists_url": "https://api.github.com/users/terodox/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/terodox/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/terodox/subscriptions",
      "organizations_url": "https://api.github.com/users/terodox/orgs",
      "repos_url": "https://api.github.com/users/terodox/repos",
      "events_url": "https://api.github.com/users/terodox/events{/privacy}",
      "received_events_url": "https://api.github.com/users/terodox/received_events",
      "type": "User",
      "site_admin": false
    },
    "html_url": "https://github.com/terodox/argument-contracts",
    "description": "A small and simple library for asserting argument are the correct types",
    "fork": false,
    "url": "https://github.com/terodox/argument-contracts",
    "forks_url": "https://api.github.com/repos/terodox/argument-contracts/forks",
    "keys_url": "https://api.github.com/repos/terodox/argument-contracts/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/terodox/argument-contracts/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/terodox/argument-contracts/teams",
    "hooks_url": "https://api.github.com/repos/terodox/argument-contracts/hooks",
    "issue_events_url": "https://api.github.com/repos/terodox/argument-contracts/issues/events{/number}",
    "events_url": "https://api.github.com/repos/terodox/argument-contracts/events",
    "assignees_url": "https://api.github.com/repos/terodox/argument-contracts/assignees{/user}",
    "branches_url": "https://api.github.com/repos/terodox/argument-contracts/branches{/branch}",
    "tags_url": "https://api.github.com/repos/terodox/argument-contracts/tags",
    "blobs_url": "https://api.github.com/repos/terodox/argument-contracts/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/terodox/argument-contracts/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/terodox/argument-contracts/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/terodox/argument-contracts/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/terodox/argument-contracts/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/terodox/argument-contracts/languages",
    "stargazers_url": "https://api.github.com/repos/terodox/argument-contracts/stargazers",
    "contributors_url": "https://api.github.com/repos/terodox/argument-contracts/contributors",
    "subscribers_url": "https://api.github.com/repos/terodox/argument-contracts/subscribers",
    "subscription_url": "https://api.github.com/repos/terodox/argument-contracts/subscription",
    "commits_url": "https://api.github.com/repos/terodox/argument-contracts/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/terodox/argument-contracts/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/terodox/argument-contracts/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/terodox/argument-contracts/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/terodox/argument-contracts/contents/{+path}",
    "compare_url": "https://api.github.com/repos/terodox/argument-contracts/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/terodox/argument-contracts/merges",
    "archive_url": "https://api.github.com/repos/terodox/argument-contracts/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/terodox/argument-contracts/downloads",
    "issues_url": "https://api.github.com/repos/terodox/argument-contracts/issues{/number}",
    "pulls_url": "https://api.github.com/repos/terodox/argument-contracts/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/terodox/argument-contracts/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/terodox/argument-contracts/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/terodox/argument-contracts/labels{/name}",
    "releases_url": "https://api.github.com/repos/terodox/argument-contracts/releases{/id}",
    "deployments_url": "https://api.github.com/repos/terodox/argument-contracts/deployments",
    "created_at": 1523573310,
    "updated_at": "2019-01-04T13:35:20Z",
    "pushed_at": 1546609055,
    "git_url": "git://github.com/terodox/argument-contracts.git",
    "ssh_url": "git@github.com:terodox/argument-contracts.git",
    "clone_url": "https://github.com/terodox/argument-contracts.git",
    "svn_url": "https://github.com/terodox/argument-contracts",
    "homepage": null,
    "size": 257,
    "stargazers_count": 0,
    "watchers_count": 0,
    "language": "JavaScript",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": true,
    "has_pages": false,
    "forks_count": 0,
    "mirror_url": null,
    "archived": false,
    "open_issues_count": 0,
    "license": null,
    "forks": 0,
    "open_issues": 0,
    "watchers": 0,
    "default_branch": "master",
    "stargazers": 0,
    "master_branch": "master"
  },
  "pusher": {
    "name": "terodox",
    "email": "[Redacted]"
  },
  "sender": {
    "login": "terodox",
    "id": 4835893,
    "node_id": "MDQ6VXNlcjQ4MzU4OTM=",
    "avatar_url": "https://avatars3.githubusercontent.com/u/4835893?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/terodox",
    "html_url": "https://github.com/terodox",
    "followers_url": "https://api.github.com/users/terodox/followers",
    "following_url": "https://api.github.com/users/terodox/following{/other_user}",
    "gists_url": "https://api.github.com/users/terodox/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/terodox/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/terodox/subscriptions",
    "organizations_url": "https://api.github.com/users/terodox/orgs",
    "repos_url": "https://api.github.com/users/terodox/repos",
    "events_url": "https://api.github.com/users/terodox/events{/privacy}",
    "received_events_url": "https://api.github.com/users/terodox/received_events",
    "type": "User",
    "site_admin": false
  }
}

Here’s the response:

HTTP Status Code

500

Headers:

Cache-Control: no-cache, no-store, must-revalidate, private, max-age=0
Content-Length: 83
Content-Type: application/json
Date: Fri, 04 Jan 2019 13:39:26 GMT
Expires: Thu, 01 Jan 1970 00:00:00 UTC
Pragma: no-cache
Strict-Transport-Security: max-age=315360000
X-Accel-Expires: 0
X-Frame-Options: DENY
X-Xss-Protection: 1; mode=block

Body:

{"message":"No commit found for the ref 744113f178862a1081ae0184f481e061d92375ba"}

I am successfully processing builds for tag events:
https://cloud.drone.io/drone/go-scm/2

Have you tried to re-run the build or re-send the webhook? Have you seen this issue with other tag events, or was this just a one-time occurance?

The reason I ask is because this error message comes from the GitHub API. Drone is making an API request (not sure exactly which API call at the moment) but GitHub is returning an error saying that commit 744113f178862a1081ae0184f481e061d92375ba does not exist. I am not sure why GitHub would return this error since the sha is defined in the payload. Maybe it makes sense to open a support request with GitHub to have them investigate the API failure?

@bradrydzewski thank you for your reply!

I attempted to resend the hook several time over about a 30 minute period. I just attempted it again with the same result.

It looks like it’s sending the request to https://cloud.drone.io/hook

The response is referencing the after property from the body of the webhook which is very odd because the commit is available in the head_commit.id property.

I’m attempting another tag right now just to be 100% sure it wasn’t a one off.

The same style request/response combination was received including referencing the after property in the error message as the ref for the tag.

I’m baffled because my setup is REALLY simple.

Any other thoughts?

-Andy

@bradrydzewski If you feel comfortable with it, could you post some request/response data for a successful tag webhook?

This will help me as I open an issue with github.

Thanks!

It looks like the API call to get the Yaml file for the commit sha is failing:

{
  "commit": "f64b9385ec549d5a6b489c3ceaa4ca23a8624eed",
  "error": "No commit found for the ref f64b9385ec549d5a6b489c3ceaa4ca23a8624eed",
  "event": "tag",
  "level": "warning",
  "msg": "trigger: cannot find yaml",
  "ref": "refs\/tags\/v0.2.2",
  "repo": "terodox\/argument-contracts",
  "time": "2019-01-04T15:58:06Z"
}

You can reproduce the problem with this API call:
https://api.github.com/repos/terodox/argument-contracts/contents/.drone.yml?ref=f64b9385ec549d5a6b489c3ceaa4ca23a8624eed

Here is an example of the same API call working for another tag:
https://api.github.com/repos/drone/go-scm/contents/.drone.yml?ref=71422db06f405c9944601b78c96a6a9f5c652480

Pretty strange, right?

Ok, I understand now what the api is hung up on. However, it doesn’t seem to make sense (of course I could be missing something obvious :-p). It’s attempting to use the value of the after property:

This isn’t the commit hash. The commit hash is in head_commit.id`:

This is why I’m so confused. It shouldn’t be trying to fetch based on 744113f178862a1081ae0184f481e061d92375ba because that’s not even a commit hash.

Any ideas why it’s looking to the after property instead of the head_commit.id?

If I hit the url you mentioned with commit hash, it returns as expected:

https://api.github.com/repos/terodox/argument-contracts/contents/.drone.yml?ref=26534ce320872692a7311d8b359dc0b9c8a59da1

This is why I’m so confused. It shouldn’t be trying to fetch based on 744113f178862a1081ae0184f481e061d92375ba because that’s not even a commit hash.

drone uses the before and after fields for all push and tag events and we haven’t seen any widepsread issues using these fields. Any ideas why your repositories’ webhook would include an invalid sha in this field when this is not an issue for other repositories? For example, https://cloud.drone.io/drone/go-scm/2 was successfully executed and the sha came from the after field in the webhook payload.

EDIT: for reference, below is the webhook payload for the successful tag that I referenced above. The sha referenced in the after field can be found at https://github.com/drone/go-scm/commit/71422db06f405c9944601b78c96a6a9f5c652480.

{
  "ref": "refs/tags/v1.0.5",
  "before": "0000000000000000000000000000000000000000",
  "after": "71422db06f405c9944601b78c96a6a9f5c652480",
  "created": true,
  "deleted": false,
  "forced": false,
  "base_ref": "refs/heads/master",
  "compare": "https://github.com/drone/go-scm/compare/v1.0.5",
  "commits": [

  ],
  "head_commit": {
    "id": "71422db06f405c9944601b78c96a6a9f5c652480",
    "tree_id": "0e36fea71b98bf7ccb87ee2ed9a971dc1834d669",
    "distinct": true,
    "message": "update yaml",
    "timestamp": "2018-12-13T13:12:00-08:00",
    "url": "https://github.com/drone/go-scm/commit/71422db06f405c9944601b78c96a6a9f5c652480",
    "author": {
      "name": "Brad Rydzewski",
      "email": "brad.rydzewski@gmail.com",
      "username": "bradrydzewski"
    },
    "committer": {
      "name": "Brad Rydzewski",
      "email": "brad.rydzewski@gmail.com",
      "username": "bradrydzewski"
    },
    "added": [

    ],
    "removed": [

    ],
    "modified": [
      ".drone.yml"
    ]
  },
  "repository": {
    "id": 113508240,
    "node_id": "MDEwOlJlcG9zaXRvcnkxMTM1MDgyNDA=",
    "name": "go-scm",
    "full_name": "drone/go-scm",
    "private": false,
    "owner": {
      "name": "drone",
      "email": "",
      "login": "drone",
      "id": 2181346,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjIxODEzNDY=",
      "avatar_url": "https://avatars1.githubusercontent.com/u/2181346?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/drone",
      "html_url": "https://github.com/drone",
      "followers_url": "https://api.github.com/users/drone/followers",
      "following_url": "https://api.github.com/users/drone/following{/other_user}",
      "gists_url": "https://api.github.com/users/drone/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/drone/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/drone/subscriptions",
      "organizations_url": "https://api.github.com/users/drone/orgs",
      "repos_url": "https://api.github.com/users/drone/repos",
      "events_url": "https://api.github.com/users/drone/events{/privacy}",
      "received_events_url": "https://api.github.com/users/drone/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "html_url": "https://github.com/drone/go-scm",
    "description": "Package scm provides a unified interface to multiple source code management systems.",
    "fork": false,
    "url": "https://github.com/drone/go-scm",
    "forks_url": "https://api.github.com/repos/drone/go-scm/forks",
    "keys_url": "https://api.github.com/repos/drone/go-scm/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/drone/go-scm/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/drone/go-scm/teams",
    "hooks_url": "https://api.github.com/repos/drone/go-scm/hooks",
    "issue_events_url": "https://api.github.com/repos/drone/go-scm/issues/events{/number}",
    "events_url": "https://api.github.com/repos/drone/go-scm/events",
    "assignees_url": "https://api.github.com/repos/drone/go-scm/assignees{/user}",
    "branches_url": "https://api.github.com/repos/drone/go-scm/branches{/branch}",
    "tags_url": "https://api.github.com/repos/drone/go-scm/tags",
    "blobs_url": "https://api.github.com/repos/drone/go-scm/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/drone/go-scm/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/drone/go-scm/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/drone/go-scm/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/drone/go-scm/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/drone/go-scm/languages",
    "stargazers_url": "https://api.github.com/repos/drone/go-scm/stargazers",
    "contributors_url": "https://api.github.com/repos/drone/go-scm/contributors",
    "subscribers_url": "https://api.github.com/repos/drone/go-scm/subscribers",
    "subscription_url": "https://api.github.com/repos/drone/go-scm/subscription",
    "commits_url": "https://api.github.com/repos/drone/go-scm/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/drone/go-scm/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/drone/go-scm/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/drone/go-scm/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/drone/go-scm/contents/{+path}",
    "compare_url": "https://api.github.com/repos/drone/go-scm/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/drone/go-scm/merges",
    "archive_url": "https://api.github.com/repos/drone/go-scm/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/drone/go-scm/downloads",
    "issues_url": "https://api.github.com/repos/drone/go-scm/issues{/number}",
    "pulls_url": "https://api.github.com/repos/drone/go-scm/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/drone/go-scm/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/drone/go-scm/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/drone/go-scm/labels{/name}",
    "releases_url": "https://api.github.com/repos/drone/go-scm/releases{/id}",
    "deployments_url": "https://api.github.com/repos/drone/go-scm/deployments",
    "created_at": 1512688689,
    "updated_at": "2018-12-13T21:12:18Z",
    "pushed_at": 1544735566,
    "git_url": "git://github.com/drone/go-scm.git",
    "ssh_url": "git@github.com:drone/go-scm.git",
    "clone_url": "https://github.com/drone/go-scm.git",
    "svn_url": "https://github.com/drone/go-scm",
    "homepage": "https://godoc.org/github.com/drone/go-scm/scm#pkg-examples",
    "size": 498,
    "stargazers_count": 23,
    "watchers_count": 23,
    "language": "Go",
    "has_issues": true,
    "has_projects": true,
    "has_downloads": true,
    "has_wiki": false,
    "has_pages": false,
    "forks_count": 7,
    "mirror_url": null,
    "archived": false,
    "open_issues_count": 2,
    "license": {
      "key": "other",
      "name": "Other",
      "spdx_id": "NOASSERTION",
      "url": null,
      "node_id": "MDc6TGljZW5zZTA="
    },
    "forks": 7,
    "open_issues": 2,
    "watchers": 23,
    "default_branch": "master",
    "stargazers": 23,
    "master_branch": "master",
    "organization": "drone"
  },
  "pusher": {
    "name": "bradrydzewski",
    "email": "brad.rydzewski@gmail.com"
  },
  "organization": {
    "login": "drone",
    "id": 2181346,
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjIxODEzNDY=",
    "url": "https://api.github.com/orgs/drone",
    "repos_url": "https://api.github.com/orgs/drone/repos",
    "events_url": "https://api.github.com/orgs/drone/events",
    "hooks_url": "https://api.github.com/orgs/drone/hooks",
    "issues_url": "https://api.github.com/orgs/drone/issues",
    "members_url": "https://api.github.com/orgs/drone/members{/member}",
    "public_members_url": "https://api.github.com/orgs/drone/public_members{/member}",
    "avatar_url": "https://avatars1.githubusercontent.com/u/2181346?v=4",
    "description": ""
  },
  "sender": {
    "login": "bradrydzewski",
    "id": 817538,
    "node_id": "MDQ6VXNlcjgxNzUzOA==",
    "avatar_url": "https://avatars1.githubusercontent.com/u/817538?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/bradrydzewski",
    "html_url": "https://github.com/bradrydzewski",
    "followers_url": "https://api.github.com/users/bradrydzewski/followers",
    "following_url": "https://api.github.com/users/bradrydzewski/following{/other_user}",
    "gists_url": "https://api.github.com/users/bradrydzewski/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/bradrydzewski/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/bradrydzewski/subscriptions",
    "organizations_url": "https://api.github.com/users/bradrydzewski/orgs",
    "repos_url": "https://api.github.com/users/bradrydzewski/repos",
    "events_url": "https://api.github.com/users/bradrydzewski/events{/privacy}",
    "received_events_url": "https://api.github.com/users/bradrydzewski/received_events",
    "type": "User",
    "site_admin": false
  }
}

I will start a dialog with Github on this and update here with the outcome of that discussion.

Thanks all the quick responses! You’ve made troubleshooting this a pleasure! I appreciate it :smile:

good luck! let me know what they say and then we’ll figure out a path forward!

Hello again @bradrydzewski !

I’ve gotten a response from Github and it appears that using the after property may not be the best path for getting the commit hash the tag is associated with.

This has been a very informational journey for me, and I appreciate you coming along for the ride.

Let me know the next steps on this, especially if there is anything I can do to help move a resolution forward.

Thanks

-Andy

Github Response below:
Hi Andrew,

Thanks for reaching out! When a tag is pushed to a repository, the PushEvent payload’s after field represents the tag’s SHA which is different from the commit that it points to. Our GitHub Developer documentation doesn’t currently note this, so I’ve reached out to my colleagues to review and publish this so others are aware!

If you’re interested in the commit that the tag points to, we recommend using the head_commit.id value:

// ... truncated for brevity
"head_commit": {
  "id": "26534ce320872692a7311d8b359dc0b9c8a59da1",

While reading over your request, I put myself in your shoes and thought - how would I programmatically access this tag based on its SHA?

We have a Git Tags API that exposes an endpoint for fetching a single tag:

Here’s an example curl request for fetching that newly created tag:

curl -v -H "Authorization: token $TOKEN" "https://api.github.com/repos/terodox/argument-contracts/git/tags/744113f178862a1081ae0184f481e061d92375ba"

You can also view this tag locally by cloning the repository, changing directory, and using cat-file :

git clone git@github.com:terodox/argument-contracts.git

cd argument-contracts

git cat-file -p 744113f178862a1081ae0184f481e061d92375ba
object 26534ce320872692a7311d8b359dc0b9c8a59da1
type commit
tag v0.2.1
tagger terodox <terodox@gmail.com> 1546609052 -0500

The object entry points to 26534ce320872692a7311d8b359dc0b9c8a59da1 , which is the commit SHA-1 value that was tagged as showcased by the payload’s head_commit.id .

We hope this helps! If you have any other follow-up questions about the GitHub API, OAuth Apps, or GitHub Apps, we recommend checking out our new GitHub API Development and Support Board:

All the best,
Francis

One other piece of information. These tag commits were created using the npm cli.

Specifically npm version patch

I’m not sure if npm does something unique with their tag commits that may cause different behavior.

Thanks for the follow-up … the GitHub support team is awesome :slight_smile:

This should be a relatively simple change on our end, especially since we have really solid code coverage for all the different payloads and event types.

I’m thinking we can just edit this block as follows:

func convertPushHook(src *pushHook) *scm.PushHook {
	return &scm.PushHook{
		Ref: src.Ref,
		Commit: scm.Commit{
-			Sha:     src.After,
+			Sha:     src.Head.ID,
			Message: src.Head.Message,
			Link:    src.Compare,
			Author: scm.Signature{

I think I can have this patched for the rc.4 release, which I expect to land end of next week.

That’s super exciting news!

What is the release cycle like for getting a change like this onto cloud.drone.io?

That’s were I’m currently experiencing my issue.

Same day as the tagged release :slight_smile:

AWESOME!

Thank you so much for working through this with me!

You have been super responsive and extremely helpful.

Thank you again!

-Andy

I’m also experiencing this issue after getting drone 1.0.0-rc.3 up and running on Kubernetes, github gets the same error back as OP described when it makes a webhook for a pull request.

Do you have an ETA on the fix ?

this is fixed in rc.4 which is now available on dockerhub

I’m still seeing the same error:

from my drone server logs:

{"commit":"22b9701045188389f0e8f656b4b8a07240b2600e","event":"push","level":"debug","msg":"webhook parsed","name":"event-sourcing-microservices-example","namespace":"paulczar","time":"2019-01-13T19:17:22Z"}
{"commit":"22b9701045188389f0e8f656b4b8a07240b2600e","event":"push","level":"debug","msg":"trigger: received","ref":"refs/heads/master","repo":"paulczar/event-sourcing-microservices-example","time":"2019-01-13T19:17:22Z"}
{"commit":"22b9701045188389f0e8f656b4b8a07240b2600e","error":"Not Found","event":"push","level":"warning","msg":"trigger: cannot find yaml","ref":"refs/heads/master","repo":"paulczar/event-sourcing-microservices-example","time":"2019-01-13T19:17:22Z"}
{"fields.time":"2019-01-13T19:17:22Z","latency":242583895,"level":"debug","method":"POST","msg":"","remote":"10.200.34.0:35169","request":"/hook","request-id":"1Fj08jZH0Gs4Ke2Ko2WjsXEdh3J","time":"2019-01-13T19:17:22Z"}

the commit id looks correct to match github. Is the “cannot find yaml” error referring to not finding .drone.yaml ?

I’m still seeing the same error:

In your logs this error is for a push event to master, and not a tag event. This particular thread was about fixing an issue where we needed to source the sha from a different field in the webhook payload for tag events.

"msg":"trigger: cannot find yaml","ref":"refs/heads/master","event":"push"

Is the “cannot find yaml” error referring to not finding .drone.yaml ?

This indicates the API call to fetch the yaml from github is returning a 404 for the given sha. I took a look at your repository and the file extension looks like it might be incorrect. It should be .drone.yml instead of .drone.yaml. I would guess this is the root cause of the error.

:man_facepalming: yes it was .yaml vs .yml. Sorry I was so excited by the matching error of this discourse thread that I thought it was the same bug.

1 Like