question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

danger fails to run locally when diff is larger than maxBuffer size

See original GitHub issue

When running danger locally, it runs the command git diff master...HEAD to generate a diff to work on. This command is executed using the default maxBuffer here.

Backtrace:

(demi) yarn danger local --verbose
yarn run v1.6.0
$ /home/demi/pewpewthespells-com/node_modules/.bin/danger local --verbose
Could not get diff from git between master and HEAD
{ Error: stdout maxBuffer exceeded
    at Socket.onChildStdout (child_process.js:305:14)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at addChunk (_stream_readable.js:250:12)
    at readableAddChunk (_stream_readable.js:233:13)
    at Socket.Readable.push (_stream_readable.js:195:10)
    at Pipe.onread (net.js:586:20) cmd: 'git diff master...HEAD' }
Done in 1.53s.

The problem originates from the default being 200kb, and large git diffs can easily exceed that (in my case the diff was 24mb). I was able to get past this issue by locally modifying my danger module code to include a much larger maxBuffer size, but beyond putting a ridiculously large constant in the code, i’m not sure what the best patch for this problem is.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
samdmarshallcommented, Apr 21, 2018

There were binary files but they only appeared in the diff as marked as binary file adds, not the contents of said files. I feel like this is going to potentially be a problem that keeps on happening unless the maxBuffer variable can be scaled to fit? so maybe having it pipe out to a temporary file instead of stdout would be for the best.

0reactions
samdmarshallcommented, Jul 18, 2018

Seems good to me, gonna close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stdout buffer issue using node child_process - Stack Overflow
The above error occurred because the output generated by the execution of the command was larger than the max buffer size.
Read more >
java.io.IOException: Packet len73388953 is out of range!
Its due to the packet length is larger than what jute.maxBuffer allows. Increasing the below property helped : value of jute.maxbuffer to 100MB ......
Read more >
Troubleshooting Your Solution | The Codewars Docs
This guide covers common problems you may run into as a newcomer solving kata on Codewars, outlining common mistakes and their typical solutions....
Read more >
SMB Exploited: WannaCry Use of "EternalBlue" | Mandiant
If the message request is greater than the SMB MaxBufferSize, the remaining messages are sent as Secondary Trans2 requests.
Read more >
ZooKeeper Administrator's Guide
ZooKeeper runs in Java, release 1.8 or greater (JDK 8 LTS, ... then the failure of that switch will take down your entire...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found