Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webhooks.js expecting objects to exist that do not #67

Open
notbrain opened this issue Feb 22, 2016 · 2 comments
Open

webhooks.js expecting objects to exist that do not #67

notbrain opened this issue Feb 22, 2016 · 2 comments
Labels

Comments

@notbrain
Copy link

We have a simple setup of 3 branches that auto-build when updated, but master does not. Wanted to get this here as a placeholder before I have time to dig in in case anyone else is working on this...some extra checking would avoid these errors but if I had to guess there is an underlying issue with webhooks firing on branches that are disabled.

2016-02-19T00:30:11.474Z - error: TypeError: Cannot read property 'author' of null
    at pushJob (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:166:19)
    at startFromCommit (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:49:16)
    at receiveWebhook (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:262:16)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at projectProvider (/home/ubuntu/striderCD/lib/middleware.js:120:3)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at Promise.<anonymous> (/home/ubuntu/striderCD/lib/middleware.js:239:7)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at Promise.resolve (/home/ubuntu/striderCD/node_modules/mongoose/lib/promise.js:114:23)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at /home/ubuntu/striderCD/node_modules/mongoose/lib/query.js:1406:13
    at model.Document.init (/home/ubuntu/striderCD/node_modules/mongoose/lib/document.js:254:11)
2016-02-19T02:40:20.295Z - error: TypeError: Cannot read property 'message' of undefined
    at startFromCommit (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:52:17)
    at receiveWebhook (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:262:16)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at projectProvider (/home/ubuntu/striderCD/lib/middleware.js:120:3)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at Promise.<anonymous> (/home/ubuntu/striderCD/lib/middleware.js:239:7)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at Promise.resolve (/home/ubuntu/striderCD/node_modules/mongoose/lib/promise.js:114:23)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at /home/ubuntu/striderCD/node_modules/mongoose/lib/query.js:1406:13
    at model.Document.init (/home/ubuntu/striderCD/node_modules/mongoose/lib/document.js:254:11)
    at completeOne (/home/ubuntu/striderCD/node_modules/mongoose/lib/query.js:1404:10)
@knownasilya
Copy link
Member

First that I'm seeing this, so most likely no one is working on it. Go right ahead with that PR 😉

@xgalen
Copy link
Member

xgalen commented Jul 4, 2016

I've just found the same bug. This appears when the webhook is triggered by some events like Created or Deleted because these properties are not sent by GitHub. The solution could be to put some text as default. I will send a PR today or tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants