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

BodyTimeoutError: Body Timeout Error | Closing process #2997

Open
Probabilities opened this issue Mar 26, 2024 · 1 comment
Open

BodyTimeoutError: Body Timeout Error | Closing process #2997

Probabilities opened this issue Mar 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Probabilities
Copy link

Bug Description

I get this error

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

BodyTimeoutError: Body Timeout Error
    at Timeout.onParserTimeout [as callback] (C:\Users\admin\Documents\GitHub\project\node_modules\undici\lib\dispatcher\client-h1.js:639:28)
    at Timeout.onTimeout [as _onTimeout] (C:\Users\admin\Documents\GitHub\project\node_modules\undici\lib\util\timers.js:20:13)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7) {
  code: 'UND_ERR_BODY_TIMEOUT'
}

Node.js v18.5.0

Once I get this error my app will close. I am catching any errors made by my undici request.

Reproducible By

const res = await request(url, Object.assign(options, this.extraConfiguration)).catch((e) => {
    return resolve({})
})

options = simple headers and request body
this.extraConfiguration is my proxyagent

const { ProxyAgent } = require('undici');

const parsed_url = new URL(proxy);
this.agent = new ProxyAgent({
    uri: proxy
})

if (parsed_url?.username && parsed_url?.password) {
    this.agent = new ProxyAgent({
        uri: proxy,
        auth: Buffer.from(`${parsed_url.username}:${parsed_url.password}`).toString('base64')
    })
}

Expected Behavior

Error should be caught.

Logs & Screenshots

Environment

Windows 11
Node version: 18.5.0

Additional context

@Probabilities Probabilities added the bug Something isn't working label Mar 26, 2024
@metcoder95
Copy link
Member

Can you provide an
Minimum Reproducible Example that isolates the issue?

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

2 participants