Supybot-plugins
Supybot-plugins copied to clipboard
GitHub: Error with push event
Traceback
INFO 2015-01-07T19:59:16 HTTP request: 192.30.252.44 - "POST /github HTTP/1.1" 200 -
ERROR 2015-01-07T19:59:18 Cannot connect to git.io: HTTP Error 422: Unprocessable Entity
ERROR 2015-01-07T19:59:18 Uncaught exception in GithubCallback.doPost:
Traceback (most recent call last):
File "/home/nyuszika7h/bots/aelita/venv/lib/python3.2/site-packages/supybot/log.py", line 361, in m
return f(self, *args, **kwargs)
File "/home/nyuszika7h/bots/aelita/plugins/GitHub/plugin.py", line 142, in doPost
self.plugin.announce.onPayload(headers, json.loads(form['payload'].value))
File "/home/nyuszika7h/bots/aelita/plugins/GitHub/plugin.py", line 306, in onPayload
'push', hidden)
File "/home/nyuszika7h/bots/aelita/plugins/GitHub/plugin.py", line 225, in _createPrivmsg
repl[key + '__branch'] = value.split('/', 2)[2]
AttributeError: 'NoneType' object has no attribute 'split'
ERROR 2015-01-07T19:59:18 Exception id: 0x3299a
Headers
Request URL: http://server.redray.es:14500/github
Request method: POST
content-type: application/x-www-form-urlencoded
Expect:
User-Agent: GitHub-Hookshot/2f00e0f
X-GitHub-Delivery: 46380380-969f-11e4-82e6-d063dd78b8be
X-GitHub-Event: push
Payload
{
"ref": "refs/heads/master",
"before": "fa326b5fb368978f147bb0b141f3d66d31e5740f",
"after": "59a633972975838485014c610eae03d610a6fb06",
"created": false,
"deleted": false,
"forced": false,
"base_ref": null,
"compare": "https://github.com/lykoss/lykos/compare/fa326b5fb368...59a633972975",
"commits": [
{
"id": "667b8240654f4a128803beb5bde1786ce7ab65ae",
"distinct": true,
"message": "Fix typo: s/logged in/not logged in/",
"timestamp": "2015-01-07T19:49:56+01:00",
"url": "https://github.com/lykoss/lykos/commit/667b8240654f4a128803beb5bde1786ce7ab65ae",
"author": {
"name": "nyuszika7h",
"email": "[email protected]",
"username": "nyuszika7h"
},
"committer": {
"name": "nyuszika7h",
"email": "[email protected]",
"username": "nyuszika7h"
},
"added": [
],
"removed": [
],
"modified": [
"modules/wolfgame.py"
]
},
{
"id": "59a633972975838485014c610eae03d610a6fb06",
"distinct": true,
"message": "Unify \"not logged in to NickServ\" notices\n\nIn some places, the bot says \"not logged in to NickServ\", while in other\nplaces, it saays \"not identified with NickServ\". This changes all such\nnotices to use the first form.",
"timestamp": "2015-01-07T19:51:08+01:00",
"url": "https://github.com/lykoss/lykos/commit/59a633972975838485014c610eae03d610a6fb06",
"author": {
"name": "nyuszika7h",
"email": "[email protected]",
"username": "nyuszika7h"
},
"committer": {
"name": "nyuszika7h",
"email": "[email protected]",
"username": "nyuszika7h"
},
"added": [
],
"removed": [
],
"modified": [
"modules/wolfgame.py"
]
}
],
"head_commit": {
"id": "59a633972975838485014c610eae03d610a6fb06",
"distinct": true,
"message": "Unify \"not logged in to NickServ\" notices\n\nIn some places, the bot says \"not logged in to NickServ\", while in other\nplaces, it saays \"not identified with NickServ\". This changes all such\nnotices to use the first form.",
"timestamp": "2015-01-07T19:51:08+01:00",
"url": "https://github.com/lykoss/lykos/commit/59a633972975838485014c610eae03d610a6fb06",
"author": {
"name": "nyuszika7h",
"email": "[email protected]",
"username": "nyuszika7h"
},
"committer": {
"name": "nyuszika7h",
"email": "[email protected]",
"username": "nyuszika7h"
},
"added": [
],
"removed": [
],
"modified": [
"modules/wolfgame.py"
]
},
"repository": {
"id": 16919993,
"name": "lykos",
"full_name": "lykoss/lykos",
"owner": {
"name": "lykoss",
"email": ""
},
"private": false,
"html_url": "https://github.com/lykoss/lykos",
"description": "Werewolf, the popular detective/social party game (a theme of Mafia)",
"fork": false,
"url": "https://github.com/lykoss/lykos",
"forks_url": "https://api.github.com/repos/lykoss/lykos/forks",
"keys_url": "https://api.github.com/repos/lykoss/lykos/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/lykoss/lykos/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/lykoss/lykos/teams",
"hooks_url": "https://api.github.com/repos/lykoss/lykos/hooks",
"issue_events_url": "https://api.github.com/repos/lykoss/lykos/issues/events{/number}",
"events_url": "https://api.github.com/repos/lykoss/lykos/events",
"assignees_url": "https://api.github.com/repos/lykoss/lykos/assignees{/user}",
"branches_url": "https://api.github.com/repos/lykoss/lykos/branches{/branch}",
"tags_url": "https://api.github.com/repos/lykoss/lykos/tags",
"blobs_url": "https://api.github.com/repos/lykoss/lykos/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/lykoss/lykos/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/lykoss/lykos/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/lykoss/lykos/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/lykoss/lykos/statuses/{sha}",
"languages_url": "https://api.github.com/repos/lykoss/lykos/languages",
"stargazers_url": "https://api.github.com/repos/lykoss/lykos/stargazers",
"contributors_url": "https://api.github.com/repos/lykoss/lykos/contributors",
"subscribers_url": "https://api.github.com/repos/lykoss/lykos/subscribers",
"subscription_url": "https://api.github.com/repos/lykoss/lykos/subscription",
"commits_url": "https://api.github.com/repos/lykoss/lykos/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/lykoss/lykos/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/lykoss/lykos/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/lykoss/lykos/issues/comments/{number}",
"contents_url": "https://api.github.com/repos/lykoss/lykos/contents/{+path}",
"compare_url": "https://api.github.com/repos/lykoss/lykos/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/lykoss/lykos/merges",
"archive_url": "https://api.github.com/repos/lykoss/lykos/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/lykoss/lykos/downloads",
"issues_url": "https://api.github.com/repos/lykoss/lykos/issues{/number}",
"pulls_url": "https://api.github.com/repos/lykoss/lykos/pulls{/number}",
"milestones_url": "https://api.github.com/repos/lykoss/lykos/milestones{/number}",
"notifications_url": "https://api.github.com/repos/lykoss/lykos/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/lykoss/lykos/labels{/name}",
"releases_url": "https://api.github.com/repos/lykoss/lykos/releases{/id}",
"created_at": 1392656577,
"updated_at": "2015-01-06T01:45:45Z",
"pushed_at": 1420657155,
"git_url": "git://github.com/lykoss/lykos.git",
"ssh_url": "[email protected]:lykoss/lykos.git",
"clone_url": "https://github.com/lykoss/lykos.git",
"svn_url": "https://github.com/lykoss/lykos",
"homepage": "http://wolf.xnrand.com/",
"size": 4571,
"stargazers_count": 15,
"watchers_count": 15,
"language": "Python",
"has_issues": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 23,
"mirror_url": null,
"open_issues_count": 12,
"forks": 23,
"open_issues": 12,
"watchers": 15,
"default_branch": "master",
"stargazers": 15,
"master_branch": "master",
"organization": "lykoss"
},
"pusher": {
"name": "nyuszika7h",
"email": "[email protected]"
},
"organization": {
"login": "lykoss",
"id": 6707035,
"url": "https://api.github.com/orgs/lykoss",
"repos_url": "https://api.github.com/orgs/lykoss/repos",
"events_url": "https://api.github.com/orgs/lykoss/events",
"members_url": "https://api.github.com/orgs/lykoss/members{/member}",
"public_members_url": "https://api.github.com/orgs/lykoss/public_members{/member}",
"avatar_url": "https://avatars.githubusercontent.com/u/6707035?v=3",
"description": ""
},
"sender": {
"login": "nyuszika7h",
"id": 482367,
"avatar_url": "https://avatars.githubusercontent.com/u/482367?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/nyuszika7h",
"html_url": "https://github.com/nyuszika7h",
"followers_url": "https://api.github.com/users/nyuszika7h/followers",
"following_url": "https://api.github.com/users/nyuszika7h/following{/other_user}",
"gists_url": "https://api.github.com/users/nyuszika7h/gists{/gist_id}",
"starred_url": "https://api.github.com/users/nyuszika7h/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nyuszika7h/subscriptions",
"organizations_url": "https://api.github.com/users/nyuszika7h/orgs",
"repos_url": "https://api.github.com/users/nyuszika7h/repos",
"events_url": "https://api.github.com/users/nyuszika7h/events{/privacy}",
"received_events_url": "https://api.github.com/users/nyuszika7h/received_events",
"type": "User",
"site_admin": false
}
}
The bot replies to the request with HTTP 200 and "Thanks." despite the error.
probably solved with commit 9648a702ac8361b1beeacb6686f22cfd3d047423
@nyuszika7h, can you confirm this?
I'll try, but I'd need to convert the payload to the urlencoded format as I can't really reproduce this any other way, I haven't got this error recently.
The plugin uses JSON, since 2130c5ba9bf58e6a2253822ee3c0a2cb562d74bd