Voxelum / minecraft-launcher-core-node

Provide packages to install Minecraft, launch Minecraft and more to build launcher with NodeJs/Electron!
https://docs.xmcl.app/en/core/
MIT License
178 stars 26 forks source link

Assets download error ECONNRESET #268

Open Natoune opened 1 year ago

Natoune commented 1 year ago

When I run the assets download (with installDependenciesTask()) I get many errors like this:

Error: read ECONNRESET
       at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) {
     errno:-4077,
     code: 'ECONNRESET',
     syscall: 'read',
     url: 'https://resources.download.minecraft.net/89/893e37d8d608cccd9c2404e785597c6a7c5f3593'
}

Coming from line 556 of @xmcl/file-transfer/dist/index.js

But when I try again to download the assets with my 4G and not my WiFi, it works...

Do you know where this problem can come from?

Thanks

ci010 commented 1 year ago

Guess you can try to limit the undici connection count. Connection reset usually means the server rejecting your request since you request too much or keep a connection too long.

I also encounter this issue sometime. So I think this is an open question about how to avoid this case.

Faeranne commented 1 year ago

As I'm also having the same issue (and would rather not just rely on rerunning the tasks several times), I'm curious how one would go about limiting the connection count? I see Undici has a Pool option, but I'm not seeing that being used here, so I'm curious how to enable that limit? Or is this a case where there is no way, and if so, would a connection limit option be a safe-ish fix for this?