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

Failed worker protocol error doesn't explain that stdout is reserved for worker protocol #4897

Closed
alexeagle opened this issue Mar 21, 2018 · 2 comments
Assignees

Comments

@alexeagle
Copy link
Contributor

When a user just adds a console.log to a nodejs worker (or System.out.println to a Java one) they get a big error that looks to them like they crashed Bazel, and no indication that a Worker process is not allowed to write things to stdout.

This makes it very hard to recover from a basic attempt to debug problems.

(It helps a lot that we now print the thing that was written to stdout, like no ivy below, but it's hard to find unless you're accustomed to parsing this error, and still doesn't say how to fix it)

ERROR: /home/www/angular/packages/core/BUILD.bazel:5:1: Compiling Angular templates (ngc) //packages/core:core failed: Worker process returned an unparseable WorkResponse:

---8<---8<--- Exception details ---8<---8<---
com.google.protobuf.InvalidProtocolBufferException$InvalidWireTypeException: Protocol message tag had invalid wire type.
	at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:115)
	at 
 ...
com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:340)
	at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:352)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
---8<---8<--- End of exception details ---8<---8<---

---8<---8<--- Start of log ---8<---8<---
no ivy
---8<---8<--- End of log ---8<---8<---
@cushon
Copy link
Contributor

cushon commented Mar 21, 2018

A better diagnostic would be helpful, but the problem could also be avoided by not using stdout to communicate with workers, e.g. #2832

@philwo
Copy link
Member

philwo commented Mar 21, 2018

@cushon Absolutely. Unfortunately I won't have time to work on that before Q3. :|

I prepared a fix for this that adds a more helpful message in this case.

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

No branches or pull requests

4 participants