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

Premature close errors at end of HTTP request #4721

Open
AkselAllas opened this issue May 20, 2024 · 1 comment
Open

Premature close errors at end of HTTP request #4721

AkselAllas opened this issue May 20, 2024 · 1 comment
Labels
bug Something isn't working pkg:instrumentation-http priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect

Comments

@AkselAllas
Copy link
Contributor

AkselAllas commented May 20, 2024

Steps to Reproduce

I have 2 services where this error keeps popping up on different endpoints
It's non-fatal, traces still work.

Possibly this via this

Expected Result

Log lines of

GET TO https://service.tld/path
200 GET 100ms https://service.tld/path

Actual Result

GET TO https://service.tld/path
200 GET 100ms https://service.tld/path
Premature close

Full stacktrace:

Premature close Error: Premature close
    at new NodeError (node:internal/errors:405:5)
    at ServerResponse.onclose (node:internal/streams/end-of-stream:159:30)
    at /app/node_modules/@opentelemetry/context-async-hooks/src/AbstractAsyncHooksContextManager.ts:75:49
    at AsyncLocalStorage.run (node:async_hooks:338:14)
    at AsyncLocalStorageContextManager.with (/app/node_modules/@opentelemetry/context-async-hooks/src/AsyncLocalStorageContextManager.ts:40:36)
    at ServerResponse.contextWrapper (/app/node_modules/@opentelemetry/context-async-hooks/src/AbstractAsyncHooksContextManager.ts:75:26)
    at ServerResponse.emit (node:events:529:35)
    at ServerResponse.emit (node:domain:489:12)
    at emitCloseNT (node:_http_server:1020:10)
    at Socket.onServerResponseClose (node:_http_server:278:5)
    at Socket.emit (node:events:529:35)
    at Socket.emit (node:domain:489:12)
    at TCP.<anonymous> (node:net:350:12)
    at TCP.callbackTrampoline (node:internal/async_hooks:128:17) ExpressAdapter

and

Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
    at ServerResponse.onclose (node:internal/streams/end-of-stream:159:30)
    at /app/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:50:55
    at AsyncLocalStorage.run (node:async_hooks:346:14)
    at AsyncLocalStorageContextManager.with (/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)
    at ServerResponse.contextWrapper (/app/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:50:32)
    at ServerResponse.emit (node:events:531:35)
    at ServerResponse.emit (node:domain:488:12)
    at emitCloseNT (node:_http_server:1020:10)
    at Socket.onServerResponseClose (node:_http_server:278:5)
    at Socket.emit (node:events:531:35)

OpenTelemetry Setup Code

No response

package.json

"@opentelemetry/api": "1.7.0",
"@opentelemetry/core": "1.20.0",
"@opentelemetry/instrumentation-http": "0.47.0",

Relevant log output

No response

@AkselAllas AkselAllas added bug Something isn't working triage labels May 20, 2024
@AkselAllas AkselAllas changed the title Premature close errors at end of HTTP request Premature close errors at end of HTTP request May 20, 2024
@pichlermarc pichlermarc added priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect pkg:instrumentation-http and removed triage labels Jun 11, 2024
@GlennGeenen
Copy link

I see the same happening, we use gaxios which also uses node-fetch.

We're on:
"@opentelemetry/core": "1.22.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:instrumentation-http priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
Development

No branches or pull requests

3 participants