-
Notifications
You must be signed in to change notification settings - Fork 156
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
When using http_proxy
, can upload an empty action.
#75
Comments
This started happening after we started using |
It's not clear to me when the size of the artefact being uploaded could be 0 in 700d941#diff-b759c035e06bbab37422eac5ba2473b6R41. |
Also not sure an empty artefact would be a zero sized one, as opposed to an empty zip stream or something, I did not save the cache directories when this error happened. Will do it if it happens again. |
Narrowed it down: it's not an empty artefact, it's an empty action. |
http_proxy
, can upload an empty artefact.http_proxy
, can upload an empty action.
The action is a zero byte file. |
Bazel can cache empty artifacts[1] (e.g. when one of the inputs is [1] See bazelbuild/bazel#6260 for example |
I added that check because I kept seeing errors in cached builds, and traced it down to bazel uploading empty files. For example, I was seeing linker crashes as the |
I think empty artifacts are ok, especially if they're 0 byte files as opposed to no files at all. They are a valid output after all. Empty actions seem to be the invalid case. |
I agree in principle that empty outputs should be ok. However, over tens of thousands of builds with 0.5.4, I've seen bazel mistakenly upload empty files. These errors would show up as linker errors (if the truncated file was an object file), or even compiler errors (if it was a generated header). Any builds that touched the truncated file would fail until the cache was wiped. Many things have changed in bazel since then, so the bug might very well have gone away. |
I added some ActionResult validation a while back which might help catch corrupt action cache files, if they are corrupted by bazel-remote itself. On upload we now make sure that the worker is set in execution_metadata, which makes the serialized data non-empty. Then we check that ActionCache items aren't empty before returning them to the client. However technically speaking a zero-length ActionResult proto is valid, so we can't reject a zero-sized ActionResult if that's what the client or REAPI worker uploads. |
I think we've done all we can here, closing. |
This results in errors similar to:
when using java rules for example.
The text was updated successfully, but these errors were encountered: