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

ERR_CHILD_PROCESS_STDIO_MAXBUFFER #583

Closed
loginovma opened this issue May 24, 2019 · 15 comments · Fixed by kellyselden/git-diff-apply#269
Closed

ERR_CHILD_PROCESS_STDIO_MAXBUFFER #583

loginovma opened this issue May 24, 2019 · 15 comments · Fixed by kellyselden/git-diff-apply#269

Comments

@loginovma
Copy link

Got this when running ember-cli-update --to 3.10.1 in large monorepo.

{ RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at Socket.onChildStdout (child_process.js:348:14)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:260:13)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:94:17)
  cmd: 'git ls-files',
  stdout: '-long-string-with-filenames-here-'
@robclancy
Copy link

Yep just went to update and got this.

@robclancy
Copy link

I was able to fix it by changing this:

https://github.com/kellyselden/git-diff-apply/blob/47ff095ca65f81e7ceae698666a52908f79222a2/src/git-remove-all.js#L12

let files = (await run('git ls-files', Object.assign({ maxBuffer: 1024 * 500 }, options))).trim().split(/\r?\n/g);

@michaelst
Copy link

I am also running into this same issue

@tfazekas
Copy link

I was able to fix it by changing this:

https://github.com/kellyselden/git-diff-apply/blob/47ff095ca65f81e7ceae698666a52908f79222a2/src/git-remove-all.js#L12

let files = (await run('git ls-files', Object.assign({ maxBuffer: 1024 * 500 }, options))).trim().split(/\r?\n/g);

Could you tell what cause the problem and how you resolved this?
Haven't found anything related to git-diff-apply
I have the same issue, but don't really know what should I change or which file.
Thanks

@koopa
Copy link

koopa commented Jul 10, 2019

@tfazekas I was just looking for this myself, maybe this helps:
cd $(npm list -g | head -n1)/node_modules/ember-cli-update/node_modules/git-diff-apply

PS: setting a large maxBuffer size indeed fixed this issue for me as well.

@tfazekas
Copy link

tfazekas commented Jul 11, 2019

Thanks @koopa !

@kellyselden
Copy link
Member

I used @robclancy's suggestion. Can you try with v0.34.13 and report back?

@bryanhickerson
Copy link

I still have this issue as of 0.43.6.

$ ember-cli-update --to "3.11.0"
{ RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at Socket.onChildStdout (child_process.js:354:14)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:265:13)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:94:17)
  cmd: 'git commit -m "message" --no-verify',
$ ember-cli-update --version
0.43.6

@bryanhickerson
Copy link

I still have this issue as of 0.43.6.

Issue didn't happen in the upgrade from 3.11 to 3.12

@timiyay
Copy link

timiyay commented Dec 12, 2019

We've just encountered this error when also running in a large Ember monorepo.

@kellyselden WDYT about maxing the maxBuffer into a CLI param for ember-cli-update?

That would free us up to experiment with a maxBuffer size that suits our repo, while allowing you to maintain sensible defaults.

If that sounds agreeable, I can get a PR together.

@timiyay
Copy link

timiyay commented Dec 12, 2019

I've since seen the git-diff-apply PR that switches to spawn to, theoretically, sidestep any max buffer issues: kellyselden/git-diff-apply#278.

Unfortunately, we're still encountering the max buffer issue, when attempting to upgrade from Ember 3.10 to 3.11. I've done some light digging into docs and help forums, and the consensus seems to be that spawn is exempt from buffer issues. Either that's not true, or something else in the chain is trying to swallow the entire stdout in one go.

ember-cli-update: 0.47.1
nodejs: 10.15.0

{ RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at Socket.onChildStdout (child_process.js:348:14)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:260:13)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:94:17)
  cmd: 'git commit -m "message" --no-verify',
  stdout: 'very-large-showstopping-output',
  stderr: ''
}

Update: looks like our issue is coming from an attempted large git commit operation, which still uses the exec command, and is therefore subject to the maxBuffer problems in this issue. The relevant code is here: https://github.com/ejlangev/git-diff-apply/blob/master/src/run.js#L9

If there's a preference for configurable maxBuffer VS using spawn+streams, I'd be interested to hear, and I can take a swing at a PR.

@kellyselden
Copy link
Member

@timiyay I think first step would be to get it to match the other spawn fix, then worry about configuring later. Thanks.

@timiyay
Copy link

timiyay commented Dec 17, 2019

@DeclanBoller has opened the relevant PR against git-diff-apply here: kellyselden/git-diff-apply#295

@kellyselden
Copy link
Member

This probably isn't an issue anymore with v0.49.0.

@Benjy1979
Copy link

Benjy1979 commented Oct 17, 2022

I've got this issue again in Version 3.1.1 (x64) (GitHub Desktop with a ember project 4.7)
2022-10-17T00:41:57.311Z - info: [ui] [BranchPruner] Last prune took place 2 hours ago - skipping 2022-10-17T00:41:59.227Z - error: [ui] Could not load old contents for syntax highlighting RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded at __node_internal_captureLargerStackTrace (node:internal/errors:464:5) at new NodeError (node:internal/errors:371:5) at Socket.onChildStdout (node:child_process:470:14) at Socket.emit (node:events:538:35) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:285:11) at Socket.Readable.push (node:internal/streams/readable:228:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

It gets stuck on "Hanging Origin"

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

Successfully merging a pull request may close this issue.

9 participants