freeflowuniverse / publishingtools_archive

Apache License 2.0
0 stars 6 forks source link

500 when using webhooks #251

Closed Hamdy closed 3 years ago

Hamdy commented 3 years ago
<title>Error 500 at POST /webstack/github_webhooks - Missing hash key: "ref"</title>

image

Request URL: https://webstack.threefold.io:
Request method: POST
Accept: */*
content-type: application/json
User-Agent: GitHub-Hookshot/8894bec
X-GitHub-Delivery: adb806d0-2da3-11eb-93e0-cef577455103
X-GitHub-Event: ping
X-GitHub-Hook-ID: 264315102
X-GitHub-Hook-Installation-Target-ID: 315340389
X-GitHub-Hook-Installation-Target-Type: repository
X-Hub-Signature: sha1=c7964e9091dd0c19dfc882d832ec78be823ee687
X-Hub-Signature-256: sha256=aec41f375fd21da656b314544f2c92ef99b4fe5e891ef0517014ddd80d14938e

payload

{
  "zen": "Keep it logically awesome.",
  "hook_id": 264315102,
  "hook": {
    "type": "Repository",
    "id": 264315102,
    "name": "web",
    "active": true,
    "events": [
      "push"
    ],
    "config": {
      "content_type": "json",
      "insecure_ssl": "0",
      "secret": "********",
      "url": "https://webstack.threefold.io/github_webhooks"
    },
    "updated_at": "2020-11-23T15:50:58Z",
    "created_at": "2020-11-23T15:50:58Z",
    "url": "https://api.github.com/repos/threefoldtech/webstack/hooks/264315102",
    "test_url": "https://api.github.com/repos/threefoldtech/webstack/hooks/264315102/test",
    "ping_url": "https://api.github.com/repos/threefoldtech/webstack/hooks/264315102/pings",
    "last_response": {
      "code": null,
      "status": "unused",
      "message": null
    }
  },
  "repository": {
    "id": 315340389,
    "node_id": "MDEwOlJlcG9zaXRvcnkzMTUzNDAzODk=",
    "name": "webstack",
    "full_name": "threefoldtech/webstack",
    "private": false,
    "owner": {
      "login": "threefoldtech",
      "id": 41825953,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjQxODI1OTUz",
      "avatar_url": "https://avatars1.githubusercontent.com/u/41825953?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/threefoldtech",
      "html_url": "https://github.com/threefoldtech",
      "followers_url": "https://api.github.com/users/threefoldtech/followers",
      "following_url": "https://api.github.com/users/threefoldtech/following{/other_user}",
      "gists_url": "https://api.github.com/users/threefoldtech/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/threefoldtech/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/threefoldtech/subscriptions",
      "organizations_url": "https://api.github.com/users/threefoldtech/orgs",
      "repos_url": "https://api.github.com/users/threefoldtech/repos",
      "events_url": "https://api.github.com/users/threefoldtech/events{/privacy}",
      "received_events_url": "https://api.github.com/users/threefoldtech/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "html_url": "https://github.com/threefoldtech/webstack",
    "description": null,
    "fork": false,
    "url": "https://api.github.com/repos/threefoldtech/webstack",
    "forks_url": "https://api.github.com/repos/threefoldtech/webstack/forks",
    "keys_url": "https://api.github.com/repos/threefoldtech/webstack/keys{/key_id}",
    "collaborators_url": "https://api.github.com/repos/threefoldtech/webstack/collaborators{/collaborator}",
    "teams_url": "https://api.github.com/repos/threefoldtech/webstack/teams",
    "hooks_url": "https://api.github.com/repos/threefoldtech/webstack/hooks",
    "issue_events_url": "https://api.github.com/repos/threefoldtech/webstack/issues/events{/number}",
    "events_url": "https://api.github.com/repos/threefoldtech/webstack/events",
    "assignees_url": "https://api.github.com/repos/threefoldtech/webstack/assignees{/user}",
    "branches_url": "https://api.github.com/repos/threefoldtech/webstack/branches{/branch}",
    "tags_url": "https://api.github.com/repos/threefoldtech/webstack/tags",
    "blobs_url": "https://api.github.com/repos/threefoldtech/webstack/git/blobs{/sha}",
    "git_tags_url": "https://api.github.com/repos/threefoldtech/webstack/git/tags{/sha}",
    "git_refs_url": "https://api.github.com/repos/threefoldtech/webstack/git/refs{/sha}",
    "trees_url": "https://api.github.com/repos/threefoldtech/webstack/git/trees{/sha}",
    "statuses_url": "https://api.github.com/repos/threefoldtech/webstack/statuses/{sha}",
    "languages_url": "https://api.github.com/repos/threefoldtech/webstack/languages",
    "stargazers_url": "https://api.github.com/repos/threefoldtech/webstack/stargazers",
    "contributors_url": "https://api.github.com/repos/threefoldtech/webstack/contributors",
    "subscribers_url": "https://api.github.com/repos/threefoldtech/webstack/subscribers",
    "subscription_url": "https://api.github.com/repos/threefoldtech/webstack/subscription",
    "commits_url": "https://api.github.com/repos/threefoldtech/webstack/commits{/sha}",
    "git_commits_url": "https://api.github.com/repos/threefoldtech/webstack/git/commits{/sha}",
    "comments_url": "https://api.github.com/repos/threefoldtech/webstack/comments{/number}",
    "issue_comment_url": "https://api.github.com/repos/threefoldtech/webstack/issues/comments{/number}",
    "contents_url": "https://api.github.com/repos/threefoldtech/webstack/contents/{+path}",
    "compare_url": "https://api.github.com/repos/threefoldtech/webstack/compare/{base}...{head}",
    "merges_url": "https://api.github.com/repos/threefoldtech/webstack/merges",
    "archive_url": "https://api.github.com/repos/threefoldtech/webstack/{archive_format}{/ref}",
    "downloads_url": "https://api.github.com/repos/threefoldtech/webstack/downloads",
    "issues_url": "https://api.github.com/repos/threefoldtech/webstack/issues{/number}",
    "pulls_url": "https://api.github.com/repos/threefoldtech/webstack/pulls{/number}",
    "milestones_url": "https://api.github.com/repos/threefoldtech/webstack/milestones{/number}",
    "notifications_url": "https://api.github.com/repos/threefoldtech/webstack/notifications{?since,all,participating}",
    "labels_url": "https://api.github.com/repos/threefoldtech/webstack/labels{/name}",
    "releases_url": "https://api.github.com/repos/threefoldtech/webstack/releases{/id}",
    "deployments_url": "https://api.github.com/repos/threefoldtech/webstack/deployments",
    "created_at": "2020-11-23T14:26:46Z",
    "updated_at": "2020-11-23T15:19:06Z",
    "pushed_at": "2020-11-23T15:31:15Z",
    "git_url": "git://github.com/threefoldtech/webstack.git",
    "ssh_url": "git@github.com:threefoldtech/webstack.git",
    "clone_url": "https://github.com/threefoldtech/webstack.git",
    "svn_url": "https://github.com/threefoldtech/webstack",
    "homepage": null,
    "size": 3193,
    "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,
    "disabled": false,
    "open_issues_count": 0,
    "license": null,
    "forks": 0,
    "open_issues": 0,
    "watchers": 0,
    "default_branch": "master"
  },
  "sender": {
    "login": "Hamdy",
    "id": 526328,
    "node_id": "MDQ6VXNlcjUyNjMyOA==",
    "avatar_url": "https://avatars1.githubusercontent.com/u/526328?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/Hamdy",
    "html_url": "https://github.com/Hamdy",
    "followers_url": "https://api.github.com/users/Hamdy/followers",
    "following_url": "https://api.github.com/users/Hamdy/following{/other_user}",
    "gists_url": "https://api.github.com/users/Hamdy/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/Hamdy/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/Hamdy/subscriptions",
    "organizations_url": "https://api.github.com/users/Hamdy/orgs",
    "repos_url": "https://api.github.com/users/Hamdy/repos",
    "events_url": "https://api.github.com/users/Hamdy/events{/privacy}",
    "received_events_url": "https://api.github.com/users/Hamdy/received_events",
    "type": "User",
    "site_admin": false
  }
}
MohamedEssamAdawy commented 3 years ago

This is a ping request, sent for the first time only not a push request. Push request should contain ref keyword as described in push event The issue because ping request don't have ref keyword ping event

abom commented 3 years ago

Re-open until verification.