Tomato6966 / lavalink-client

Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.
https://tomato6966.github.io/lavalink-client/
MIT License
48 stars 12 forks source link

TimeoutError: The operation was aborted due to timeout #39

Closed dazzypark closed 2 weeks ago

dazzypark commented 3 weeks ago

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/lavalink-client@2.2.0_bufferutil@4.0.8_utf-8-validate@6.0.4/node_modules/lavalink-client/dist/cjs/structures/Node.js:90:25)
    at async LavalinkNode.request (/home/ubuntu/alh/node_modules/.pnpm/lavalink-client@2.2.0_bufferutil@4.0.8_utf-8-validate@6.0.4/node_modules/lavalink-client/dist/cjs/structures/Node.js:101:38)
    at async LavalinkNode.updatePlayer (/home/ubuntu/alh/node_modules/.pnpm/lavalink-client@2.2.0_bufferutil@4.0.8_utf-8-validate@6.0.4/node_modules/lavalink-client/dist/cjs/structures/Node.js:187:21)
    at async Player.play (/home/ubuntu/alh/node_modules/.pnpm/lavalink-client@2.2.0_bufferutil@4.0.8_utf-8-validate@6.0.4/node_modules/lavalink-client/dist/cjs/structures/Player.js:217:9)
Tomato6966 commented 3 weeks ago

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

Tomato6966 commented 3 weeks ago

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

send me the result of npm ls

Temp solution-try:

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 commented 3 weeks ago

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 commented 2 weeks ago

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 :)