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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_STREAM_PREMATURE_CLOSE on PUT Artifact with Azure Blob Storage implementation #158

Open
izi-p opened this issue Mar 28, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@izi-p
Copy link
Contributor

izi-p commented Mar 28, 2023

馃悰 Bug Report

When I use azure blob storage implementation (that i implemented myself in this repo), I get an error on PUT artifact with this error code ERR_STREAM_PREMATURE_CLOSE.

It looks like this:

 {"severity":"WARNING","level":40,"time":1680011533094,"pid":8,"hostname":"***","reqId":"***","data":{"code":"ERR_STREAM_PREMATURE_CLOSE"},"isBoom":true,"isServer":false,"output":{"statusCode":412,"payload":{"statusCode":412,"error":"Precondition Failed","message":"Error during the artifact creation"},"headers":{}},"stack":"Error: Error during the artifact creation\n at Object.handler (/home/app/node/src/plugins/remote-cache/routes/put-artifact.ts:33:31)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","type":"Error","message":"Error during the artifact creation"}

It still uploads small artifacts but big artifacts like our nextjs build ouputs are not sent to the azure blob storage.

I have a limited nodejs stream knowledge so maybe you will have an idea how to fix that.

Expected behavior

PUT artifact is working without 412 ERR_STREAM_PREMATURE_CLOSE error

Your Environment

  • os: Mac
@fox1t fox1t added the bug Something isn't working label Mar 30, 2023
@fox1t
Copy link
Collaborator

fox1t commented Mar 30, 2023

Thanks for opening this issue. I am not sure how we can reproduce this to investigate further. Do you have any suggestions, or can you provide a reproduction repository?

@Talent30
Copy link

@fox1t I can reproduce this issue using this repo template npx create-turbo -e basic
server

{"code":"ERR_STREAM_PREMATURE_CLOSE"},"isBoom":true,"isServer":false,"output":{"statusCode":412,"payload":{"statusCode":412,"error":"Precondition Failed","message":"Error during the artifact creation"},"headers":{}},"stack":"Error: Error during the artifact creation\n    at Object.handler (/home/site/wwwroot/index.cjs:573:44828)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","type":"Error","message":"Error during the artifact creation"}

WARNING artifact verification failed: Error making HTTP request: HTTP status client error (412 Precondition Failed) for url (https://xxxx.azurewebsites.net/v8/artifacts/ab77b5c061b50099?slug=team_awesome)

@Bornegrim
Copy link

Bornegrim commented Feb 6, 2024

I'm encountering the same issue as well. The problem seems to manifest when uploading artifacts that surpass a certain size. After some testing, I've noticed that the largest file successfully uploaded to Azure Blob Storage is 1,045,051 bytes, while the smallest file that failed is 1,140,900 bytes. It's crucial to highlight that these file sizes are not precise thresholds for success or failure; rather, they represent the file sizes available for my testing.

Files below 1,045,051 bytes upload without issue, but attempting to upload anything over 1,140,900 bytes triggers the 412 ERR_STREAM_PREMATURE_CLOSE error.

While examining the code, I couldn't pinpoint the root cause of the problem. It's worth noting that the default body limit for the API is set to 104,857,600 (assuming bytes?), so this size should not be a problem. I'm considering whether the issue might lie with Azure Blob Storage.

Any insights or assistance in resolving this matter would be greatly appreciated.

@izi-p You posted this almost a year ago, did you find a solution?

EDIT: I identified the issue: the remote cache server, hosted in AKS, was encountering a limitation in the nginx ingress with a body limit set to 1MB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants