Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

stdout maxBuffer exceeded when using mention-bot with GHE #160

Open
tbassetto opened this issue Aug 5, 2016 · 4 comments
Open

stdout maxBuffer exceeded when using mention-bot with GHE #160

tbassetto opened this issue Aug 5, 2016 · 4 comments

Comments

@tbassetto
Copy link

tbassetto commented Aug 5, 2016

I am trying to use mention-bot with a private repo in a GitHub Enterprise instance and I am hitting an error. It is hard to debug unfortunately.

I have set GITHUB_TOKEN, GITHUB_USER and GITHUB_PASSWORD. I have updated config inside package.json also. I want to check if mention-bot works before deploying it in our network, so right now it is running locally and I am using ngrok to create a tunnel on the web to my local instance of mention-bot.

After creating a PR, GitHub says it got an error 500. The logs from mention-bot:

Listening on port 5000
https://[GHE_HOST]/[A_USER]/[PRIVATE_REPO]/pull/9
{ [Error: {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.6/v3"}]
  message: '{"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.6/v3"}',
  code: 404,
  status: 'Not Found',
  headers:
   { server: 'GitHub.com',
     date: 'Fri, 05 Aug 2016 12:31:30 GMT',
     'content-type': 'application/json; charset=utf-8',
     'content-length': '92',
     connection: 'close',
     status: '404 Not Found',
     'x-oauth-scopes': 'public_repo',
     'x-accepted-oauth-scopes': '',
     'x-github-media-type': 'github.v3; param=raw; format=json',
     'access-control-expose-headers': 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval',
     'access-control-allow-origin': '*',
     'x-github-request-id': 'a71ad243-5771-48b0-9438-fae8acad56c0',
     'content-security-policy': 'default-src \'none\'',
     'strict-transport-security': 'max-age=31536000; includeSubdomains',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'deny',
     'x-xss-protection': '1; mode=block' } }
Error: stdout maxBuffer exceeded
    at Socket.<anonymous> (child_process.js:266:14)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at Pipe.onread (net.js:536:20)

It's hard to see which request returned a 404 😞 . As to why it failed, could it be because I stupidly followed the README and the token should have had access to private_repo too?

@tbassetto
Copy link
Author

Same error if I use a GITHUB_TOKEN with access to private repos.

@vjeux
Copy link
Contributor

vjeux commented Aug 5, 2016

Can you add console.log in various places and try to figure out what is happening? I don't have access to a ghe instance unfortunately so all the code in the repo was contributed by external contributors

@tbassetto
Copy link
Author

tbassetto commented Aug 7, 2016

So, 2 different issues are happening.

Failure to find .mention-bot on GHE is not caught properly

On line 151 of server.js the matching on the error message is way too strict :simple_smile:. On our GHE instance, the message is '{"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.6/v3"}'. One solution could be to change the line to:

        /{"message":"Not Found","documentation_url":"https:\/\/developer.github.com\/(?:enterprise\/2\.\d+\/)?v3"}/.test(e.message) {

Should I create a PR?

mention-bot chokes on a big PR

The Error: stdout maxBuffer exceeded error I get comes from fetching all the blames. It turns out that our project is not only quite big (in terms of number of files and lines of code), but it is also old and has more than 100 contributors. On top of that, the first PR I gave to mention-bot was a +1,944, −2,417 with 457 files changed 😄. Trying mention-bot with a smaller PR or configured with a bigger maxBuffer works fine.

@vjeux
Copy link
Contributor

vjeux commented Aug 7, 2016

Awesome investigation!

For 1), a pr would be awesome thanks!

For 2), do you know if there's a way to only get the first 1meg of data and just drop the rest? For such a big pull request we just want to get some data, processing everything is just a waste of resources.

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

No branches or pull requests

2 participants