-
Notifications
You must be signed in to change notification settings - Fork 393
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
SAVE ARTIFACT
of large files on failure under FINALLY
block is truncated (or missing under later versions of earthly)
#2452
Comments
Looks like this is explained by debugger/common/common.go#L69: err := binary.Write(w, binary.LittleEndian, uint16(n)) The number of bytes is cast to |
Fixes #2452 Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
Fixes #2452 Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
Fixes #2452 Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
It's a bit improved in 0.7-rc1, but I still don't get the whole file. Using the example above:
That's 327,675 bytes out of 512,000, or 64% of the way. |
Oh no! It's not deterministic! Retrying it a bit more I get 131,070 bytes, then 196,605, then 512,000 (yay!), 262,140, and then no file at all. After that I get no file at all until I delete the This behavior was discovered by my coworker @lacca0. (Thanks!) Looks quite random. So I'm not sure it can be the fault of the wire protocol. Maybe the sender or received gets killed halfway? Do you think it's something on our end? Or are you getting this behavior too? We're using the |
I'm seeing the same behavior. 256k one time, 448k another, sometimes it just doesn't show up at all. 🤔 |
I've tracked down part of the problem: in this |
cb41246 means that we won't ignore the underflow error any more, but all that means is that the file will be deleted if it didn't get fully written. It doesn't actually solve this issue. |
Thanks for investigating this! In the meantime I tried a workaround and it seems to work with
When I run |
SAVE ARTIFACT
of large files on failure under FINALLY
block is truncated (or missing under later versions of earthly)
My workaround has been to wrap the
|
The key to this work-around is the This is not bullet-proof since the entire runc container executing the RUN command could get killed (e.g. out of memory). Another approach is to do |
yes, I'm personally using the I thought the outputs were generated only if no step has failed. In fact the documentation says:
but indeed VERSION 0.7
test:
FROM alpine
RUN echo lalala > foo
WAIT
SAVE ARTIFACT foo AS LOCAL ./foo
END
RUN sleep 20
RUN false copies the file foo locally before running the I have to retry @chroder workaround on my real build — it should have worked |
I want to save a test report even on failure, so I'm trying to use
--try
from #587. If the artifact is not tiny, I see it getting cropped somehow! Check it out:Output:
It still manages to create
hello
on failure, but it's just 53,248 bytes! Where's the rest of my file?For sizes up to 65,535 bytes it works. For sizes larger than that I get (SIZE % 65536) bytes.
Looks like an all-zero file is kind of a special case. With
head -c 500k < /dev/random
the file doesn't get created if it's longer than 65,535 bytes. And this is what I see in my real use case with an 8 MB zip file.The text was updated successfully, but these errors were encountered: