Open Paultje52 opened 10 months ago
Can you confirm that this does not happen in Node.js?
Yes, the same issue doesn't happen in node
The issue is resolved for development (bun --bun run dev
) in v1.0.10, but it's still present when building the code
When updating nginx to 1.24, the problem seems to be resolved. Still strange why the problem doesn't appear in node or versions of bun before 1.0.5. It also only happens when nginx accepts a http/2 request. Here is the error log (from nginx) of a request that returned 520.
2024/01/08 20:16:58 [warn] 3421326#3421326: *10 upstream sent more data than specified in "Content-Length" header while reading upstream, client: <MY_IP>, server: <MY_DOMAIN>, request: "GET /icon/favicon-dark.ico HTTP/2.0", upstream: "http://127.0.0.1:3001/icon/favicon-dark.ico", host: "<MY_DOMAIN>", referrer: "https://<MY_DOMAIN>/dash/exams"
What version of Bun is running?
1.0.5, 1.0.6,1.0.7, 1.0.8 and 1.0.9
After building, the issue persists in 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.15, 1.0.16, 1.0.17 and 1.0.18.
What platform is your computer?
Linux 5.4.0-156-generic x86_64 x86_64
What steps can reproduce the bug?
bun install
) and build the code usingbun run build
bun --bun run build/index.js
What is the expected behavior?
The page should load without any errors, just like in 1.0.4 and lower
What do you see instead?
Error 520:![image](https://github.com/oven-sh/bun/assets/31313717/a87e9d00-8046-42c6-a8d8-e841ebcea968)
Web server is returning an unknown error Error code 520
(see screenshot)Additional information
It seems "random" what pages give an error. Sometimes the page does work and sometimes it doesn't. Open the dev tools, head to network and see what requests fail with
520
.There aren't any errors reported in the terminal. Using it without cloudflare and nginx works without any problems, but because it doesn't happen in bun 1.0.4 and earlier, it isn't a misconfiguration or an nginx or cloudflare issue.
I'm sorry that I don't have more direct errors, it's a really vague error. The only way to "resolve" it is by staying on bun 1.0.4 or lower or don't use nginx/cloudflare with ssl.