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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: Seeing 500s due to ERR_STREAM_PREMATURE_CLOSE after upgrade to 7.x #10511

Open
1 task
shivghai opened this issue Apr 24, 2024 · 4 comments
Open
1 task
Labels
bug/needs-info More information is needed for reproduction topic/graphql

Comments

@shivghai
Copy link

shivghai commented Apr 24, 2024

What's not working?

Never really saw ERR_STREAM_PREMATURE_CLOSE 500s in our logs ever before. After the upgrade to 7.x, on our deployed app, I see this issue constantly:

Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
    at Readable.onclose (node:internal/streams/end-of-stream:154:30)
    at Readable.emit (node:events:518:28)
    at emitCloseNT (node:internal/streams/destroy:147:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Initially saw this issue (500s accompanied with this error) happen with our end to end tests, and then with some customers. Was eventually able to reproduce it, I kid you not, by just refreshing the page a few times. Can't repro this locally because presumably the stream interruption can't be reproduced without a certain amount of latency expected in an actual deployed scenario.

I don't think we should have to handle 500s due to this specific issue, though please advise if this is expected behavior. This seems to be a lower level issue being bubbled up as a 500.

How do we reproduce the bug?

Deploy app + refresh a page with some graphql queries (presumably) a bunch of times

What's your environment? (If it applies)

System:
    OS: macOS 13.6
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.1 - /private/var/folders/8y/99byt5ms31d1z8jgjfmyvcg80000gn/T/xfs-f1930489/node
    Yarn: 3.2.1 - /private/var/folders/8y/99byt5ms31d1z8jgjfmyvcg80000gn/T/xfs-f1930489/yarn
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Chrome: 124.0.6367.62
    Safari: 16.6
  npmPackages:
    @redwoodjs/auth-auth0-setup: 7.4.2 => 7.4.2 
    @redwoodjs/cli-data-migrate: 7.4.2 => 7.4.2 
    @redwoodjs/core: 7.4.2 => 7.4.2

Are you interested in working on this?

  • I'm interested in working on this
@shivghai shivghai added the bug/needs-info More information is needed for reproduction label Apr 24, 2024
@shivghai shivghai changed the title [Bug?]: Seeing a lot of ERR_STREAM_PREMATURE_CLOSE after upgrade to 7.x [Bug?]: Seeing a lot of ERR_STREAM_PREMATURE_CLOSE 500s after upgrade to 7.x Apr 24, 2024
@shivghai shivghai changed the title [Bug?]: Seeing a lot of ERR_STREAM_PREMATURE_CLOSE 500s after upgrade to 7.x [Bug?]: Seeing 500s due to ERR_STREAM_PREMATURE_CLOSE after upgrade to 7.x Apr 24, 2024
@Tobbe
Copy link
Member

Tobbe commented Apr 25, 2024

😬 This is going to be a tough one to figure out. Since we can't reliably reproduce this we're going to have to guess based on code changes. So realistically the only way for us to fix this is if you (or someone else who comes along in the future) can help narrow this down to a specific minor release, or, even better, a specific canary release.

@shivghai Could you please start by saying exactly what version you upgraded from and what version you first saw this issue on?

@shivghai
Copy link
Author

shivghai commented Apr 25, 2024

Upgraded from 6.6.2 to 7.4.2. FYI, I saw the topic/streaming label added - we're not using any Realtime features (just in case that was the assumption).
Just to be clear, the 500s that we are seeing from the server are for GraphQL queries (presumably).

This is very reproducible for our deployed app (and I imagine it will be for others too). Just have to refresh any page with >1 queries very very quickly (do it about 20 times and maybe it's reproducible on your app?).

@shivghai
Copy link
Author

I'll keep this issue open while I try to figure out which release it is related to. Shot in the dark would be it's because of Node 20

@Tobbe
Copy link
Member

Tobbe commented Apr 25, 2024

Upgraded from 6.6.2 to 7.4.2. FYI, I saw the topic/streaming label added - we're not using any Realtime features (just in case that was the assumption).
Just to be clear, the 500s that we are seeing from the server are for GraphQL queries (presumably).

Thanks for the clarification! I'm deep into React Server Components at the moment, so when I saw ERR_STREAM... my mind immediately jumped to React Streaming. As in streaming the frontend from server to client. But that was clearly not what you were talking about 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction topic/graphql
Projects
None yet
Development

No branches or pull requests

2 participants