-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Sentry.GCPFunction.wrapHttpFunction cause Error [ERR_STREAM_WRITE_AFTER_END]: write after end #8848
Comments
Hi @jiangbo0216, thanks for writing in and for opening a PR! We're very busy this week but we'll try to look into this next week. Thanks! |
hava any update?
|
What's happening with this issue? We're looking to use Sentry but this issues prevents us from using it in our serverless functions environment |
Hey @simonnztg thanks for writing in. We're currently on company-wide hackweek and thus on limited support. We'll take another look at this next week. |
Hi, @simonnztg currently we are not working on this issue because bluntly said, the (Corporate speech off: I low-key want to use GCP functions for my side project so this integration may get some love soon.) |
Thanks for getting back to me. I thought this might be the case, and I have a workaround in place so we can keep using it for now. FWIW, functions support was one of the main things that attracted me to Sentry. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Is there an existing issue for this?
How do you use Sentry?
Self-hosted/on-premise
Which SDK are you using?
@sentry/serverless
SDK Version
"@sentry/serverless": "^7.64.0"
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
new a simple google-cloud demo
pnpm i @google-cloud/functions-framework @sentry/serverless
Expected Result
process run and don't exit
Actual Result
link: #2344
get a error: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
sentry patch end function, cause res.end turn sync to async
sentry-javascript/packages/serverless/src/gcpfunction/http.ts
Lines 105 to 118 in 2d80b4b
and @google-cloud/functions-framework depend res.end onfinished to handle error
https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/35533b76face60714a9f6050aaced98da231016b/src/server.ts#L137-L143
https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/35533b76face60714a9f6050aaced98da231016b/src/function_wrappers.ts#L105-L130
in this case,
start to end response but it is async
so when a error in user handler,
errorHandler will be triggered, and sendCrashResponse will be called, At this point, Error [ERR_STREAM_WRITE_AFTER_END]: write after end may occur
The text was updated successfully, but these errors were encountered: