-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Strider crashes while receiving the commits from GitHub #286
Comments
I think that's due to a change in the connect middleware. What version of Jared On Sun, Nov 24, 2013 at 2:02 AM, Andun S.L. Gunawardana <
|
I have installed the strider server using command "sudo npm install -g strider". How can I check the express version of that? |
|
Sorry about asking all these things. I am new to NodeJS. I found that strider is in /usr/bin. I run the npm list command to find the version of express using sudo but it says, npm ERR! install Couldn't read dependencies npm ERR! System Linux 3.5.0-23-generic |
I have found that strider folder is int /usr/lib/node_modules/strider. When I run npm list there, I got the express version as express@3.4.2. |
On https://public-ci.stridercd.com (which doesn't crash on github web hooks) we have:
Which version of connect do you have, @andunslg ? |
When I run the command "npm list | grep connect" I get, ââ⬠connect@2.7.11 |
Actually I'm seeing this now also in the logs of https://public-ci.stridercd.com. |
Related to #247 |
yeah - going back to 3.4.2 fixed it in the few tests that I did, but maybe there's some race condition |
let's see if we can come up with a reproducible test case. once we have that, it should be possible to track it down. |
In my case I am the owner of the git repo. There are several others contributing to the repo. For all my commits strider works fine. But when other person commits it crashes. Is this related to network level issues? Proxy filtering packets kind of things? |
Hmm that's an interesting insight. I don't think it would be network level, though |
Isn't there a quick fix for this? Cant we revert to a older stable version? Can you help me in that. I ma using this to my research project at uni. If you can help me that will be great! |
Yeah, I'm looking into fixing it today. On Mon, Nov 25, 2013 at 8:28 AM, Andun S.L. Gunawardana <
|
@andunslg the quickest fix is probably to run Strider with a process monitor like |
But after restarting, the commits which created the crash are missed! Otherwise I have to retest manually! Can we schedule a automatic test after each restart? |
Not easily. This is a bug, I don't have anything other than a sub-optimal work-around right now I'm afraid. |
If you restart Strider you can manually "Retest and deploy" and it will grab your latest version. But this is pretty breaking to the workflow. :( |
Yeah, it sucks. We're working on it... |
The hard thing about this is I can't figure out how to reproduce it reliably. At least not with Github's "test web hook" payloads. I'll try to write a tool which emulates the web hooks but that is a little bit of work. Can any of you reproduce it reliably? |
I can reproduce it reliably, but not without a fair bit of manual work each time. Every pull request merged into master of a repo configured with Strider causes Strider to exit. I'm not sure about an easy way to automate that for testing. |
Thanks for the pointer. I will see if I can make a tool which emulates that. |
Do we have a solution? |
I'm having the same problem was well. I can currently reproduce it pretty reliably. Is there a way to give you more debugging info? buffer.js:499 |
@bryce-larson how do you reproduce it? |
Not exactly sure why it is causing it, but my ci server is currently throwing this error. Here is a bit about my setup:
strider version": "1.4.1" Performing a "Test Hook" will throw the error. Would you like any more infor? |
Any chance you could paste a copy of the HTTP payload which crashes the server? |
Some private(ish) information in the response, so I emailed it to you. |
Thanks, yes, as much info as possible please. You could also look at adding an additional web hook to http://requestb.in and getting the output there. |
Okay, email you a RequestBin and a stack trace. A bit more info if you want it: "connect": { |
Thanks a lot @bryce-larson. Hopefully I can use this to repro. |
Ok I have made good progress since I can now reproduce the bug. The key is that the web hook POST from Github must be large enough that it is sent in HTTP chunked encoding. A way I forced the web hook to be very large was to create a thousand new files in a single git commit and then git push it. This results in Github's web hook being a very large JSON payload. Once you push something that can crash the server, you can force Github to send it on-demand using the "test web hooks" button. Now, the issue is that if it is sent in HTTP chunked encoding, a type-mismatch issue in the connect raw-body middleware is triggered: https://github.com/stream-utils/raw-body/blob/0.0.3/index.js#L36 The data being received by the onData handler can be of type string rather than buffer, which triggers the crash. However the latest version of raw-body (1.1.1) fixes this. Express 3.4.5 (released 3 days ago) uses a version of Connect which requires that. I have just upgraded Strider to latest Express and patched our post-body middleware to work with this, which should fix the crash. |
Awesome, thanks! |
Thanks! |
Tested and working! Thank you. |
I am running a Strider server inside a proxy, firewall. Sometimes it crashes with this error while receiving commits from git hub. Can you help,
buffer.js:499
buf.copy(buffer, pos);
^
TypeError: Object payload=%7B%22action%22%3A%22created%22%2C%22issue%22%3A%7B%22url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Fandunslg%2FSith%2Fissues%2F61%22%2C%22labels_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Fandunslg%2FSith%2Fissues%2F61%2Flabels%7B%2Fname%7D%22%2C%22comments_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Fandunslg%2FSith%2Fissues%2F61%2Fcomments%22%2C%22events_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Fandunslg%2FSith%2Fissues%2F61%2Fevents%22%2C%22html_url%22%3A%22https%3A%2F%2Fgithub.com%2Fandunslg%2FSith%2Fissues%2F61%22%2C%22id%22%3A22992811%2C%22number%22%3A61%2C%22title%22%3A%22Added+Friends+are+not+shown+in+Friends+List%22%2C%22user%22%3A%7B%22login%22%3A%22andunslg%22%2C%22id%22%3A1448271%2C%22avatar_url%22%3A%22https%3A%2F%2F2.gravatar.com%2Favatar%2F4488b7fd7af9a7d16d02273b3d68cd55%3Fd%3Dhttps%253A%252F%252Fidenticons.github.com%252F22b9ee0470f23b65b94dca5cc08bb5e3.png%26r%3Dx%22%2C%22gravatar_id%22%3A%224488b7fd7af9a7d16d02273b3d68cd55%22%2C%22url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%22%2C%22html_url%22%3A%22https%3A%2F%2Fgithub.com%2Fandunslg%22%2C%22followers_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Ffollowers%22%2C%22following_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Ffollowing%7B%2Fother_user%7D%22%2C%22gists_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Fgists%7B%2Fgist_id%7D%22%2C%22starred_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Fstarred%7B%2Fowner%7D%7B%2Frepo%7D%22%2C%22subscriptions_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Fsubscriptions%22%2C%22organizations_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Forgs%22%2C%22repos_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Frepos%22%2C%22events_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Fevents%7B%2Fprivacy%7D%22%2C%22received_events_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fandunslg%2Freceived_events%22%2C%22type%22%3A%22User%22%2C%22site_admin%22%3Afalse%7D%2C%22labels%22%3A%5B%7B%22url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Fandunslg%2FSith%2Flabels%2Fbug%22%2C%22name%22%3A%22bug%22%2C%22color%22%3A%22fc2929%22%7D%5D%2C%22state%22%3A%22open%22%2C%22assignee%22%3A%7B%22login%22%3A%22sachintharajith%22%2C%22id%22%3A1566998%2C%22avatar_url%22%3A%22https%3A%2F%2F0.gravatar.com%2Favatar%2F38daa524f81ff37b66abd2864636e7e6%3Fd%3Dhttps%253A%252F%252Fidenticons.github.com%252F760950acd91b798b629e1572a84d971a.png%26r%3Dx%22%2C%22gravatar_id%22%3A%2238daa524f81ff37b66abd2864636e7e6%22%2C%22url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%22%2C%22html_url%22%3A%22https%3A%2F%2Fgithub.com%2Fsachintharajith%22%2C%22followers_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Ffollowers%22%2C%22following_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Ffollowing%7B%2Fother_user%7D%22%2C%22gists_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Fgists%7B%2Fgist_id%7D%22%2C%22starred_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Fstarred%7B%2Fowner%7D%7B%2Frepo%7D%22%2C%22subscriptions_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Fsubscriptions%22%2C%22organizations_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Forgs%22%2C%22repos_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Frepos%22%2C%22events_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Fevents%7B%2Fprivacy%7D%22%2C%22received_events_url%22%3A%22https%3A%2F%2Fapi.github.com%2Fusers%2Fsachintharajith%2Freceived_events%22%2C%22type%22%3A%22User%22%2C%22site_admin%22%3Afalse%7D%2C%22milestone%22%3Anull%2C%22comments%22%3A2%2C%22created_at%22%3A%222013-11-20T14%3A03%3A52Z%22%2C%22updated_at%22%3A%222013-11-24T08%3A55%3A04Z%22%2C%22closed_at%22%3Anull%2C%22pu has no method 'copy'
at Function.Buffer.concat (buffer.js:499:9)
at IncomingMessage.onEnd (/usr/lib/node_modules/strider/node_modules/express/node_modules/connect/node_modules/raw-body/index.js:57:29)
at IncomingMessage.g (events.js:175:14)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
The text was updated successfully, but these errors were encountered: