Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Protobuf/Buf Formatter Fails for Files Larger than 64KiB

Open
#2,481 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Reproduce the failure with a valid .proto file larger than 64 KiB and run spotlessApply. Start by reading ProcessRunner.start and the BufStep.java:109 call site shown in the trace; done means formatting completes without a Broken pipe lint and the generated output remains valid.

Written by the indexing model from the issue text.

Description

Test case:

  1. Define a .proto files larger than 64 KiB (or your platform's pipe buffer limit). Padding with whitespace should also work.
  2. Configure spotless to format said file.
  3. Run spotlessApply (gradle example).

Expected behavior:

Formatting runs and passes (if valid proto file).

Actual behavior:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':treatment:api:spotlessProtobufApply'.
   ...
Caused by: org.gradle.api.GradleException: There were 1 lint error(s), they must be fixed or suppressed.
src/...:LINE_UNDEFINED buf(java.io.IOException) Broken pipe (...)
Resolve these lints or suppress with `suppressLintsFor`
        at com.diffplug.gradle.spotless.SpotlessApply.performAction(SpotlessApply.java:60)

cat-ing /build/spotless-lints/... shows:

Broken pipe
	at java.base/java.io.FileOutputStream.writeBytes(Native Method)
	at java.base/java.io.FileOutputStream.write(FileOutputStream.java:367)
	at java.base/java.io.BufferedOutputStream.implWrite(BufferedOutputStream.java:217)
	at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:206)
	at java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:110)
	at com.diffplug.spotless.ProcessRunner.start(ProcessRunner.java:165)
	at com.diffplug.spotless.ProcessRunner.start(ProcessRunner.java:131)
	at com.diffplug.spotless.ProcessRunner.exec(ProcessRunner.java:114)
	at com.diffplug.spotless.ProcessRunner.exec(ProcessRunner.java:109)
	at com.diffplug.spotless.protobuf.BufStep$State.format(BufStep.java:109)
	at com.diffplug.spotless.FormatterFunc$Closeable$3.apply(FormatterFunc.java:140)
	at com.diffplug.spotless.FormatterStepEqualityOnStateSerialization.format(FormatterStepEqualityOnStateSerialization.java:49)
	at com.diffplug.spotless.LintState.of(LintState.java:177)
	at com.diffplug.spotless.LintState.of(LintState.java:134)
	at com.diffplug.gradle.spotless.SpotlessTaskImpl.processInputFile(SpotlessTaskImpl.java:134)
	at com.diffplug.gradle.spotless.SpotlessTaskImpl.performAction(SpotlessTaskImpl.java:117)
...
Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.