Open gmega opened 8 months ago
Error: unhandled exception: Stream boundary is not reached yet [Defect]
Why is this a defect? It's not a Codex
crash Chronos
is for some reason aborting the process on a malformed stream, which isn't sound.
Looks similar to https://github.com/codex-storage/nim-codex/issues/527, but it is not reproduced anymore on codexstorage/nim-codex:latest-dist-tests
- fd3c56
.
But some weird and reproducible behaviour observed
# Run
docker run \
-e CODEX_API_BINDADDR=0.0.0.0 \
-e CODEX_LOG_LEVEL=TRACE \
-p 8080:8080 \
codexstorage/nim-codex:latest-dist-tests
# Generate
dd if=/dev/urandom of=upload.bin bs=1000M count=1
# Test
timeout 5 curl -X POST localhost:8080/api/codex/v1/data \
-H "Content-Type: application/octet-stream" \
-H "Expect: 100-continue" \
-T upload.bin
# Run
codex --log-level=TRACE
# Generate
dd if=/dev/urandom of=upload.bin bs=1000M count=1
# Test
timeout 5 curl -X POST localhost:8080/api/codex/v1/data \
-H "Content-Type: application/octet-stream" \
-H "Expect: 100-continue" \
-T upload.bin
I am facing this problem as well. My use-case is that I'm trying to upload a file from the UI and when I cancel the request, the client crashes with this error:
ERR 2024-07-30 19:23:08.468+02:00 Unhandled exception in async proc, aborting topics="codex" tid=41748 msg="Stream boundary is not reached yet"
https://github.com/user-attachments/assets/b1ad6482-84fe-4dcf-9873-3141529b87af
Alright thanks @2-towns, gonna bump this up so we work on it.
I did a git pull this morning and the node is not crashing anymore. Instead, I am seing the following log:
DBG 2024-07-31 12:06:35.308+02:00 Critical error occured while sending response topics="codex" tid=90717 meth=POST peer=127.0.0.1:57958 uri=/api/codex/v1/data code="400 Bad Request" error_msg="Unable to send response"
I'm seeing the following:
TRC 2024-10-02 10:14:52.685+02:00 Stream created topics="libp2p lpstream" tid=938714 s=66fd00fc07c555d6584bf4b5 objName=AsyncStreamWrapper dir=In
INF 2024-10-02 10:14:52.685+02:00 Storing data topics="codex node" tid=938714
TRC 2024-10-02 10:14:52.685+02:00 Reading bytes from reader topics="libp2p asyncstreamwrapper" tid=938714 bytes=65536
TRC 2024-10-02 10:14:52.906+02:00 CatchableError exception topics="codex node" tid=938714 exc="Incomplete chunk received"
ERR 2024-10-02 10:14:52.906+02:00 Unhandled exception in async proc, aborting topics="codex" tid=938714 msg="Incomplete chunk received"
I have a simple golang code which downloads a file from HTTP and passes the stream/buffer to a Codex REST API reques to upload data. When the program is killed I get the error above. It would be good if such en event did not crash the whole node:)
Version: master
(264bfa17f54b7973432d000446a725a4b5a6134a
)
System: ubuntu 23.10
I'm seeing the following:
TRC 2024-10-02 10:14:52.685+02:00 Stream created topics="libp2p lpstream" tid=938714 s=66fd00fc07c555d6584bf4b5 objName=AsyncStreamWrapper dir=In INF 2024-10-02 10:14:52.685+02:00 Storing data topics="codex node" tid=938714 TRC 2024-10-02 10:14:52.685+02:00 Reading bytes from reader topics="libp2p asyncstreamwrapper" tid=938714 bytes=65536 TRC 2024-10-02 10:14:52.906+02:00 CatchableError exception topics="codex node" tid=938714 exc="Incomplete chunk received" ERR 2024-10-02 10:14:52.906+02:00 Unhandled exception in async proc, aborting topics="codex" tid=938714 msg="Incomplete chunk received"
I have a simple golang code which downloads a file from HTTP and passes the stream/buffer to a Codex REST API reques to upload data. When the program is killed I get the error above. It would be good if such en event did not crash the whole node:)
Version:
master
(264bfa17f54b7973432d000446a725a4b5a6134a
) System: ubuntu 23.10
Does it crash as in the first case that @gmega documented, or does it just print the error and continues running? If it's the former, could you provide the stacktrace as well?
Describe the bug Codex crashes if I start uploading a large file to it and then CTRL+C my
curl
request before it completes.To Reproduce
Launch codex.
Do:
as the file is being uploaded, interrupt
curl
with CTRL+C. Codex will crash with:Expected behavior Codex should simply handle the aborted upload, either deleting all blocks that belong to the failed upload or accepting the ones that got uploaded.
Environment:
Additional context Add any other context about the problem here.