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

TimeoutError: The operation was aborted due to timeout #39

Closed
dazzypark opened this issue Jun 30, 2024 · 8 comments
Closed

TimeoutError: The operation was aborted due to timeout #39

dazzypark opened this issue Jun 30, 2024 · 8 comments

Comments

@dazzypark
Copy link
Contributor

An error occurs intermittently after upgrading to version 2.2.0.
It seems that an error occurred because of the photo below.
image

My node version: v20.15.0

If you downgrade to version 2.1.7, the error will not occur.

Thank you for creating the library

(It may be awkward because we used Google Translator)

2024-06-29 12:47:34 error: TimeoutError: The operation was aborted due to timeout
    at node:internal/deps/undici/undici:12502:13
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processTimers (node:internal/timers:511:9)
    at async LavalinkNode.rawRequest (/home/ubuntu/alh/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/lavalink-client/dist/cjs/structures/Node.js:90:25)
    at async LavalinkNode.request (/home/ubuntu/alh/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/lavalink-client/dist/cjs/structures/Node.js:101:38)
    at async LavalinkNode.updatePlayer (/home/ubuntu/alh/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/lavalink-client/dist/cjs/structures/Node.js:187:21)
    at async Player.play (/home/ubuntu/alh/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/lavalink-client/dist/cjs/structures/Player.js:217:9)
@Tomato6966
Copy link
Owner

Interesting, someone else also got the error, the error says undici, but i'm not using undici anymore

@Tomato6966
Copy link
Owner

I did some investings, could you please do the following:

send me the result of npm ls

Temp solution-try:

  • clear the entire npm cache with npm cache clean --force
  • rm node_modules -rf
  • npm i

I assume it's due to some weird global overwriting cause you can see it uses pnpm? don't use pnpm

to clear pnpm store cache you can use pnpm store prune

@Tomato6966
Copy link
Owner

https://nodejs.org/en/blog/vulnerability/july-2024-security-releases stated here the internal library for fetch is undici, that could be why it's a undici error

you can declare a requestTimoutMS option per node option which will add a AbortSignal.Timeout to the fetch request, so the request was aborted due to a timeout error appears either earlier or later.

The error indicates it tried to do a request and couldn't get a result after X ms.

@dazzypark
Copy link
Contributor Author

dazzypark commented Jul 12, 2024

You are right

Versions prior to 2.2.0 also resulted in intermittent 'connection timeout' errors.
So I blacklisted the "Connection timed out" error.
However, as the 'undici' version changed, the error content also changed, so the error seems to have occurred again.

“Connection timed out” errors can be caused by Internet conditions or temporary server issues.

I didn't check properly. thank you for your help :)

@Tomato6966
Copy link
Owner

Just an addition:
This library does not use undici, it's just nodejs's internal fetch api, is undici. So when you use nodejs you will see fetch errors occurring as "undici" if it happens during the request.

@Tomato6966 Tomato6966 pinned this issue Aug 22, 2024
@N1C0exe
Copy link

N1C0exe commented Sep 16, 2024

Node Version: 20.10.0

I've added requestSignalTimeoutMS: 3000 but it's still giving the error


DOMException [TimeoutError]: The operation was aborted due to timeout
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async LavalinkNode.rawRequest (C:\Coding\exeMusic-v14\node_modules\.pnpm\[email protected]\node_modules\lavalink-client\dist\cjs\structures\Node.js:146:25)
    at async LavalinkNode.request (C:\Coding\exeMusic-v14\node_modules\.pnpm\[email protected]\node_modules\lavalink-client\dist\cjs\structures\Node.js:164:38)
    at async LavalinkNode.search (C:\Coding\exeMusic-v14\node_modules\.pnpm\[email protected]\node_modules\lavalink-client\dist\cjs\structures\Node.js:206:21)

@Tomato6966
Copy link
Owner

This means the request took longer than 3000ms

@N1C0exe
Copy link

N1C0exe commented Sep 28, 2024

Should I put a bigger value? Bec also in prod I recive a spam of theese errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants