api server exits while downloading audio/video file from Youtube #741

Closed
opened 2025-11-09 09:57:17 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @raelb on GitHub (Mar 3, 2025).

bug description

I'm running cobalt locally, i.e. on Windows 10. When I download a youtube video/audio, the api server exits at some variable point during the download.

reproduction steps

I clone the repo and follow the instructions to get the local api server running
I start the api server with: pnpm start - it runs on http://localhost:9000/
I start the web interface with pnpm dev start - it runs on https://localhost:5173/
I am running the web client on Chrome browser.
I select the "audio" option from cobalt. I attempt to download a youtube url:
e.g. https://www.youtube.com/watch?v=tNBufpGQihY (the audio is 5m46s)
Towards the end of the download, the api server exits, with below trace:

node:events:498
throw er; // Unhandled 'error' event
^

Error: kill EPERM
at ChildProcess.kill (node:internal/child_process:512:26)
at killProcess (file:///D:/Tutorials/Apps/cobalt/api/src/stream/types.js:48:8)
at ServerResponse.shutdown (file:///D:/Tutorials/Apps/cobalt/api/src/stream/types.js:231:9)
at ServerResponse.emit (node:events:532:35)
at onFinish (node:_http_outgoing:1081:10)
at afterWrite (node:internal/streams/writable:708:5)
at afterWriteTick (node:internal/streams/writable:694:10)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.kill (node:internal/child_process:512:12)
at killProcess (file:///D:/Tutorials/Apps/cobalt/api/src/stream/types.js:48:8)
[... lines matching original stack trace ...]
at process.processTicksAndRejections (node:internal/process/task_queues:81:21) {
errno: -4048,
code: 'EPERM',
syscall: 'kill'
}

Node.js v22.4.1
 ELIFECYCLE  Command failed with exit code 1.


This may have not happened the first time, but on subsequent tries, in the chrome download progress indicator, I see the file downloading, i.e. MB's increase, until it says "Done", however, I have a network meter (NetMeter), which shows only a short initial download traffic, but for most of the download time it shows 0 bytes traffic.

screenshots

No response


platform information

chrome on Windows 10 x64

additional context

No response

Originally created by @raelb on GitHub (Mar 3, 2025). ### bug description I'm running cobalt locally, i.e. on Windows 10. When I download a youtube video/audio, the api server exits at some variable point during the download. ### reproduction steps I clone the repo and follow the instructions to get the local api server running I start the api server with: `pnpm start` - it runs on `http://localhost:9000/` I start the web interface with `pnpm dev start` - it runs on `https://localhost:5173/` I am running the web client on Chrome browser. I select the "audio" option from cobalt. I attempt to download a youtube url: e.g. https://www.youtube.com/watch?v=tNBufpGQihY (the audio is 5m46s) Towards the end of the download, the api server exits, with below trace: node:events:498 throw er; // Unhandled 'error' event ^ Error: kill EPERM at ChildProcess.kill (node:internal/child_process:512:26) at killProcess (file:///D:/Tutorials/Apps/cobalt/api/src/stream/types.js:48:8) at ServerResponse.shutdown (file:///D:/Tutorials/Apps/cobalt/api/src/stream/types.js:231:9) at ServerResponse.emit (node:events:532:35) at onFinish (node:_http_outgoing:1081:10) at afterWrite (node:internal/streams/writable:708:5) at afterWriteTick (node:internal/streams/writable:694:10) at process.processTicksAndRejections (node:internal/process/task_queues:81:21) Emitted 'error' event on ChildProcess instance at: at ChildProcess.kill (node:internal/child_process:512:12) at killProcess (file:///D:/Tutorials/Apps/cobalt/api/src/stream/types.js:48:8) [... lines matching original stack trace ...] at process.processTicksAndRejections (node:internal/process/task_queues:81:21) { errno: -4048, code: 'EPERM', syscall: 'kill' } Node.js v22.4.1  ELIFECYCLE  Command failed with exit code 1. --- This may have not happened the first time, but on subsequent tries, in the chrome download progress indicator, I see the file downloading, i.e. MB's increase, until it says "Done", however, I have a network meter (NetMeter), which shows only a short initial download traffic, but for most of the download time it shows 0 bytes traffic. ### screenshots _No response_ ### links ```shell ``` ### platform information chrome on Windows 10 x64 ### additional context _No response_
GiteaMirror added the bug label 2025-11-09 09:57:17 -06:00
Author
Owner

@dumbmoron commented on GitHub (Mar 4, 2025):

can you try updating your node.js to the latest version (v22.14.0) and see if the issue still persists?

@dumbmoron commented on GitHub (Mar 4, 2025): can you try updating your node.js to the latest version (v22.14.0) and see if the issue still persists?
Author
Owner

@raelb commented on GitHub (Mar 4, 2025):

That does seem to have solved the problem. Thanks

@raelb commented on GitHub (Mar 4, 2025): That does seem to have solved the problem. Thanks
Sign in to join this conversation.