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.

Buck fails during parsing of test xml files

See original GitHub issue

Seeing this stacktrace randomly when running tests

java.nio.channels.ClosedByInterruptException
	at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
	at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:315)
	at java.nio.file.Files.readAllBytes(Files.java:3154)
	at com.facebook.buck.test.XmlTestResultParser.parse(XmlTestResultParser.java:125)
	at com.facebook.buck.jvm.java.JavaTest.lambda$0(JavaTest.java:448)
	at com.facebook.buck.cli.TestRunning$4.call(TestRunning.java:537)
	at com.facebook.buck.cli.TestRunning$4.call(TestRunning.java:1)
	at com.facebook.buck.cli.TestRunning.lambda$1(TestRunning.java:811)
	at com.facebook.buck.util.concurrent.WeightedListeningExecutorService.lambda$0(WeightedListeningExecutorService.java:78)
	at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:211)
	at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:200)
	at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:130)
	at com.google.common.util.concurrent.MoreExecutors$5$1.run(MoreExecutors.java:952)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

Seems to be happening after we picked up https://github.com/facebook/buck/commit/886fa842cf6589fb5b1942d61fa0343582740da9 recently

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:23 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
kageiitcommented, Aug 11, 2017

@bertmaher It is interesting that you mentioned nailgun.

I looked at the logs in buck-out/log and found this when the exception happened


stderr:


[2017-08-11 06:06:28.963][warn ][command:null][tid:559][com.martiansoftware.nailgun.NGInputStream] Nailgun client read future timed out after 60000 ms
java.util.concurrent.TimeoutException
	at java.util.concurrent.FutureTask.get(FutureTask.java:205)
	at com.martiansoftware.nailgun.NGInputStream$1.run(NGInputStream.java:91)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

[2017-08-11 06:06:29.078][debug][command:null][tid:559][com.martiansoftware.nailgun.NGInputStream] Nailgun client read shutting down
[2017-08-11 06:06:29.078][info ][command:null][tid:559][com.facebook.buck.cli.Main] BuckIsDyingException: killing background processes on client disconnectionjava.lang.Throwable
	at com.facebook.buck.cli.Main.lambda$3(Main.java:1271)
	at com.martiansoftware.nailgun.NGInputStream.notifyClientListener(NGInputStream.java:117)
	at com.martiansoftware.nailgun.NGInputStream.notifyClientListener(NGInputStream.java:132)
	at com.martiansoftware.nailgun.NGInputStream.notifyClientListeners(NGInputStream.java:150)
	at com.martiansoftware.nailgun.NGInputStream.access$300(NGInputStream.java:35)
	at com.martiansoftware.nailgun.NGInputStream$1.run(NGInputStream.java:101)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

[2017-08-11 06:06:29.079][info ][command:null][tid:559][com.facebook.buck.cli.Daemon] Client disconnected.
[2017-08-11 06:06:29.088][warn ][command:6a78fd6f-d01c-489c-921e-daf926c0385d][tid:556][com.facebook.buck.util.Threads] Current thread interrupted at this location: java.lang.Throwable
	at com.facebook.buck.util.Threads.interruptCurrentThread(Threads.java:38)
	at com.facebook.buck.cli.TestRunning.runTests(TestRunning.java:390)
	at com.facebook.buck.cli.TestCommand.runTestsInternal(TestCommand.java:296)
	at com.facebook.buck.cli.TestCommand.runWithoutHelp(TestCommand.java:589)
	at com.facebook.buck.cli.AbstractCommand.run(AbstractCommand.java:227)
	at com.facebook.buck.cli.AbstractContainerCommand.run(AbstractContainerCommand.java:67)
	at com.facebook.buck.cli.BuckCommand.run(BuckCommand.java:81)
	at com.facebook.buck.cli.Main.runMainWithExitCode(Main.java:983)
	at com.facebook.buck.cli.Main.runMainThenExit(Main.java:372)
	at com.facebook.buck.cli.Main.nailMain(Main.java:1725)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.martiansoftware.nailgun.NGSession.run(NGSession.java:329)

[2017-08-11 06:06:29.365][warn ][command:6a78fd6f-d01c-489c-921e-daf926c0385d][tid:619][com.facebook.buck.cli.TestRunning] Test command step failed, marking //apps/foo:test_release as failed
java.nio.channels.ClosedByInterruptException
	at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
	at sun.nio.ch.FileChannelImpl.size(FileChannelImpl.java:315)
	at java.nio.file.Files.readAllBytes(Files.java:3154)
	at com.facebook.buck.test.XmlTestResultParser.parse(XmlTestResultParser.java:125)
	at com.facebook.buck.jvm.java.JavaTest.lambda$0(JavaTest.java:449)
	at com.facebook.buck.cli.TestRunning$4.call(TestRunning.java:537)
	at com.facebook.buck.cli.TestRunning$4.call(TestRunning.java:1)
	at com.facebook.buck.cli.TestRunning.lambda$1(TestRunning.java:811)
	at com.facebook.buck.util.concurrent.WeightedListeningExecutorService.lambda$0(WeightedListeningExecutorService.java:78)
	at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:211)
	at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:200)
	at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:130)
	at com.google.common.util.concurrent.MoreExecutors$5$1.run(MoreExecutors.java:952)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
1reaction
styurincommented, Aug 11, 2017

The nailgun update had only fixes related to multithread safety, there were no changes in logic. I’ll double check them though

Read more comments on GitHub >

github_iconTop Results From Across the Web

It is not clear why test reports cannot be parsed - GitLab
Summary. There is very little information available when test reports cannot be parsed by GitLab for some reason. For example, https://gitlab. ...
Read more >
Problem in parsing test execution report - SonarQube
I copy/pasted your example into a file and tried to analyze with it. And got the same error. When I added the missing...
Read more >
Buck: .buckconfig
Changes to Buck's configuration can—temporarily—degrade Buck's performance because of how they affect Buck's parsing and caching behavior. If you change the ...
Read more >
Build fails on Bamboo server while parsing Test.XML file
The cause of the error is not very clear, but it seems the Test.xml file for the test Parsing is modified even before...
Read more >
XML Parser Error Codes - IBM
If the XML parser detects an error in the XML document during parsing, message RNX0351 will be issued. From the message, you can...
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