Radiicall / jellyfin-rpc

Displays the content you're currently watching on Discord!
GNU General Public License v3.0
238 stars 18 forks source link

The pipe is being closed. (os error 232) #137

Closed MeronNagy closed 2 months ago

MeronNagy commented 3 months ago

Is there an existing issue for this?

Have you ran the program with debug logging?

What went wrong?

When Jellyfin video is paused this error happens every 15-45 seconds and leads to Discord activity disappearing temporarily. This also occasionally happens while a video is running, I've been trying out different versions but can't really find any common denominator.

Terminal output

2024-08-04 15:00:02 DEBUG [jellyfin_rpc] Found 1 sessions
2024-08-04 15:00:02 DEBUG [jellyfin_rpc] Session username is Some("mn")
2024-08-04 15:00:02 DEBUG [jellyfin_rpc] NowPlayingItem exists
2024-08-04 15:00:02 DEBUG [jellyfin_rpc] PlayState exists
2024-08-04 15:00:02 DEBUG [hyper_util::client::legacy::pool] reuse idle connection for ("https", <omitted>)
2024-08-04 15:00:02 DEBUG [hyper_util::client::legacy::pool] pooling idle connection for ("https", <omitted>)
2024-08-04 15:00:02 DEBUG [jellyfin_rpc] Ancestors: [Item { name: Some("Season 1") }, Item { name: Some("Girls Band Cry") }, Item { name: Some("JF_SERIES") }, Item { name: Some("root") }]
2024-08-04 15:00:02 ERROR [jellyfin_rpc] The pipe is being closed. (os error 232)
2024-08-04 15:00:02 DEBUG [jellyfin_rpc] Os { code: 232, kind: BrokenPipe, message: "The pipe is being closed." }
2024-08-04 15:00:02 INFO  [jellyfin_rpc] Attempt 1: Trying to reconnect
2024-08-04 15:00:03 INFO  [jellyfin_rpc] Reconnected!

Jellyfin-RPC version

v1.2.2

What OS are you using?

Windows 11 Pro 23H2 22631.3880

What version is the Jellyfin server on?

10.9.8

Anything else?

Tried v1.1.0 - v1.2.2.

Radiicall commented 3 months ago

how much ram do you have?

MeronNagy commented 3 months ago

how much ram do you have?

Processor 13th Gen Intel(R) Core(TM) i7-13700K 3.40 GHz Installed RAM 64,0 GB (63,6 GB usable) System type 64-bit operating system, x64-based processor

I don't think its RAM related even at 15% Memory Usage (only Discord and Jellyfin client running) it happens occasionally.

Radiicall commented 3 months ago

how much ram do you have?

Processor 13th Gen Intel(R) Core(TM) i7-13700K 3.40 GHz Installed RAM 64,0 GB (63,6 GB usable) System type 64-bit operating system, x64-based processor

I don't think its RAM related even at 15% Memory Usage (only Discord and Jellyfin client running) it happens occasionally.

yeah I was asking cause ive been seeing that when full on ram even though jellyfin-rpc only uses around 5mb on my system, maybe try increasing wait time jellyfin-rpc.exe --wait-time 5 the default is 3

MeronNagy commented 3 months ago

Increasing the wait time helped thanks! It still happened roughly once an hour with --wait-time 5 but has been running with zero issues now for the past 5 hours with --wait-time 7

For anybody also encountering this using Services: Replace {USERNAME} with your Username Update C:\Users\{USERNAME}\AppData\Roaming\jellyfin-rpc\winsw.xml arguments line:

<arguments>--wait-time 7 -c C:\Users\{Username}\AppData\Roaming\jellyfin-rpc\main.json -i C:\Users\{Username}\AppData\Roaming\jellyfin-rpc\urls.json</arguments>

In the terminal:

C:\Users\{USERNAME}\AppData\Roaming\jellyfin-rpc\winsw.exe stop
C:\Users\{USERNAME}\AppData\Roaming\jellyfin-rpc\winsw.exe uninstall
C:\Users\{USERNAME}\AppData\Roaming\jellyfin-rpc\winsw.exe install
C:\Users\{USERNAME}\AppData\Roaming\jellyfin-rpc\winsw.exe start
Radiicall commented 3 months ago

hmm i might have to adjust the code if this is the case

Radiicall commented 3 months ago

So discord only allows updating the status 5 times per 20 seconds, this does not comply with my code which currently does 6-7 updates per 20 seconds