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.

Error reading stream exception thrown from OutputFilter / NativeImageBuildStep

See original GitHub issue

Describe the bug

Error reading stream exception thrown from OutputFilter / NativeImageBuildStep

We see this issue with Quarkus 2.13

https://github.com/quarkusio/quarkus/blob/main/core/deployment/src/main/java/io/quarkus/deployment/OutputFilter.java was refactored / introduced in https://github.com/quarkusio/quarkus/pull/26892 / Quarkus 2.13.0.Final

Stacktrace:

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /home/runner/work/quarkus-startstop/quarkus-startstop/app-jax-rs-minimal/target/quarkus-native-image-source-jar/quarkus-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Using docker to run the native image builder
Exception in thread "Process stdout" java.lang.RuntimeException: Error reading stream.
	at io.quarkus.deployment.OutputFilter.lambda$apply$0(OutputFilter.java:23)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: Stream closed
	at java.base/java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:176)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:342)
	at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
	at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
	at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
	at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181)
	at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:326)
	at java.base/java.io.BufferedReader.readLine(BufferedReader.java:392)
	at io.quarkus.deployment.OutputFilter.lambda$apply$0(OutputFilter.java:19)
	... 1 more
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Checking image status quay.io/quarkus/ubi-quarkus-native-image:22.2-java17

Example logs: https://github.com/quarkus-qe/quarkus-startstop/actions/runs/3313239997 - see ci-artifacts and explore the directory structure of the zipped content. Alternatively click on Linux - Native build to see which test failed.

Issues is not regularly reproducible, we see it in daily GitHub action.

https://github.com/quarkus-qe/quarkus-startstop/actions/workflows/ci.yaml Screenshot 2022-10-24 at 20 08 28

Expected behavior

No error

Actual behavior

~50% of StartStopTS runs hit at least one “Exception in thread “Process stdout” java.lang.RuntimeException: Error reading stream.” during native build executions. There are 8 compilations into native binary in one TS run.

How to Reproduce?

https://github.com/quarkus-qe/quarkus-startstop/actions/workflows/ci.yaml

https://github.com/quarkus-qe/quarkus-startstop/blob/main/.github/workflows/ci.yaml#L60

Output of uname -a or ver

No response

Output of java -version

Java 11

GraalVM version (if different from Java)

ubi-quarkus-native-image:22.2-java17

Quarkus version or git rev

2.13.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rsvobodacommented, Oct 25, 2022

I can prepare that change, and let’s see if @zakkak and you are ok with that.

0reactions
rsvobodacommented, Oct 26, 2022

Sofar we’ve seen this just on GH actions.

Update: Did 10 runs on our Jenkins with RHEL workers and hit the issue in 2 runs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"An exception has been thrown when reading the stream ... - IBM
When executing ruleset on RES, how can the error message "An exception has been thrown when reading the stream" be resolved?
Read more >
Quarkus 2.13.4.Final发布 - Linuxeden开源社区
... when the stream is closed and try to continue; #28799 – Error reading stream exception thrown from OutputFilter / NativeImageBuildStep ...
Read more >
"An exception has been thrown when reading the stream ...
"An exception has been thrown when reading the stream" when downloading the specific file in Vault.
Read more >
Exception thrown when reading a file - c++ - Stack Overflow
The stream is set up to throw an exception when it fails. Hence, it is throwing an exception as desired. Diagnosing this problem...
Read more >
Error reading image from InputStream - CodeRanch
Joe Ess wrote: The only thing I can think of is that the data you are reading is not an image file. Then...
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